From e869bc59578a3f0699cc6ba7a8b665e052ef09b1 Mon Sep 17 00:00:00 2001 From: Piotr Korkus Date: Thu, 8 Jan 2026 15:00:37 +0100 Subject: [PATCH] fit: refactor - simplify directories structure - cleanup unused hooks - clean configs --- .../workflows/build_and_test_on_every_pr.yml | 2 +- MODULE.bazel | 2 +- feature_integration_tests/README.md | 19 ++++++++++--------- .../python_test_cases/pytest.ini | 9 --------- .../{python_test_cases => test_cases}/BUILD | 4 ++-- .../conftest.py | 17 ----------------- .../fit_scenario.py | 0 .../test_cases/pytest.ini | 3 +++ .../requirements.txt | 0 .../requirements.txt.lock | 0 .../test_properties.py | 0 .../test_orchestration_with_persistency.py} | 0 .../persistency/test_multiple_kvs_per_app.py | 0 .../rust}/BUILD | 4 ++-- .../rust}/src/internals/kyron/mod.rs | 0 .../src/internals/kyron/runtime_helper.rs | 0 .../rust}/src/internals/mod.rs | 0 .../src/internals/persistency/kvs_instance.rs | 0 .../internals/persistency/kvs_parameters.rs | 0 .../rust}/src/internals/persistency/mod.rs | 0 .../rust}/src/main.rs | 0 .../rust}/src/scenarios/basic/mod.rs | 0 .../basic/orchestration_with_persistency.rs | 0 .../rust}/src/scenarios/mod.rs | 0 .../rust}/src/scenarios/persistency/mod.rs | 0 .../persistency/multiple_kvs_per_app.rs | 0 .../rust/orchestration_persistency/main.rs | 3 +-- 27 files changed, 20 insertions(+), 43 deletions(-) delete mode 100644 feature_integration_tests/python_test_cases/pytest.ini rename feature_integration_tests/{python_test_cases => test_cases}/BUILD (91%) rename feature_integration_tests/{python_test_cases => test_cases}/conftest.py (79%) rename feature_integration_tests/{python_test_cases => test_cases}/fit_scenario.py (100%) create mode 100644 feature_integration_tests/test_cases/pytest.ini rename feature_integration_tests/{python_test_cases => test_cases}/requirements.txt (100%) rename feature_integration_tests/{python_test_cases => test_cases}/requirements.txt.lock (100%) rename feature_integration_tests/{python_test_cases => test_cases}/test_properties.py (100%) rename feature_integration_tests/{python_test_cases/tests/basic/test_orchestartion_with_persistency.py => test_cases/tests/basic/test_orchestration_with_persistency.py} (100%) rename feature_integration_tests/{python_test_cases => test_cases}/tests/persistency/test_multiple_kvs_per_app.py (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/BUILD (94%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/internals/kyron/mod.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/internals/kyron/runtime_helper.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/internals/mod.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/internals/persistency/kvs_instance.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/internals/persistency/kvs_parameters.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/internals/persistency/mod.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/main.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/scenarios/basic/mod.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/scenarios/basic/orchestration_with_persistency.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/scenarios/mod.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/scenarios/persistency/mod.rs (100%) rename feature_integration_tests/{rust_test_scenarios => test_scenarios/rust}/src/scenarios/persistency/multiple_kvs_per_app.rs (100%) diff --git a/.github/workflows/build_and_test_on_every_pr.yml b/.github/workflows/build_and_test_on_every_pr.yml index 05e861166e..b0fafafe6e 100644 --- a/.github/workflows/build_and_test_on_every_pr.yml +++ b/.github/workflows/build_and_test_on_every_pr.yml @@ -53,4 +53,4 @@ jobs: done < ci/showcase_targets_run.txt - name: Feature Integration Tests run: | - bazel test --config bl-x86_64-linux //feature_integration_tests/python_test_cases:fit + bazel test --config bl-x86_64-linux //feature_integration_tests/test_cases:fit diff --git a/MODULE.bazel b/MODULE.bazel index 3db57550c8..2a6fdba698 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -37,7 +37,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 = "//feature_integration_tests/python_test_cases:requirements.txt.lock", + requirements_lock = "//feature_integration_tests/test_cases:requirements.txt.lock", ) use_repo(pip, "pip_score_venv_test") diff --git a/feature_integration_tests/README.md b/feature_integration_tests/README.md index 902e6d11fb..2cb213a426 100644 --- a/feature_integration_tests/README.md +++ b/feature_integration_tests/README.md @@ -4,15 +4,16 @@ This directory contains Feature Integration Tests for the S-CORE project. It inc ## Structure -- `python_test_cases/` — Python-based integration test cases +- `test_cases/` — Python-based integration test cases - `conftest.py` — Pytest configuration and fixtures - `fit_scenario.py` — Base scenario class - `requirements.txt` — Python dependencies - `BUILD` — Bazel build and test definitions - `tests/` — Test cases (e.g., orchestration with persistency) -- `rust_test_scenarios/` — Rust-based integration test scenarios - - `src/` — Rust source code for test scenarios - - `BUILD` — Bazel build definitions +- `test_scenarios/` — Location of test scenarios + - `rust/` — Rust-based integration test scenarios + - `src/` — Rust source code for test scenarios + - `BUILD` — Bazel build definitions ## Running Tests @@ -21,19 +22,19 @@ This directory contains Feature Integration Tests for the S-CORE project. It inc Python tests are managed with Bazel and Pytest. To run the main test target: ```sh -bazel test //feature_integration_tests/python_test_cases:fit +bazel test //feature_integration_tests/test_cases:fit ``` ### Rust Test Scenarios -Rust test scenarios are defined in `rust_test_scenarios/src/scenarios`. Build and run them using Bazel: +Rust test scenarios are defined in `test_scenarios/rust/src/scenarios`. Build and run them using Bazel: ```sh -bazel build //feature_integration_tests/rust_test_scenarios +bazel build //feature_integration_tests/test_scenarios/rust:rust_test_scenarios ``` ```sh -bazel run //feature_integration_tests/rust_test_scenarios -- --list-scenarios +bazel run //feature_integration_tests/test_scenarios/rust:rust_test_scenarios -- --list-scenarios ``` ## Updating Python Requirements @@ -41,5 +42,5 @@ bazel run //feature_integration_tests/rust_test_scenarios -- --list-scenarios To update Python dependencies: ```sh -bazel run //feature_integration_tests/python_test_cases:requirements.update +bazel run //feature_integration_tests/test_cases:requirements.update ``` diff --git a/feature_integration_tests/python_test_cases/pytest.ini b/feature_integration_tests/python_test_cases/pytest.ini deleted file mode 100644 index 79d506db70..0000000000 --- a/feature_integration_tests/python_test_cases/pytest.ini +++ /dev/null @@ -1,9 +0,0 @@ -[pytest] -addopts = -v -testpaths = tests -markers = - PartiallyVerifies - FullyVerifies - Description - TestType - DerivationTechnique diff --git a/feature_integration_tests/python_test_cases/BUILD b/feature_integration_tests/test_cases/BUILD similarity index 91% rename from feature_integration_tests/python_test_cases/BUILD rename to feature_integration_tests/test_cases/BUILD index 8f9d2d3197..527187c4a8 100644 --- a/feature_integration_tests/python_test_cases/BUILD +++ b/feature_integration_tests/test_cases/BUILD @@ -31,11 +31,11 @@ score_py_pytest( srcs = glob(["tests/**/*.py"]) + ["conftest.py", "fit_scenario.py", "test_properties.py"], args = [ "--traces=all", - "--rust-target-path=$(rootpath //feature_integration_tests/rust_test_scenarios)", + "--rust-target-path=$(rootpath //feature_integration_tests/test_scenarios/rust:rust_test_scenarios)", ], data = [ ":python_tc_venv", - "//feature_integration_tests/rust_test_scenarios", + "//feature_integration_tests/test_scenarios/rust:rust_test_scenarios", ], env = { "RUST_BACKTRACE": "1", diff --git a/feature_integration_tests/python_test_cases/conftest.py b/feature_integration_tests/test_cases/conftest.py similarity index 79% rename from feature_integration_tests/python_test_cases/conftest.py rename to feature_integration_tests/test_cases/conftest.py index b07758d82f..001b14a2b3 100644 --- a/feature_integration_tests/python_test_cases/conftest.py +++ b/feature_integration_tests/test_cases/conftest.py @@ -64,20 +64,3 @@ def pytest_sessionstart(session): except Exception as e: pytest.exit(str(e), returncode=1) - - -def pytest_collection_modifyitems(items: list[pytest.Function]): - markers_to_process = ( - "PartiallyVerifies", - "FullyVerifies", - "Description", - "TestType", - "DerivationTechnique", - ) - for item in items: - # Add custom markers info to XML report - for marker in item.iter_markers(): - if marker.name not in markers_to_process: - continue - - item.user_properties.append((marker.name, marker.args[0])) diff --git a/feature_integration_tests/python_test_cases/fit_scenario.py b/feature_integration_tests/test_cases/fit_scenario.py similarity index 100% rename from feature_integration_tests/python_test_cases/fit_scenario.py rename to feature_integration_tests/test_cases/fit_scenario.py diff --git a/feature_integration_tests/test_cases/pytest.ini b/feature_integration_tests/test_cases/pytest.ini new file mode 100644 index 0000000000..d4b25fd2f8 --- /dev/null +++ b/feature_integration_tests/test_cases/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +addopts = -v +testpaths = tests diff --git a/feature_integration_tests/python_test_cases/requirements.txt b/feature_integration_tests/test_cases/requirements.txt similarity index 100% rename from feature_integration_tests/python_test_cases/requirements.txt rename to feature_integration_tests/test_cases/requirements.txt diff --git a/feature_integration_tests/python_test_cases/requirements.txt.lock b/feature_integration_tests/test_cases/requirements.txt.lock similarity index 100% rename from feature_integration_tests/python_test_cases/requirements.txt.lock rename to feature_integration_tests/test_cases/requirements.txt.lock diff --git a/feature_integration_tests/python_test_cases/test_properties.py b/feature_integration_tests/test_cases/test_properties.py similarity index 100% rename from feature_integration_tests/python_test_cases/test_properties.py rename to feature_integration_tests/test_cases/test_properties.py diff --git a/feature_integration_tests/python_test_cases/tests/basic/test_orchestartion_with_persistency.py b/feature_integration_tests/test_cases/tests/basic/test_orchestration_with_persistency.py similarity index 100% rename from feature_integration_tests/python_test_cases/tests/basic/test_orchestartion_with_persistency.py rename to feature_integration_tests/test_cases/tests/basic/test_orchestration_with_persistency.py diff --git a/feature_integration_tests/python_test_cases/tests/persistency/test_multiple_kvs_per_app.py b/feature_integration_tests/test_cases/tests/persistency/test_multiple_kvs_per_app.py similarity index 100% rename from feature_integration_tests/python_test_cases/tests/persistency/test_multiple_kvs_per_app.py rename to feature_integration_tests/test_cases/tests/persistency/test_multiple_kvs_per_app.py diff --git a/feature_integration_tests/rust_test_scenarios/BUILD b/feature_integration_tests/test_scenarios/rust/BUILD similarity index 94% rename from feature_integration_tests/rust_test_scenarios/BUILD rename to feature_integration_tests/test_scenarios/rust/BUILD index 41f582aed7..29e476e5db 100644 --- a/feature_integration_tests/rust_test_scenarios/BUILD +++ b/feature_integration_tests/test_scenarios/rust/BUILD @@ -16,7 +16,7 @@ load("@rules_rust//rust:defs.bzl", "rust_binary") rust_binary( name = "rust_test_scenarios", srcs = glob(["src/**/*.rs"]), - visibility = ["//feature_integration_tests/python_test_cases:__pkg__"], + visibility = ["//feature_integration_tests/test_cases:__pkg__"], tags = [ "manual", ], @@ -31,4 +31,4 @@ rust_binary( "@score_crates//:serde", "@score_crates//:serde_json", ], -) \ No newline at end of file +) diff --git a/feature_integration_tests/rust_test_scenarios/src/internals/kyron/mod.rs b/feature_integration_tests/test_scenarios/rust/src/internals/kyron/mod.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/internals/kyron/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/kyron/mod.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/internals/kyron/runtime_helper.rs b/feature_integration_tests/test_scenarios/rust/src/internals/kyron/runtime_helper.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/internals/kyron/runtime_helper.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/kyron/runtime_helper.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/internals/mod.rs b/feature_integration_tests/test_scenarios/rust/src/internals/mod.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/internals/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/mod.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/internals/persistency/kvs_instance.rs b/feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_instance.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/internals/persistency/kvs_instance.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_instance.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/internals/persistency/kvs_parameters.rs b/feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_parameters.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/internals/persistency/kvs_parameters.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_parameters.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/internals/persistency/mod.rs b/feature_integration_tests/test_scenarios/rust/src/internals/persistency/mod.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/internals/persistency/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/persistency/mod.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/main.rs b/feature_integration_tests/test_scenarios/rust/src/main.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/main.rs rename to feature_integration_tests/test_scenarios/rust/src/main.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/scenarios/basic/mod.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/basic/mod.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/scenarios/basic/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/basic/mod.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/scenarios/basic/orchestration_with_persistency.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/basic/orchestration_with_persistency.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/scenarios/basic/orchestration_with_persistency.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/basic/orchestration_with_persistency.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/scenarios/mod.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/mod.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/scenarios/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/mod.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/scenarios/persistency/mod.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/mod.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/scenarios/persistency/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/mod.rs diff --git a/feature_integration_tests/rust_test_scenarios/src/scenarios/persistency/multiple_kvs_per_app.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/multiple_kvs_per_app.rs similarity index 100% rename from feature_integration_tests/rust_test_scenarios/src/scenarios/persistency/multiple_kvs_per_app.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/multiple_kvs_per_app.rs diff --git a/feature_showcase/rust/orchestration_persistency/main.rs b/feature_showcase/rust/orchestration_persistency/main.rs index 55a98fb23c..d77dee6d6e 100644 --- a/feature_showcase/rust/orchestration_persistency/main.rs +++ b/feature_showcase/rust/orchestration_persistency/main.rs @@ -138,11 +138,10 @@ fn detect_object_component_design() -> Result { fn main() { // Setup any logging framework you want to use. - let logger = LogAndTraceBuilder::new() + let _logger = LogAndTraceBuilder::new() .global_log_level(logging_tracing::Level::INFO) .enable_logging(true) .build(); - // logger.init_log_trace(); // Create runtime let (builder, _engine_id) = kyron::runtime::RuntimeBuilder::new().with_engine(