From 0c7652d447ced5a176ab2bb07a6783cd5eebad49 Mon Sep 17 00:00:00 2001 From: Piotr Korkus Date: Fri, 24 Oct 2025 22:10:37 +0200 Subject: [PATCH 1/4] fix: rename bazel module Align with naming in SCORE --- MODULE.bazel | 6 +++--- pyproject.toml | 2 +- test_scenarios_rust/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index c988df7..c169690 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -11,12 +11,12 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* """ -'testing-utils' module. +'score_test_scenarios' module. """ module( - name = "testing-utils", - version = "0.2.9", + name = "score_test_scenarios", + version = "0.3.0", ) # Starlark language server diff --git a/pyproject.toml b/pyproject.toml index 5742a97..4298daa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "testing-utils" -version = "0.2.9" +version = "0.3.0" dependencies = ["pytest==8.4.1", "pytest-html==4.1.1", "pytest-repeat==0.9.4"] requires-python = ">=3.12" authors = [ diff --git a/test_scenarios_rust/Cargo.toml b/test_scenarios_rust/Cargo.toml index 8ef8cad..366e2ca 100644 --- a/test_scenarios_rust/Cargo.toml +++ b/test_scenarios_rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_scenarios_rust" -version = "0.2.9" +version = "0.3.0" edition = "2021" [dependencies] From 2f3e6a509f00ef410708ca06e3126a08732becb7 Mon Sep 17 00:00:00 2001 From: Piotr Korkus Date: Mon, 3 Nov 2025 11:13:33 +0100 Subject: [PATCH 2/4] infra: add cicd building scenarios formatting and internal testing --- .github/workflows/build_scenarios.yml | 37 +++++++++++++++ .github/workflows/fomat_and_test.yml | 68 +++++++++++++++++++++++++++ test_scenarios_rust/Cargo.lock | 2 +- 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_scenarios.yml create mode 100644 .github/workflows/fomat_and_test.yml diff --git a/.github/workflows/build_scenarios.yml b/.github/workflows/build_scenarios.yml new file mode 100644 index 0000000..e83e6da --- /dev/null +++ b/.github/workflows/build_scenarios.yml @@ -0,0 +1,37 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +name: Build and test scenarios + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + scenarios-build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.15.0 + with: + bazelisk-version: 1.26.0 # newest LTS before 1 Jun 2025 + + - name: Run build + run: | + bazel build //... + + - name: Run tests + run: | + bazel test //... diff --git a/.github/workflows/fomat_and_test.yml b/.github/workflows/fomat_and_test.yml new file mode 100644 index 0000000..f95788b --- /dev/null +++ b/.github/workflows/fomat_and_test.yml @@ -0,0 +1,68 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +name: Format and Internal Tests of Utils + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e ".[dev]" || true + + - name: Check formatting with Ruff + run: ruff check . + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.15.0 + with: + bazelisk-version: 1.26.0 # newest LTS before 1 Jun 2025 + + - name: Install Rust (Cargo) + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: cargo + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e ".[dev]" || true + + - name: Run tests with pytest + run: pytest tests -v diff --git a/test_scenarios_rust/Cargo.lock b/test_scenarios_rust/Cargo.lock index 0b71c46..397e1ee 100644 --- a/test_scenarios_rust/Cargo.lock +++ b/test_scenarios_rust/Cargo.lock @@ -144,7 +144,7 @@ dependencies = [ [[package]] name = "test_scenarios_rust" -version = "0.2.9" +version = "0.3.0" dependencies = [ "tracing", "tracing-subscriber", From 9eb4abca5ba9786226b7285cbfe2a6a5ccd6419c Mon Sep 17 00:00:00 2001 From: Piotr Korkus Date: Mon, 3 Nov 2025 13:27:54 +0100 Subject: [PATCH 3/4] update MODULE dependencies --- .bazelrc | 2 +- MODULE.bazel | 14 ++------------ test_scenarios_cpp/BUILD | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.bazelrc b/.bazelrc index 5f20d3e..fd762dc 100644 --- a/.bazelrc +++ b/.bazelrc @@ -2,7 +2,7 @@ build --java_language_version=17 build --tool_java_language_version=17 build --java_runtime_version=remotejdk_17 build --tool_java_runtime_version=remotejdk_17 -build --@score-baselibs//score/json:base_library=nlohmann +build --@score_baselibs//score/json:base_library=nlohmann test --test_output=errors diff --git a/MODULE.bazel b/MODULE.bazel index c169690..1a2e3c8 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -17,6 +17,7 @@ module( name = "score_test_scenarios", version = "0.3.0", + compatibility_level = 0, ) # Starlark language server @@ -61,15 +62,4 @@ crate.from_cargo( use_repo(crate, "test_scenarios_rust_crates") # C++ base libs. -archive_override( - module_name = "rules_boost", - strip_prefix = "rules_boost-master", - urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"], -) - -bazel_dep(name = "score-baselibs", version = "0.0.0") -git_override( - module_name = "score-baselibs", - commit = "f0a394a602986ddf7abac6a238b9d44535a4b597", - remote = "https://github.com/eclipse-score/baselibs.git", -) +bazel_dep(name = "score_baselibs", version = "0.1.2") diff --git a/test_scenarios_cpp/BUILD b/test_scenarios_cpp/BUILD index 73d7105..5dce066 100644 --- a/test_scenarios_cpp/BUILD +++ b/test_scenarios_cpp/BUILD @@ -35,7 +35,7 @@ cc_library( ], includes = ["include/"], visibility = ["//visibility:public"], - deps = ["@score-baselibs//score/json:json_parser"], + deps = ["@score_baselibs//score/json:json_parser"], ) cc_test( From ce7d443f067c1e270b2384392daf4e8f8024ffca Mon Sep 17 00:00:00 2001 From: Piotr Korkus Date: Tue, 4 Nov 2025 12:43:20 +0100 Subject: [PATCH 4/4] downgrade pytest dep to match SCORE --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4298daa..9d4faf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "testing-utils" version = "0.3.0" -dependencies = ["pytest==8.4.1", "pytest-html==4.1.1", "pytest-repeat==0.9.4"] +dependencies = ["pytest>=8.3.5", "pytest-html>=4.1.1", "pytest-repeat>=0.9.4"] requires-python = ">=3.12" authors = [ { name = "Igor Ostrowski", email = "igor.ostrowski.ext@qorix.ai" },