Skip to content

Commit 775fac9

Browse files
committed
Merge remote-tracking branch 'origin/main' into migrate-module-docs
2 parents 0c11b79 + eeadb7b commit 775fac9

File tree

9 files changed

+303
-85
lines changed

9 files changed

+303
-85
lines changed

.bazelrc

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
# -------------------------------------------------------------------------------
15+
# Links to S-CORE Bazel registry and Bazel Central Regoe
16+
# -------------------------------------------------------------------------------
17+
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
18+
common --registry=https://bcr.bazel.build
19+
20+
# -------------------------------------------------------------------------------
21+
# Default build flags (all configurations)
22+
# -------------------------------------------------------------------------------
123
build --java_language_version=17
224
build --tool_java_language_version=17
325
build --java_runtime_version=remotejdk_17
@@ -10,14 +32,44 @@ build --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
1032
build --@score-baselibs//score/json:base_library=nlohmann
1133
build --@score-baselibs//score/mw/log/flags:KRemote_Logging=False
1234

13-
test --test_output=errors
14-
15-
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
16-
common --registry=https://bcr.bazel.build
17-
1835
# Clippy linting (enabled by default)
1936
build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
2037
build --output_groups=+clippy_checks
2138
build --@rules_rust//rust/settings:clippy.toml=@score_rust_policies//clippy/strict:clippy.toml
2239

40+
test --test_output=errors
41+
42+
# -------------------------------------------------------------------------------
43+
# Shared configuration for simple test execution
44+
# -------------------------------------------------------------------------------
45+
build:per_shared --incompatible_strict_action_env
46+
build:per_shared --sandbox_writable_path=/var/tmp
47+
build:per_shared --host_platform=@score_bazel_platforms//:x86_64-linux
48+
49+
# -------------------------------------------------------------------------------
50+
# Config dedicated to host platform CPU:x86_64 and OS:Linux
51+
# -------------------------------------------------------------------------------
52+
build:per-x86_64-linux --config=per_shared
53+
build:per-x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux
54+
build:per-x86_64-linux --extra_toolchains=@gcc_toolchain//:host_gcc_12
55+
56+
# -------------------------------------------------------------------------------
57+
# Config dedicated to target platform CPU:x86_64 and OS:QNX
58+
# -------------------------------------------------------------------------------
59+
build:per-x86_64-qnx --config=per_shared
60+
build:per-x86_64-qnx --platforms=@score_toolchains_qnx//platforms:x86_64-qnx
61+
build:per-x86_64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64
62+
build:per-x86_64-qnx --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64
63+
64+
# -------------------------------------------------------------------------------
65+
# Config dedicated to target platform CPU:arm64 and OS:QNX
66+
# -------------------------------------------------------------------------------
67+
build:per-arm64-qnx --config=per_shared
68+
build:per-arm64-qnx --platforms=@score_toolchains_qnx//platforms:aarch64-qnx8_0
69+
build:per-arm64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_aarch64
70+
build:per-arm64-qnx --extra_toolchains=@toolchains_qnx_ifs//:ifs_aarch64
71+
72+
# -------------------------------------------------------------------------------
73+
# Import local user workspace file, if exists
74+
# -------------------------------------------------------------------------------
2375
try-import %workspace%/user.bazelrc

.github/workflows/check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ jobs:
146146
bazelisk-cache: true
147147

148148
- name: Bazel Build
149-
run: bazel build //:kvs_cpp
149+
run: bazel build --config=per-x86_64-linux //:kvs_cpp
150150

151151
- name: Bazel Unit Test with Coverage
152152
run: |
153-
bazel coverage //:test_kvs_cpp \
153+
bazel coverage --config=per-x86_64-linux //:test_kvs_cpp \
154154
--collect_code_coverage \
155155
--combined_report=lcov \
156156
--experimental_generate_llvm_lcov \
@@ -184,4 +184,4 @@ jobs:
184184
rm ${OUT_FILE}
185185
186186
- name: Bazel Benchmark
187-
run: bazel run -c opt //:bm_kvs_cpp
187+
run: bazel run --config=per-x86_64-linux -c opt //:bm_kvs_cpp

.github/workflows/component_integration_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
- name: Build C++ test scenarios with Bazel
4848
run: |
49-
bazel build //tests/cpp_test_scenarios:cpp_test_scenarios
49+
bazel build --config=per-x86_64-linux //tests/cpp_test_scenarios:cpp_test_scenarios
5050
5151
- name: Build Rust test scenarios with Bazel
5252
run: |

BUILD

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,21 @@ test_suite(
116116
tests = ["//src/cpp/tests:bm_kvs_cpp"],
117117
visibility = ["//visibility:public"],
118118
)
119+
120+
test_suite(
121+
name = "unit_tests",
122+
tests = [
123+
"test_kvs_cpp",
124+
"//src/rust/rust_kvs:tests",
125+
],
126+
visibility = ["//visibility:public"],
127+
)
128+
129+
test_suite(
130+
name = "cit_tests",
131+
tests = [
132+
"//tests/python_test_cases:cit_cpp",
133+
"//tests/python_test_cases:cit_rust",
134+
],
135+
visibility = ["//visibility:public"],
136+
)

