From eb1d61ec2f4d9059a99e754b32328ef1025862bd Mon Sep 17 00:00:00 2001 From: Igor Ostrowski Date: Tue, 13 Jan 2026 13:10:07 +0100 Subject: [PATCH] testing: Unify component integration tests structure --- .../workflows/component_integration_tests.yml | 10 +++---- BUILD | 4 +-- Cargo.lock | 26 ++++++++--------- Cargo.toml | 2 +- MODULE.bazel | 2 +- pyproject.toml | 16 +++++++++++ src/cpp/src/BUILD | 2 +- tests/README.md | 28 +++++++++---------- tests/integration_test_scenarios/BUILD | 8 +++--- .../init_rpi4.build | 2 +- tests/python_test_cases/pyproject.toml | 8 ------ tests/{python_test_cases => test_cases}/BUILD | 16 +++++------ .../pytest.ini | 1 + .../requirements.txt | 2 +- .../requirements.txt.lock | 22 +++++++-------- .../tests/__init__.py | 0 .../tests/common.py | 0 .../tests/conftest.py | 6 ++-- .../tests/test_basic.py | 3 +- .../tests/test_cit_default_values.py | 4 +-- .../tests/test_cit_multiple_kvs.py | 3 +- .../tests/test_cit_persistency.py | 3 +- .../tests/test_cit_snapshots.py | 5 ++-- .../tests/test_cit_supported_datatypes.py | 3 +- .../cpp}/BUILD | 2 +- .../cpp}/src/cit/cit.cpp | 0 .../cpp}/src/cit/cit.hpp | 0 .../cpp}/src/cit/default_values.cpp | 0 .../cpp}/src/cit/default_values.hpp | 0 .../cpp}/src/cit/multiple_kvs.cpp | 0 .../cpp}/src/cit/multiple_kvs.hpp | 0 .../cpp}/src/cit/snapshots.cpp | 0 .../cpp}/src/cit/snapshots.hpp | 0 .../cpp}/src/cit/supported_datatypes.cpp | 0 .../cpp}/src/cit/supported_datatypes.hpp | 0 .../cpp}/src/helpers/helpers.cpp | 0 .../cpp}/src/helpers/helpers.hpp | 0 .../cpp}/src/helpers/kvs_instance.cpp | 0 .../cpp}/src/helpers/kvs_instance.hpp | 0 .../cpp}/src/helpers/kvs_parameters.cpp | 0 .../cpp}/src/helpers/kvs_parameters.hpp | 0 .../cpp}/src/main.cpp | 0 .../cpp}/src/test_basic.cpp | 0 .../cpp}/src/test_basic.hpp | 0 .../rust}/BUILD | 4 +-- .../rust}/Cargo.toml | 2 +- .../rust}/src/cit/default_values.rs | 0 .../rust}/src/cit/mod.rs | 0 .../rust}/src/cit/multiple_kvs.rs | 0 .../rust}/src/cit/persistency.rs | 0 .../rust}/src/cit/snapshots.rs | 0 .../rust}/src/cit/supported_datatypes.rs | 0 .../rust}/src/helpers/kvs_instance.rs | 0 .../rust}/src/helpers/kvs_parameters.rs | 0 .../rust}/src/helpers/mod.rs | 0 .../rust}/src/main.rs | 0 .../rust}/src/test_basic.rs | 0 57 files changed, 94 insertions(+), 90 deletions(-) create mode 100644 pyproject.toml delete mode 100644 tests/python_test_cases/pyproject.toml rename tests/{python_test_cases => test_cases}/BUILD (79%) rename tests/{python_test_cases => test_cases}/pytest.ini (97%) rename tests/{python_test_cases => test_cases}/requirements.txt (67%) rename tests/{python_test_cases => test_cases}/requirements.txt.lock (89%) rename tests/{python_test_cases => test_cases}/tests/__init__.py (100%) rename tests/{python_test_cases => test_cases}/tests/common.py (100%) rename tests/{python_test_cases => test_cases}/tests/conftest.py (96%) rename tests/{python_test_cases => test_cases}/tests/test_basic.py (96%) rename tests/{python_test_cases => test_cases}/tests/test_cit_default_values.py (99%) rename tests/{python_test_cases => test_cases}/tests/test_cit_multiple_kvs.py (99%) rename tests/{python_test_cases => test_cases}/tests/test_cit_persistency.py (97%) rename tests/{python_test_cases => test_cases}/tests/test_cit_snapshots.py (99%) rename tests/{python_test_cases => test_cases}/tests/test_cit_supported_datatypes.py (99%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/BUILD (96%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/cit.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/cit.hpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/default_values.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/default_values.hpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/multiple_kvs.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/multiple_kvs.hpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/snapshots.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/snapshots.hpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/supported_datatypes.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/cit/supported_datatypes.hpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/helpers/helpers.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/helpers/helpers.hpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/helpers/kvs_instance.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/helpers/kvs_instance.hpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/helpers/kvs_parameters.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/helpers/kvs_parameters.hpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/main.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/test_basic.cpp (100%) rename tests/{cpp_test_scenarios => test_scenarios/cpp}/src/test_basic.hpp (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/BUILD (91%) rename tests/{rust_test_scenarios => test_scenarios/rust}/Cargo.toml (93%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/cit/default_values.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/cit/mod.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/cit/multiple_kvs.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/cit/persistency.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/cit/snapshots.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/cit/supported_datatypes.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/helpers/kvs_instance.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/helpers/kvs_parameters.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/helpers/mod.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/main.rs (100%) rename tests/{rust_test_scenarios => test_scenarios/rust}/src/test_basic.rs (100%) diff --git a/.github/workflows/component_integration_tests.yml b/.github/workflows/component_integration_tests.yml index 48d668a5..ca043c42 100644 --- a/.github/workflows/component_integration_tests.yml +++ b/.github/workflows/component_integration_tests.yml @@ -46,11 +46,11 @@ jobs: - name: Build C++ test scenarios with Bazel run: | - bazel build --config=per-x86_64-linux //tests/cpp_test_scenarios:cpp_test_scenarios + bazel build --config=per-x86_64-linux //tests/test_scenarios/cpp:test_scenarios - name: Build Rust test scenarios with Bazel run: | - bazel build //tests/rust_test_scenarios:rust_test_scenarios + bazel build //tests/test_scenarios/rust:test_scenarios - name: Set up Python 3 uses: actions/setup-python@v5 @@ -58,14 +58,12 @@ jobs: python-version: '3.12' - name: Set up Python virtual environment - working-directory: tests/python_test_cases run: | python -m venv .venv source .venv/bin/activate - pip install . + pip install -r tests/test_cases/requirements.txt - name: Run Python tests with pytest - working-directory: tests/python_test_cases run: | source .venv/bin/activate - python -m pytest + python -m pytest --traces=all diff --git a/BUILD b/BUILD index f967eb61..aff49b6b 100644 --- a/BUILD +++ b/BUILD @@ -129,8 +129,8 @@ test_suite( test_suite( name = "cit_tests", tests = [ - "//tests/python_test_cases:cit_cpp", - "//tests/python_test_cases:cit_rust", + "//tests/test_cases:cit_cpp", + "//tests/test_cases:cit_rust", ], visibility = ["//visibility:public"], ) diff --git a/Cargo.lock b/Cargo.lock index 1489a6d2..bd213c36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,19 +153,6 @@ dependencies = [ "tinyjson", ] -[[package]] -name = "rust_test_scenarios" -version = "0.1.0" -dependencies = [ - "rust_kvs", - "serde", - "serde_json", - "test_scenarios_rust", - "tinyjson", - "tracing", - "tracing-subscriber", -] - [[package]] name = "rustix" version = "1.0.7" @@ -256,6 +243,19 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "test_scenarios" +version = "0.1.0" +dependencies = [ + "rust_kvs", + "serde", + "serde_json", + "test_scenarios_rust", + "tinyjson", + "tracing", + "tracing-subscriber", +] + [[package]] name = "test_scenarios_rust" version = "0.3.0" diff --git a/Cargo.toml b/Cargo.toml index bcbd8227..1fac0e07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = [ "src/rust/rust_kvs", "src/rust/rust_kvs_tool", - "tests/rust_test_scenarios", + "tests/test_scenarios/rust", ] diff --git a/MODULE.bazel b/MODULE.bazel index cde0e717..8c70910b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -33,7 +33,7 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_depen pip.parse( hub_name = "pip_score_venv_test", python_version = PYTHON_VERSION, - requirements_lock = "//tests/python_test_cases:requirements.txt.lock", + requirements_lock = "//tests/test_cases:requirements.txt.lock", ) use_repo(pip, "pip_score_venv_test") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..ce395bd4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[tool.pytest] +addopts = ["-v"] +pythonpath = [ + "tests/test_cases", + "tests/test_cases/tests", +] +testpaths = ["tests/test_cases/tests"] +markers = [ + "root_required", # root permissions are required for this test + "do_not_repeat", # do not repeat this test when using pytest-repeat + "only_nightly", # run this test only in nightly runs +] +junit_log_passing_tests = true + +[tool.pytest_env] +RUST_BACKTRACE = {value = "1", skip_if_set = true} diff --git a/src/cpp/src/BUILD b/src/cpp/src/BUILD index bb6baecd..a3a80744 100644 --- a/src/cpp/src/BUILD +++ b/src/cpp/src/BUILD @@ -42,7 +42,7 @@ cc_library( includes = ["."], visibility = [ "//:__pkg__", - "//tests/cpp_test_scenarios:__pkg__", + "//tests/test_scenarios/cpp:__pkg__", ], deps = [ ":kvsvalue", diff --git a/tests/README.md b/tests/README.md index 5d95ac3b..80077ae0 100644 --- a/tests/README.md +++ b/tests/README.md @@ -9,7 +9,7 @@ Create `venv`, activate and install dependencies: ```bash python -m venv /.venv source /.venv/bin/activate -pip install -r /tests/python_test_cases/requirements.txt +pip install -r /tests/test_cases/requirements.txt ``` ## Usage @@ -17,7 +17,7 @@ pip install -r /tests/python_test_cases/requirements.txt Set current working directory to the following: ```bash -cd /tests/python_test_cases +cd /tests/test_cases ``` ### Run tests @@ -75,16 +75,16 @@ Run all Component Integration Tests: bazel test //:cit_tests ``` -When the dependencies in [requirements.txt](python_test_cases/requirements.txt) file are manually modified, the user should invoke command and commit changes: +When the dependencies in [requirements.txt](test_cases/requirements.txt) file are manually modified, the user should invoke command and commit changes: ```bash -bazel run //tests/python_test_cases:requirements.update +bazel run //tests/test_cases:requirements.update ``` In order to update all dependencies use: ```bash -bazel run //tests/python_test_cases:requirements.update -- --upgrade +bazel run //tests/test_cases:requirements.update -- --upgrade ``` ## Standalone execution of test scenarios @@ -96,7 +96,7 @@ Test scenarios can be run independently from `pytest`. Set current working directory to the following: ```bash -cd /tests/rust_test_scenarios +cd /tests/test_scenarios/rust ``` List all available scenarios: @@ -120,7 +120,7 @@ cargo run -- --name basic.basic --input '{"kvs_parameters":{"instance_id":0}}' Run test scenario executable directly: ```bash -/target/debug/rust_test_scenarios --name basic.basic --input '{"kvs_parameters":{"instance_id":0}}' +/target/debug/test_scenarios --name basic.basic --input '{"kvs_parameters":{"instance_id":0}}' ``` ### C++ @@ -128,36 +128,36 @@ Run test scenario executable directly: Set current working directory to the following: ```bash -cd /tests/cpp_test_scenarios +cd /tests/test_scenarios/cpp ``` List all available scenarios: ```bash -bazel run //tests/cpp_test_scenarios:cpp_test_scenarios -- --list-scenarios +bazel run //tests/test_scenarios/cpp:test_scenarios -- --list-scenarios ``` Run specific test scenario: ```bash -bazel run //tests/cpp_test_scenarios:cpp_test_scenarios -- --name . --input +bazel run //tests/test_scenarios/cpp:test_scenarios -- --name . --input ``` Example: ```bash -bazel run //tests/cpp_test_scenarios:cpp_test_scenarios -- --name basic.basic --input '{"kvs_parameters":{"instance_id":0}}' +bazel run //tests/test_scenarios/cpp:test_scenarios -- --name basic.basic --input '{"kvs_parameters":{"instance_id":0}}' ``` Run test scenario executable directly: ```bash -/bazel-bin/tests/cpp_test_scenarios/cpp_test_scenarios --name basic.basic --input '{"kvs_parameters":{"instance_id":0}}' +/bazel-bin/tests/test_scenarios/cpp/test_scenarios --name basic.basic --input '{"kvs_parameters":{"instance_id":0}}' ``` Run with GDB: ```bash -bazel build //tests/cpp_test_scenarios:cpp_test_scenarios -c dbg --strip never -gdb --args /bazel-bin/tests/cpp_test_scenarios/cpp_test_scenarios --name . --input '{"kvs_parameters":{"instance_id":0}}' +bazel build //tests/test_scenarios/cpp:test_scenarios -c dbg --strip never +gdb --args /bazel-bin/tests/test_scenarios/cpp/test_scenarios --name . --input '{"kvs_parameters":{"instance_id":0}}' ``` diff --git a/tests/integration_test_scenarios/BUILD b/tests/integration_test_scenarios/BUILD index 48b7fc5d..75b4715e 100644 --- a/tests/integration_test_scenarios/BUILD +++ b/tests/integration_test_scenarios/BUILD @@ -56,14 +56,14 @@ genrule( ) # state the tests too -#TODO: enable when rust_test_scenarios is built for QNX +#TODO: enable when test_scenarios/rust:test_scenarios is built for QNX #genrule( # name = "stage_rust_test_scenarios", -# srcs = ["//tests/rust_test_scenarios:rust_test_scenarios"], -# outs = ["install/usr/bin/rust_test_scenarios"], +# srcs = ["//tests/test_scenarios/rust:test_scenarios"], +# outs = ["install/usr/bin/test_scenarios/rust"], # cmd = """ # mkdir -p $(RULEDIR)/install/usr/bin -# cp $(location //tests/rust_test_scenarios:rust_test_scenarios) $@ +# cp $(location //tests/test_scenarios/rust:test_scenarios) $@ # chmod +x $@ # """, #) diff --git a/tests/integration_test_scenarios/init_rpi4.build b/tests/integration_test_scenarios/init_rpi4.build index 2f96080e..9e705079 100644 --- a/tests/integration_test_scenarios/init_rpi4.build +++ b/tests/integration_test_scenarios/init_rpi4.build @@ -620,7 +620,7 @@ ldqnx-64.so.2=ldqnx-64.so.2 [uid=0 gid=0 perms=0755] /usr/bin/kvs_test.sh=bazel-out/k8-fastbuild/bin/tests/integration_test_scenarios/install/usr/bin/kvs_test.sh #TODO: enable when rust_test_scenarios is built for QNX -#[uid=0 gid=0 perms=0755] /usr/bin/rust_test_scenarios=bazel-out/k8-fastbuild/bin/tests/integration_test_scenarios/install/usr/bin/rust_test_scenarios +#[uid=0 gid=0 perms=0755] /usr/bin/test_scenarios/rust=bazel-out/k8-fastbuild/bin/tests/integration_test_scenarios/install/usr/bin/test_scenarios/rust diff --git a/tests/python_test_cases/pyproject.toml b/tests/python_test_cases/pyproject.toml deleted file mode 100644 index cfa7f711..00000000 --- a/tests/python_test_cases/pyproject.toml +++ /dev/null @@ -1,8 +0,0 @@ -[project] -name = "python_test_cases" -version = "0.1.0" -description = "Component integration tests for cpp/rust via pytest" -dependencies = [ - "pytest-env==1.1.5", - "testing-utils @ git+https://github.com/qorix-group/testing_tools.git@v0.2.4" -] diff --git a/tests/python_test_cases/BUILD b/tests/test_cases/BUILD similarity index 79% rename from tests/python_test_cases/BUILD rename to tests/test_cases/BUILD index b2950bc2..9ddcc8f9 100644 --- a/tests/python_test_cases/BUILD +++ b/tests/test_cases/BUILD @@ -15,10 +15,10 @@ load("@rules_python//python:pip.bzl", "compile_pip_requirements") load("@score_tooling//python_basics:defs.bzl", "score_py_pytest", "score_virtualenv") # In order to update the requirements, change the `requirements.in` file and run: -# `bazel run //tests/python_test_cases:requirements.update`. +# `bazel run //tests/test_cases:requirements.update`. # This will update the `requirements.txt` file. # To upgrade all dependencies to their latest versions, run: -# `bazel run //tests/python_test_cases:requirements.update -- --upgrade`. +# `bazel run //tests/test_cases:requirements.update -- --upgrade`. compile_pip_requirements( name = "requirements", srcs = [ @@ -43,16 +43,16 @@ score_py_pytest( srcs = glob(["tests/**/*.py"]), args = [ "-m cpp", - "--cpp-target-path=$(rootpath //tests/cpp_test_scenarios)", + "--cpp-target-path=$(rootpath //tests/test_scenarios/cpp:test_scenarios)", ], data = [ ":python_tc_venv", - "//tests/cpp_test_scenarios", + "//tests/test_scenarios/cpp:test_scenarios", ], env = { "RUST_BACKTRACE": "1", }, - pytest_ini = "//tests/python_test_cases:pytest.ini", + pytest_ini = "//tests/test_cases:pytest.ini", deps = all_requirements, ) @@ -61,16 +61,16 @@ score_py_pytest( srcs = glob(["tests/**/*.py"]), args = [ "-m rust", - "--rust-target-path=$(rootpath //tests/rust_test_scenarios)", + "--rust-target-path=$(rootpath //tests/test_scenarios/rust:test_scenarios)", ], data = [ ":python_tc_venv", - "//tests/rust_test_scenarios", + "//tests/test_scenarios/rust:test_scenarios", ], env = { "RUST_BACKTRACE": "1", }, - pytest_ini = "//tests/python_test_cases:pytest.ini", + pytest_ini = "//tests/test_cases:pytest.ini", deps = all_requirements, ) diff --git a/tests/python_test_cases/pytest.ini b/tests/test_cases/pytest.ini similarity index 97% rename from tests/python_test_cases/pytest.ini rename to tests/test_cases/pytest.ini index 46f32015..5ef44411 100644 --- a/tests/python_test_cases/pytest.ini +++ b/tests/test_cases/pytest.ini @@ -13,6 +13,7 @@ [pytest] addopts = -v testpaths = tests +pythonpath = tests markers = cpp rust diff --git a/tests/python_test_cases/requirements.txt b/tests/test_cases/requirements.txt similarity index 67% rename from tests/python_test_cases/requirements.txt rename to tests/test_cases/requirements.txt index 9451b0f8..b68a25ca 100644 --- a/tests/python_test_cases/requirements.txt +++ b/tests/test_cases/requirements.txt @@ -1,4 +1,4 @@ psutil pytest-metadata pytest-env -testing-utils @ git+https://github.com/eclipse-score/testing_tools.git@v0.3.0 +testing-utils @ git+https://github.com/eclipse-score/testing_tools.git@675395d4088c8eba708e21d9e5c4efbc75f6a6b0 diff --git a/tests/python_test_cases/requirements.txt.lock b/tests/test_cases/requirements.txt.lock similarity index 89% rename from tests/python_test_cases/requirements.txt.lock rename to tests/test_cases/requirements.txt.lock index a849c0d5..8d220713 100644 --- a/tests/python_test_cases/requirements.txt.lock +++ b/tests/test_cases/requirements.txt.lock @@ -2,17 +2,17 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# bazel run //component_integration_tests/python_test_cases:requirements.update +# bazel run //tests/test_cases:requirements.update # basedpyright==1.29.2 \ --hash=sha256:12c49186003b9f69a028615da883ef97035ea2119a9e3f93a00091b3a27088a6 \ --hash=sha256:f389e2997de33d038c5065fd85bff351fbdc62fa6d6371c7b947fc3bce8d437d - # via -r /home/pawel/.cache/bazel/_bazel_pawel/8e37fa08ddc84c04fc3d2fc587210beb/external/score_tooling~/python_basics/requirements.txt + # via -r /home/igor/.cache/bazel/_bazel_igor/a5a65d3bba19ab266bf2b3ef63ca3606/external/score_tooling+/python_basics/requirements.txt iniconfig==2.1.0 \ --hash=sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7 \ --hash=sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760 # via - # -r /home/pawel/.cache/bazel/_bazel_pawel/8e37fa08ddc84c04fc3d2fc587210beb/external/score_tooling~/python_basics/requirements.txt + # -r /home/igor/.cache/bazel/_bazel_igor/a5a65d3bba19ab266bf2b3ef63ca3606/external/score_tooling+/python_basics/requirements.txt # pytest jinja2==3.1.6 \ --hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \ @@ -92,19 +92,19 @@ nodejs-wheel-binaries==22.16.0 \ --hash=sha256:d695832f026df3a0cf9a089d222225939de9d1b67f8f0a353b79f015aabbe7e2 \ --hash=sha256:dbfccbcd558d2f142ccf66d8c3a098022bf4436db9525b5b8d32169ce185d99e # via - # -r /home/pawel/.cache/bazel/_bazel_pawel/8e37fa08ddc84c04fc3d2fc587210beb/external/score_tooling~/python_basics/requirements.txt + # -r /home/igor/.cache/bazel/_bazel_igor/a5a65d3bba19ab266bf2b3ef63ca3606/external/score_tooling+/python_basics/requirements.txt # basedpyright packaging==25.0 \ --hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \ --hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f # via - # -r /home/pawel/.cache/bazel/_bazel_pawel/8e37fa08ddc84c04fc3d2fc587210beb/external/score_tooling~/python_basics/requirements.txt + # -r /home/igor/.cache/bazel/_bazel_igor/a5a65d3bba19ab266bf2b3ef63ca3606/external/score_tooling+/python_basics/requirements.txt # pytest pluggy==1.6.0 \ --hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \ --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 # via - # -r /home/pawel/.cache/bazel/_bazel_pawel/8e37fa08ddc84c04fc3d2fc587210beb/external/score_tooling~/python_basics/requirements.txt + # -r /home/igor/.cache/bazel/_bazel_igor/a5a65d3bba19ab266bf2b3ef63ca3606/external/score_tooling+/python_basics/requirements.txt # pytest psutil==7.1.3 \ --hash=sha256:0005da714eee687b4b8decd3d6cc7c6db36215c9e74e5ad2264b90c3df7d92dc \ @@ -126,12 +126,12 @@ psutil==7.1.3 \ --hash=sha256:c525ffa774fe4496282fb0b1187725793de3e7c6b29e41562733cae9ada151ee \ --hash=sha256:f39c2c19fe824b47484b96f9692932248a54c43799a84282cfe58d05a6449efd \ --hash=sha256:fac9cd332c67f4422504297889da5ab7e05fd11e3c4392140f7370f4208ded1f - # via -r component_integration_tests/python_test_cases/requirements.txt + # via -r tests/test_cases/requirements.txt pytest==8.3.5 \ --hash=sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820 \ --hash=sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845 # via - # -r /home/pawel/.cache/bazel/_bazel_pawel/8e37fa08ddc84c04fc3d2fc587210beb/external/score_tooling~/python_basics/requirements.txt + # -r /home/igor/.cache/bazel/_bazel_igor/a5a65d3bba19ab266bf2b3ef63ca3606/external/score_tooling+/python_basics/requirements.txt # pytest-env # pytest-html # pytest-metadata @@ -140,7 +140,7 @@ pytest==8.3.5 \ pytest-env==1.1.5 \ --hash=sha256:91209840aa0e43385073ac464a554ad2947cc2fd663a9debf88d03b01e0cc1cf \ --hash=sha256:ce90cf8772878515c24b31cd97c7fa1f4481cd68d588419fd45f10ecaee6bc30 - # via -r component_integration_tests/python_test_cases/requirements.txt + # via -r tests/test_cases/requirements.txt pytest-html==4.1.1 \ --hash=sha256:70a01e8ae5800f4a074b56a4cb1025c8f4f9b038bba5fe31e3c98eb996686f07 \ --hash=sha256:c8152cea03bd4e9bee6d525573b67bbc6622967b72b9628dda0ea3e2a0b5dd71 @@ -149,7 +149,7 @@ pytest-metadata==3.1.1 \ --hash=sha256:c8e0844db684ee1c798cfa38908d20d67d0463ecb6137c72e91f418558dd5f4b \ --hash=sha256:d2a29b0355fbc03f168aa96d41ff88b1a3b44a3b02acbe491801c98a048017c8 # via - # -r component_integration_tests/python_test_cases/requirements.txt + # -r tests/test_cases/requirements.txt # pytest-html pytest-repeat==0.9.4 \ --hash=sha256:c1738b4e412a6f3b3b9e0b8b29fcd7a423e50f87381ad9307ef6f5a8601139f3 \ @@ -158,4 +158,4 @@ pytest-repeat==0.9.4 \ # WARNING: pip install will require the following package to be hashed. # Consider using a hashable URL like https://github.com/jazzband/pip-tools/archive/SOMECOMMIT.zip testing-utils @ git+https://github.com/eclipse-score/testing_tools.git@v0.3.0 - # via -r component_integration_tests/python_test_cases/requirements.txt + # via -r tests/test_cases/requirements.txt diff --git a/tests/python_test_cases/tests/__init__.py b/tests/test_cases/tests/__init__.py similarity index 100% rename from tests/python_test_cases/tests/__init__.py rename to tests/test_cases/tests/__init__.py diff --git a/tests/python_test_cases/tests/common.py b/tests/test_cases/tests/common.py similarity index 100% rename from tests/python_test_cases/tests/common.py rename to tests/test_cases/tests/common.py diff --git a/tests/python_test_cases/tests/conftest.py b/tests/test_cases/tests/conftest.py similarity index 96% rename from tests/python_test_cases/tests/conftest.py rename to tests/test_cases/tests/conftest.py index d5a64ce9..a7d5b27f 100644 --- a/tests/python_test_cases/tests/conftest.py +++ b/tests/test_cases/tests/conftest.py @@ -34,13 +34,13 @@ def pytest_addoption(parser): parser.addoption( "--cpp-target-name", type=str, - default="//tests/cpp_test_scenarios:cpp_test_scenarios", + default="//tests/test_scenarios/cpp:test_scenarios", help="C++ test scenario executable target.", ) parser.addoption( "--rust-target-name", type=str, - default="//tests/rust_test_scenarios:rust_test_scenarios", + default="//tests/test_scenarios/rust:test_scenarios", help="Rust test scenario executable target.", ) parser.addoption( @@ -90,7 +90,7 @@ def pytest_sessionstart(session): print("Building C++ test scenarios executable...") bazel_tools = BazelTools(option_prefix="cpp", build_timeout=build_timeout) cpp_target_name = session.config.getoption("--cpp-target-name") - bazel_tools.build(cpp_target_name) + bazel_tools.build(cpp_target_name, "--config=per-x86_64-linux") except Exception as e: pytest.exit(str(e), returncode=1) diff --git a/tests/python_test_cases/tests/test_basic.py b/tests/test_cases/tests/test_basic.py similarity index 96% rename from tests/python_test_cases/tests/test_basic.py rename to tests/test_cases/tests/test_basic.py index c7c68817..bc977321 100644 --- a/tests/python_test_cases/tests/test_basic.py +++ b/tests/test_cases/tests/test_basic.py @@ -17,10 +17,9 @@ from typing import Any import pytest +from common import CommonScenario, ResultCode from testing_utils import LogContainer, ScenarioResult -from .common import CommonScenario, ResultCode - @pytest.mark.parametrize("version", ["cpp", "rust"], scope="class") class TestBasic(CommonScenario): diff --git a/tests/python_test_cases/tests/test_cit_default_values.py b/tests/test_cases/tests/test_cit_default_values.py similarity index 99% rename from tests/python_test_cases/tests/test_cit_default_values.py rename to tests/test_cases/tests/test_cit_default_values.py index 9547181a..760c5763 100644 --- a/tests/python_test_cases/tests/test_cit_default_values.py +++ b/tests/test_cases/tests/test_cit_default_values.py @@ -17,12 +17,12 @@ from zlib import adler32 import pytest +from common import CommonScenario, ResultCode, temp_dir_common from testing_utils import LogContainer, ScenarioResult -from .common import CommonScenario, ResultCode, temp_dir_common - pytestmark = pytest.mark.parametrize("version", ["rust", "cpp"], scope="class") + # Type tag and value pair. TaggedValue = tuple[str, Any] diff --git a/tests/python_test_cases/tests/test_cit_multiple_kvs.py b/tests/test_cases/tests/test_cit_multiple_kvs.py similarity index 99% rename from tests/python_test_cases/tests/test_cit_multiple_kvs.py rename to tests/test_cases/tests/test_cit_multiple_kvs.py index d4e15d67..0b609a89 100644 --- a/tests/python_test_cases/tests/test_cit_multiple_kvs.py +++ b/tests/test_cases/tests/test_cit_multiple_kvs.py @@ -14,10 +14,9 @@ from typing import Any import pytest +from common import CommonScenario, ResultCode from testing_utils import LogContainer, ScenarioResult -from .common import CommonScenario, ResultCode - pytestmark = pytest.mark.parametrize("version", ["rust", "cpp"], scope="class") diff --git a/tests/python_test_cases/tests/test_cit_persistency.py b/tests/test_cases/tests/test_cit_persistency.py similarity index 97% rename from tests/python_test_cases/tests/test_cit_persistency.py rename to tests/test_cases/tests/test_cit_persistency.py index e608885c..00fb172c 100644 --- a/tests/python_test_cases/tests/test_cit_persistency.py +++ b/tests/test_cases/tests/test_cit_persistency.py @@ -14,10 +14,9 @@ from typing import Any import pytest +from common import CommonScenario, ResultCode from testing_utils import LogContainer, ScenarioResult -from .common import CommonScenario, ResultCode - pytestmark = pytest.mark.parametrize("version", ["rust"], scope="class") diff --git a/tests/python_test_cases/tests/test_cit_snapshots.py b/tests/test_cases/tests/test_cit_snapshots.py similarity index 99% rename from tests/python_test_cases/tests/test_cit_snapshots.py rename to tests/test_cases/tests/test_cit_snapshots.py index d8b5077d..e2845b7f 100644 --- a/tests/python_test_cases/tests/test_cit_snapshots.py +++ b/tests/test_cases/tests/test_cit_snapshots.py @@ -12,9 +12,10 @@ # ******************************************************************************* from pathlib import Path from typing import Any, Generator + import pytest -from .common import CommonScenario, ResultCode, temp_dir_common -from testing_utils import ScenarioResult, LogContainer +from common import CommonScenario, ResultCode, temp_dir_common +from testing_utils import LogContainer, ScenarioResult pytestmark = pytest.mark.parametrize("version", ["rust", "cpp"], scope="class") diff --git a/tests/python_test_cases/tests/test_cit_supported_datatypes.py b/tests/test_cases/tests/test_cit_supported_datatypes.py similarity index 99% rename from tests/python_test_cases/tests/test_cit_supported_datatypes.py rename to tests/test_cases/tests/test_cit_supported_datatypes.py index 50b3879c..1da81da1 100644 --- a/tests/python_test_cases/tests/test_cit_supported_datatypes.py +++ b/tests/test_cases/tests/test_cit_supported_datatypes.py @@ -15,10 +15,9 @@ from typing import Any import pytest +from common import CommonScenario, ResultCode from testing_utils import LogContainer, ScenarioResult -from .common import CommonScenario, ResultCode - pytestmark = pytest.mark.parametrize("version", ["cpp", "rust"], scope="class") diff --git a/tests/cpp_test_scenarios/BUILD b/tests/test_scenarios/cpp/BUILD similarity index 96% rename from tests/cpp_test_scenarios/BUILD rename to tests/test_scenarios/cpp/BUILD index 368e7071..586514b9 100644 --- a/tests/cpp_test_scenarios/BUILD +++ b/tests/test_scenarios/cpp/BUILD @@ -13,7 +13,7 @@ load("@rules_cc//cc:cc_binary.bzl", "cc_binary") cc_binary( - name = "cpp_test_scenarios", + name = "test_scenarios", srcs = glob([ "src/**/*.cpp", "src/**/*.hpp", diff --git a/tests/cpp_test_scenarios/src/cit/cit.cpp b/tests/test_scenarios/cpp/src/cit/cit.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/cit.cpp rename to tests/test_scenarios/cpp/src/cit/cit.cpp diff --git a/tests/cpp_test_scenarios/src/cit/cit.hpp b/tests/test_scenarios/cpp/src/cit/cit.hpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/cit.hpp rename to tests/test_scenarios/cpp/src/cit/cit.hpp diff --git a/tests/cpp_test_scenarios/src/cit/default_values.cpp b/tests/test_scenarios/cpp/src/cit/default_values.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/default_values.cpp rename to tests/test_scenarios/cpp/src/cit/default_values.cpp diff --git a/tests/cpp_test_scenarios/src/cit/default_values.hpp b/tests/test_scenarios/cpp/src/cit/default_values.hpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/default_values.hpp rename to tests/test_scenarios/cpp/src/cit/default_values.hpp diff --git a/tests/cpp_test_scenarios/src/cit/multiple_kvs.cpp b/tests/test_scenarios/cpp/src/cit/multiple_kvs.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/multiple_kvs.cpp rename to tests/test_scenarios/cpp/src/cit/multiple_kvs.cpp diff --git a/tests/cpp_test_scenarios/src/cit/multiple_kvs.hpp b/tests/test_scenarios/cpp/src/cit/multiple_kvs.hpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/multiple_kvs.hpp rename to tests/test_scenarios/cpp/src/cit/multiple_kvs.hpp diff --git a/tests/cpp_test_scenarios/src/cit/snapshots.cpp b/tests/test_scenarios/cpp/src/cit/snapshots.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/snapshots.cpp rename to tests/test_scenarios/cpp/src/cit/snapshots.cpp diff --git a/tests/cpp_test_scenarios/src/cit/snapshots.hpp b/tests/test_scenarios/cpp/src/cit/snapshots.hpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/snapshots.hpp rename to tests/test_scenarios/cpp/src/cit/snapshots.hpp diff --git a/tests/cpp_test_scenarios/src/cit/supported_datatypes.cpp b/tests/test_scenarios/cpp/src/cit/supported_datatypes.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/supported_datatypes.cpp rename to tests/test_scenarios/cpp/src/cit/supported_datatypes.cpp diff --git a/tests/cpp_test_scenarios/src/cit/supported_datatypes.hpp b/tests/test_scenarios/cpp/src/cit/supported_datatypes.hpp similarity index 100% rename from tests/cpp_test_scenarios/src/cit/supported_datatypes.hpp rename to tests/test_scenarios/cpp/src/cit/supported_datatypes.hpp diff --git a/tests/cpp_test_scenarios/src/helpers/helpers.cpp b/tests/test_scenarios/cpp/src/helpers/helpers.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/helpers/helpers.cpp rename to tests/test_scenarios/cpp/src/helpers/helpers.cpp diff --git a/tests/cpp_test_scenarios/src/helpers/helpers.hpp b/tests/test_scenarios/cpp/src/helpers/helpers.hpp similarity index 100% rename from tests/cpp_test_scenarios/src/helpers/helpers.hpp rename to tests/test_scenarios/cpp/src/helpers/helpers.hpp diff --git a/tests/cpp_test_scenarios/src/helpers/kvs_instance.cpp b/tests/test_scenarios/cpp/src/helpers/kvs_instance.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/helpers/kvs_instance.cpp rename to tests/test_scenarios/cpp/src/helpers/kvs_instance.cpp diff --git a/tests/cpp_test_scenarios/src/helpers/kvs_instance.hpp b/tests/test_scenarios/cpp/src/helpers/kvs_instance.hpp similarity index 100% rename from tests/cpp_test_scenarios/src/helpers/kvs_instance.hpp rename to tests/test_scenarios/cpp/src/helpers/kvs_instance.hpp diff --git a/tests/cpp_test_scenarios/src/helpers/kvs_parameters.cpp b/tests/test_scenarios/cpp/src/helpers/kvs_parameters.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/helpers/kvs_parameters.cpp rename to tests/test_scenarios/cpp/src/helpers/kvs_parameters.cpp diff --git a/tests/cpp_test_scenarios/src/helpers/kvs_parameters.hpp b/tests/test_scenarios/cpp/src/helpers/kvs_parameters.hpp similarity index 100% rename from tests/cpp_test_scenarios/src/helpers/kvs_parameters.hpp rename to tests/test_scenarios/cpp/src/helpers/kvs_parameters.hpp diff --git a/tests/cpp_test_scenarios/src/main.cpp b/tests/test_scenarios/cpp/src/main.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/main.cpp rename to tests/test_scenarios/cpp/src/main.cpp diff --git a/tests/cpp_test_scenarios/src/test_basic.cpp b/tests/test_scenarios/cpp/src/test_basic.cpp similarity index 100% rename from tests/cpp_test_scenarios/src/test_basic.cpp rename to tests/test_scenarios/cpp/src/test_basic.cpp diff --git a/tests/cpp_test_scenarios/src/test_basic.hpp b/tests/test_scenarios/cpp/src/test_basic.hpp similarity index 100% rename from tests/cpp_test_scenarios/src/test_basic.hpp rename to tests/test_scenarios/cpp/src/test_basic.hpp diff --git a/tests/rust_test_scenarios/BUILD b/tests/test_scenarios/rust/BUILD similarity index 91% rename from tests/rust_test_scenarios/BUILD rename to tests/test_scenarios/rust/BUILD index 6f98b1b5..88e5a3ac 100644 --- a/tests/rust_test_scenarios/BUILD +++ b/tests/test_scenarios/rust/BUILD @@ -13,9 +13,9 @@ load("@rules_rust//rust:defs.bzl", "rust_binary") rust_binary( - name = "rust_test_scenarios", + name = "test_scenarios", srcs = glob(["src/**/*.rs"]), - visibility = ["//tests/python_test_cases:__pkg__"], + visibility = ["//tests/test_cases:__pkg__"], deps = [ "//src/rust/rust_kvs", diff --git a/tests/rust_test_scenarios/Cargo.toml b/tests/test_scenarios/rust/Cargo.toml similarity index 93% rename from tests/rust_test_scenarios/Cargo.toml rename to tests/test_scenarios/rust/Cargo.toml index ad4b2fc0..0258b7bf 100644 --- a/tests/rust_test_scenarios/Cargo.toml +++ b/tests/test_scenarios/rust/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rust_test_scenarios" +name = "test_scenarios" version.workspace = true edition.workspace = true diff --git a/tests/rust_test_scenarios/src/cit/default_values.rs b/tests/test_scenarios/rust/src/cit/default_values.rs similarity index 100% rename from tests/rust_test_scenarios/src/cit/default_values.rs rename to tests/test_scenarios/rust/src/cit/default_values.rs diff --git a/tests/rust_test_scenarios/src/cit/mod.rs b/tests/test_scenarios/rust/src/cit/mod.rs similarity index 100% rename from tests/rust_test_scenarios/src/cit/mod.rs rename to tests/test_scenarios/rust/src/cit/mod.rs diff --git a/tests/rust_test_scenarios/src/cit/multiple_kvs.rs b/tests/test_scenarios/rust/src/cit/multiple_kvs.rs similarity index 100% rename from tests/rust_test_scenarios/src/cit/multiple_kvs.rs rename to tests/test_scenarios/rust/src/cit/multiple_kvs.rs diff --git a/tests/rust_test_scenarios/src/cit/persistency.rs b/tests/test_scenarios/rust/src/cit/persistency.rs similarity index 100% rename from tests/rust_test_scenarios/src/cit/persistency.rs rename to tests/test_scenarios/rust/src/cit/persistency.rs diff --git a/tests/rust_test_scenarios/src/cit/snapshots.rs b/tests/test_scenarios/rust/src/cit/snapshots.rs similarity index 100% rename from tests/rust_test_scenarios/src/cit/snapshots.rs rename to tests/test_scenarios/rust/src/cit/snapshots.rs diff --git a/tests/rust_test_scenarios/src/cit/supported_datatypes.rs b/tests/test_scenarios/rust/src/cit/supported_datatypes.rs similarity index 100% rename from tests/rust_test_scenarios/src/cit/supported_datatypes.rs rename to tests/test_scenarios/rust/src/cit/supported_datatypes.rs diff --git a/tests/rust_test_scenarios/src/helpers/kvs_instance.rs b/tests/test_scenarios/rust/src/helpers/kvs_instance.rs similarity index 100% rename from tests/rust_test_scenarios/src/helpers/kvs_instance.rs rename to tests/test_scenarios/rust/src/helpers/kvs_instance.rs diff --git a/tests/rust_test_scenarios/src/helpers/kvs_parameters.rs b/tests/test_scenarios/rust/src/helpers/kvs_parameters.rs similarity index 100% rename from tests/rust_test_scenarios/src/helpers/kvs_parameters.rs rename to tests/test_scenarios/rust/src/helpers/kvs_parameters.rs diff --git a/tests/rust_test_scenarios/src/helpers/mod.rs b/tests/test_scenarios/rust/src/helpers/mod.rs similarity index 100% rename from tests/rust_test_scenarios/src/helpers/mod.rs rename to tests/test_scenarios/rust/src/helpers/mod.rs diff --git a/tests/rust_test_scenarios/src/main.rs b/tests/test_scenarios/rust/src/main.rs similarity index 100% rename from tests/rust_test_scenarios/src/main.rs rename to tests/test_scenarios/rust/src/main.rs diff --git a/tests/rust_test_scenarios/src/test_basic.rs b/tests/test_scenarios/rust/src/test_basic.rs similarity index 100% rename from tests/rust_test_scenarios/src/test_basic.rs rename to tests/test_scenarios/rust/src/test_basic.rs