diff --git a/.bazelversion b/.bazelversion index 8104cab..6d28907 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -8.1.0 +8.5.0 diff --git a/MODULE.bazel b/MODULE.bazel index caf58ea..7316690 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -21,7 +21,7 @@ module( # Python version # ############################################################################### -bazel_dep(name = "rules_python", version = "1.4.1") +bazel_dep(name = "rules_python", version = "1.8.5") PYTHON_VERSION = "3.12" @@ -30,7 +30,6 @@ python.toolchain( is_default = True, python_version = PYTHON_VERSION, ) -use_repo(python) ############################################################################### # @@ -51,40 +50,35 @@ use_repo(pip, "itf_pip") # Provides formatting and linting of Bazel files. # ############################################################################### -bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2") +bazel_dep(name = "buildifier_prebuilt", version = "8.2.1.2", dev_dependency = True) ############################################################################### # # Generic linting and formatting rules # ############################################################################### -bazel_dep(name = "aspect_rules_lint", version = "1.0.0-rc9") -git_override( - module_name = "aspect_rules_lint", - commit = "b5dfbc12754d6698c36d0aaad46183e730dac85c", - remote = "https://github.com/ltekieli/rules_lint.git", -) +bazel_dep(name = "aspect_rules_lint", version = "2.2.0", dev_dependency = True) ############################################################################### # # C++ rules # ############################################################################### -bazel_dep(name = "rules_cc", version = "0.1.1") +bazel_dep(name = "rules_cc", version = "0.2.17") ############################################################################### # # Shell dependency # ############################################################################### -bazel_dep(name = "rules_shell", version = "0.6.0") +bazel_dep(name = "rules_shell", version = "0.6.1") ############################################################################### # # Container dependencies # ############################################################################### -bazel_dep(name = "rules_oci", version = "1.8.0") +bazel_dep(name = "rules_oci", version = "2.2.7", dev_dependency = True) oci = use_extension("@rules_oci//oci:extensions.bzl", "oci", dev_dependency = True) @@ -98,14 +92,14 @@ oci.pull( ) # For each oci.pull call, repeat the "name" here to expose them as dependencies. -use_repo(oci, "ubuntu_24_04") +use_repo(oci, "ubuntu_24_04", "ubuntu_24_04_linux_amd64") ############################################################################### # # Packaging dependencies # ############################################################################### -bazel_dep(name = "rules_pkg", version = "1.0.1") +bazel_dep(name = "rules_pkg", version = "1.2.0", dev_dependency = True) ############################################################################### # diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel index 6b6a0d4..841d194 100644 --- a/examples/MODULE.bazel +++ b/examples/MODULE.bazel @@ -55,23 +55,23 @@ register_toolchains("@llvm_toolchain//:all") # C++ rules # ############################################################################### -bazel_dep(name = "rules_cc", version = "0.1.1") +bazel_dep(name = "rules_cc", version = "0.2.17") ############################################################################### # # Shell dependency # ############################################################################### -bazel_dep(name = "rules_shell", version = "0.6.0") +bazel_dep(name = "rules_shell", version = "0.6.1") ############################################################################### # # Container dependencies # ############################################################################### -bazel_dep(name = "rules_oci", version = "1.8.0") +bazel_dep(name = "rules_oci", version = "2.2.7") -oci = use_extension("@rules_oci//oci:extensions.bzl", "oci", dev_dependency = True) +oci = use_extension("@rules_oci//oci:extensions.bzl", "oci") # Declare external images you need to pull, for example: oci.pull( @@ -83,21 +83,21 @@ oci.pull( ) # For each oci.pull call, repeat the "name" here to expose them as dependencies. -use_repo(oci, "ubuntu_24_04_examples") +use_repo(oci, "ubuntu_24_04_examples", "ubuntu_24_04_examples_linux_amd64") ############################################################################### # # Packaging dependencies # ############################################################################### -bazel_dep(name = "rules_pkg", version = "1.0.1") +bazel_dep(name = "rules_pkg", version = "1.2.0") ############################################################################### # # Google Test dependency # ############################################################################### -bazel_dep(name = "googletest", version = "1.15.0") +bazel_dep(name = "googletest", version = "1.17.0") ################################################################################ # diff --git a/examples/examples/docker/BUILD b/examples/examples/docker/BUILD index 580a022..277bc47 100644 --- a/examples/examples/docker/BUILD +++ b/examples/examples/docker/BUILD @@ -10,7 +10,7 @@ # # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball") +load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load") oci_image( name = "image", @@ -20,8 +20,8 @@ oci_image( ], ) -oci_tarball( - name = "image_tarball", +oci_load( + name = "image_load", image = ":image", repo_tags = ["score_itf_examples:latest"], visibility = ["//examples/itf:__pkg__"], diff --git a/examples/examples/itf/BUILD b/examples/examples/itf/BUILD index 238440d..52d5cb1 100644 --- a/examples/examples/itf/BUILD +++ b/examples/examples/itf/BUILD @@ -19,10 +19,10 @@ py_itf_test( "test_docker.py", ], args = [ - "--docker-image-bootstrap=$(location //examples/docker:image_tarball)", + "--docker-image-bootstrap=$(location //examples/docker:image_load)", "--docker-image=score_itf_examples:latest", ], - data = ["//examples/docker:image_tarball"], + data = ["//examples/docker:image_load"], plugins = [ docker, ], @@ -62,7 +62,6 @@ py_itf_test( dlt, ], tags = [ - "local", "manual", ], ) @@ -85,7 +84,6 @@ py_itf_test( dlt, ], tags = [ - "local", "manual", ], ) diff --git a/score/itf/core/com/sftp.py b/score/itf/core/com/sftp.py index f255e7c..b288925 100644 --- a/score/itf/core/com/sftp.py +++ b/score/itf/core/com/sftp.py @@ -102,9 +102,9 @@ def upload(self, local_path, remote_path, verbose=True): if not os.path.exists(local_path): logger.error(f"Missing file '{local_path}' while trying to upload") remote_dir = os.path.dirname(remote_path) - assert ( - self._ssh.execute_command(f"test -d {remote_dir} || mkdir -p {remote_dir}") == 0 - ), f"Could not create remote path: {os.path.dirname(remote_path)}" + assert self._ssh.execute_command(f"test -d {remote_dir} || mkdir -p {remote_dir}") == 0, ( + f"Could not create remote path: {os.path.dirname(remote_path)}" + ) self._sftp.put(local_path, remote_path) def list_dirs_and_files(self, remote_path): diff --git a/score/itf/plugins/qemu/qemu_target.py b/score/itf/plugins/qemu/qemu_target.py index 5b3fab9..6728536 100644 --- a/score/itf/plugins/qemu/qemu_target.py +++ b/score/itf/plugins/qemu/qemu_target.py @@ -122,14 +122,18 @@ def ping_lost(self, timeout, interval=1, wait_ms_precision=None): @contextmanager def qemu_target(test_config): """Context manager for QEMU target setup.""" - with QemuProcess( - test_config.qemu_image, - test_config.qemu_config.qemu_ram_size, - test_config.qemu_config.qemu_num_cores, - network_adapters=[adapter.name for adapter in test_config.qemu_config.networks], - port_forwarding=test_config.qemu_config.port_forwarding - if hasattr(test_config.qemu_config, "port_forwarding") - else [], - ) if test_config.qemu_image else nullcontext() as qemu_process: + with ( + QemuProcess( + test_config.qemu_image, + test_config.qemu_config.qemu_ram_size, + test_config.qemu_config.qemu_num_cores, + network_adapters=[adapter.name for adapter in test_config.qemu_config.networks], + port_forwarding=test_config.qemu_config.port_forwarding + if hasattr(test_config.qemu_config, "port_forwarding") + else [], + ) + if test_config.qemu_image + else nullcontext() as qemu_process + ): target = QemuTarget(qemu_process, test_config.qemu_config) yield target diff --git a/test/BUILD b/test/BUILD index 316a943..02d7ef4 100644 --- a/test/BUILD +++ b/test/BUILD @@ -40,10 +40,10 @@ py_itf_test( "test_dlt.py", ], args = [ - "--docker-image-bootstrap=$(location //test/resources:image_tarball)", + "--docker-image-bootstrap=$(location //test/resources:image_load)", "--docker-image=score_itf_examples:latest", ], - data = ["//test/resources:image_tarball"], + data = ["//test/resources:image_load"], plugins = [ dlt, docker, diff --git a/test/resources/BUILD b/test/resources/BUILD index fdca91a..36bc323 100644 --- a/test/resources/BUILD +++ b/test/resources/BUILD @@ -10,7 +10,7 @@ # # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball") +load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load") load("@rules_pkg//pkg:tar.bzl", "pkg_tar") filegroup( @@ -86,8 +86,8 @@ oci_image( ], ) -oci_tarball( - name = "image_tarball", +oci_load( + name = "image_load", image = ":image", repo_tags = ["score_itf_examples:latest"], visibility = [