MODULE.bazel

Lines changed: 26 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_depen
3333
pip.parse(
3434
hub_name = "pip_score_venv_test",
3535
python_version = PYTHON_VERSION,
36-
requirements_lock = "//tests/python_test_cases:requirements.txt",
36+
requirements_lock = "//tests/python_test_cases:requirements.txt.lock",
3737
)
3838
use_repo(pip, "pip_score_venv_test")
3939

@@ -63,18 +63,40 @@ gcc.toolchain(
6363
)
6464
use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc")
6565

66-
register_toolchains(
67-
"@gcc_toolchain//:all",
68-
dev_dependency = True,
66+
# score qnx (qcc) toolchain.
67+
bazel_dep(name = "score_toolchains_qnx", version = "0.0.5", dev_dependency = True)
68+
69+
toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx", dev_dependency = True)
70+
toolchains_qnx.sdp(
71+
sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63",
72+
strip_prefix = "installation",
73+
url = "https://www.qnx.com/download/download/79858/installation.tgz",
6974
)
75+
use_repo(toolchains_qnx, "toolchains_qnx_sdp")
76+
use_repo(toolchains_qnx, "toolchains_qnx_qcc")
77+
use_repo(toolchains_qnx, "toolchains_qnx_ifs")
7078

7179
## Bazel registry
7280
# Module dependencies
7381
bazel_dep(name = "googletest", version = "1.17.0.bcr.1")
7482

7583
bazel_dep(name = "google_benchmark", version = "1.9.4", dev_dependency = True)
7684

85+
bazel_dep(name = "platforms", version = "1.0.0")
86+
7787
## S-CORE bazel registry
88+
bazel_dep(name = "score_baselibs", version = "0.1.2")
89+
bazel_dep(name = "score_bazel_platforms", version = "0.0.2")
90+
bazel_dep(name = "score_docs_as_code", version = "2.2.0")
91+
bazel_dep(name = "score_platform", version = "0.5.0")
92+
git_override(
93+
module_name = "score_platform",
94+
commit = "9d30b718db22ad335cccbcfd72f96e5b37fa58f1", # obsolete by 0.5.1+
95+
remote = "https://github.com/eclipse-score/score.git",
96+
)
97+
98+
bazel_dep(name = "score_process", version = "1.3.2")
99+
bazel_dep(name = "score_python_basics", version = "0.3.4")
78100
bazel_dep(name = "score_tooling", version = "1.0.3")
79101

80102
# ToDo: remove this once 1.0.4 is released,
@@ -89,24 +111,6 @@ git_override(
89111
bazel_dep(name = "aspect_rules_lint", version = "1.10.2")
90112
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")
91113

92-
# docs-as-code
93-
bazel_dep(name = "score_docs_as_code", version = "2.2.0")
94-
95-
# Provides, pytest & venv
96-
bazel_dep(name = "score_python_basics", version = "0.3.4")
97-
bazel_dep(name = "score_platform")
98-
git_override(
99-
# obsolete by 0.5.1+
100-
module_name = "score_platform",
101-
commit = "9d30b718db22ad335cccbcfd72f96e5b37fa58f1",
102-
remote = "https://github.com/eclipse-score/score.git",
103-
)
104-
105-
bazel_dep(name = "score_process", version = "1.3.2")
106-
107-
# Module deps
108-
bazel_dep(name = "score_baselibs", version = "0.1.2")
109-
110114
## additional settings / config
111115
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
112116
crate.from_cargo(
@@ -156,23 +160,6 @@ git_override(
156160
remote = "https://github.com/eclipse-score/toolchains_rust.git",
157161
)
158162

159-
bazel_dep(name = "score_toolchains_qnx", version = "0.1", dev_dependency = True)
160-
git_override(
161-
module_name = "score_toolchains_qnx",
162-
commit = "cdaa451c994f5e1f88aa6395dd516586f387d0ec",
163-
remote = "https://github.com/eclipse-score/toolchains_qnx.git",
164-
)
165-
166-
toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx", dev_dependency = True)
167-
toolchains_qnx.sdp(
168-
sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63",
169-
strip_prefix = "installation",
170-
url = "https://www.qnx.com/download/download/79858/installation.tgz",
171-
)
172-
use_repo(toolchains_qnx, "toolchains_qnx_sdp")
173-
use_repo(toolchains_qnx, "toolchains_qnx_qcc")
174-
use_repo(toolchains_qnx, "toolchains_qnx_ifs")
175-
176163
bazel_dep(name = "custom_qemu", version = "1.0.0", dev_dependency = True)
177164
archive_override(
178165
module_name = "custom_qemu",
@@ -183,17 +170,8 @@ archive_override(
183170
],
184171
)
185172

186-
bazel_dep(name = "platforms", version = "1.0.0")
187-
188173
# Registers the custom Rust toolchain wired to @qnx_rust
189174
register_toolchains(
190-
"@toolchains_qnx_qcc//:qcc_aarch64",
191175
"@score_toolchains_rust//toolchains/aarch64-unknown-qnx8_0:toolchain_aarch64_qnx8_0",
192176
dev_dependency = True,
193177
)
194-
195-
register_toolchains(
196-
"@toolchains_qnx_ifs//:ifs_x86_64",
197-
"@toolchains_qnx_ifs//:ifs_aarch64",
198-
dev_dependency = True,
199-
)

tests/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,26 @@ pytest -v . --build-scenarios --self-contained-html --html report.html --traces
6767
> Traces are collected using `stdout`.
6868
> Setting `--capture` flag (including `-s`) might cause traces to be missing from HTML report.
6969
70+
### Bazel execution
71+
72+
Run all Component Integration Tests:
73+
74+
```bash
75+
bazel test //:cit_tests
76+
```
77+
78+
When the dependencies in [requirements.txt](python_test_cases/requirements.txt) file are manually modified, the user should invoke command and commit changes:
79+
80+
```bash
81+
bazel run //tests/python_test_cases:requirements.update
82+
```
83+
84+
In order to update all dependencies use:
85+
86+
```bash
87+
bazel run //tests/python_test_cases:requirements.update -- --upgrade
88+
```
89+
7090
## Standalone execution of test scenarios
7191

7292
Test scenarios can be run independently from `pytest`.

tests/python_test_cases/BUILD

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,20 @@
1212
# *******************************************************************************
1313
load("@pip_score_venv_test//:requirements.bzl", "all_requirements")
1414
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
15-
load("@score_python_basics//:defs.bzl", "score_py_pytest", "score_virtualenv")
15+
load("@score_tooling//python_basics:defs.bzl", "score_py_pytest", "score_virtualenv")
1616

17-
# Additional requirements for the tests
17+
# In order to update the requirements, change the `requirements.in` file and run:
18+
# `bazel run //tests/python_test_cases:requirements.update`.
19+
# This will update the `requirements.txt` file.
20+
# To upgrade all dependencies to their latest versions, run:
21+
# `bazel run //tests/python_test_cases:requirements.update -- --upgrade`.
1822
compile_pip_requirements(
1923
name = "requirements",
20-
# requirements_txt = "requirements.txt",
21-
src = "//tests/python_test_cases:pyproject.toml",
24+
srcs = [
25+
"requirements.txt",
26+
"@score_tooling//python_basics:requirements.txt",
27+
],
28+
requirements_txt = "requirements.txt.lock",
2229
tags = [
2330
"manual",
2431
],
@@ -36,8 +43,7 @@ score_py_pytest(
3643
srcs = glob(["tests/**/*.py"]),
3744
args = [
3845
"-m cpp",
39-
"--cpp-target-path",
40-
"$(rootpath //tests/cpp_test_scenarios)",
46+
"--cpp-target-path=$(rootpath //tests/cpp_test_scenarios)",
4147
],
4248
data = [
4349
":python_tc_venv",
@@ -48,9 +54,6 @@ score_py_pytest(
4854
"RUST_BACKTRACE": "1",
4955
},
5056
pytest_ini = "//tests/python_test_cases:pytest.ini",
51-
tags = [
52-
"manual",
53-
],
5457
deps = all_requirements,
5558
)
5659

@@ -59,8 +62,7 @@ score_py_pytest(
5962
srcs = glob(["tests/**/*.py"]),
6063
args = [
6164
"-m rust",
62-
"--rust-target-path",
63-
"$(rootpath //tests/rust_test_scenarios)",
65+
"--rust-target-path=$(rootpath //tests/rust_test_scenarios)",
6466
],
6567
data = [
6668
":python_tc_venv",
@@ -71,9 +73,6 @@ score_py_pytest(
7173
"RUST_BACKTRACE": "1",
7274
},
7375
pytest_ini = "//tests/python_test_cases:pytest.ini",
74-
tags = [
75-
"manual",
76-
],
7776
deps = all_requirements,
7877
)
7978

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
# Fully resolved list of dependencies is required by Bazel.
2-
iniconfig==2.1.0
3-
Jinja2==3.1.6
4-
MarkupSafe==3.0.2
5-
packaging==24.2
6-
pluggy==1.5.0
7-
psutil==7.0.0
8-
Pygments==2.19.2
9-
pytest==8.4.1
10-
pytest-html==4.1.1
11-
pytest-metadata==3.1.1
12-
pytest-repeat==0.9.4
13-
pytest-env==1.1.5
14-
testing-utils @ git+https://github.com/qorix-group/testing_tools.git@v0.2.4
1+
psutil
2+
pytest-metadata
3+
pytest-env
4+
testing-utils @ git+https://github.com/eclipse-score/testing_tools.git@v0.3.0

0 commit comments

Comments
 (0)