Skip to content

test: execute CIT with Bazel#48

Merged
vinodreddy-g merged 3 commits intoeclipse-score:mainfrom
qorix-group:piotrkorkus_cit_bazel
Jul 28, 2025
Merged

test: execute CIT with Bazel#48
vinodreddy-g merged 3 commits intoeclipse-score:mainfrom
qorix-group:piotrkorkus_cit_bazel

Conversation

@PiotrKorkus
Copy link
Contributor

  • deleted kvs_0_default.json - it is created by the test in tempdir, no need to keep it in repo
  • fixed rust_library target after split
  • added targets for CIT and grouped them under one test suite

Note:
Bazel requires one test target per integration test file to match Cargo’s behavior. This is why you can’t use a single glob for all cit_
.rs files in one rust_test target. If you use glob(["tests/cit_*.rs"]) as srcs in a single rust_test, Bazel tries to build all those files as one crate, but there’s no single crate root, so it fails with errors like “Couldn't find lib.rs”.

@PiotrKorkus PiotrKorkus force-pushed the piotrkorkus_cit_bazel branch from 1aac2f5 to 2b190f9 Compare July 16, 2025 11:55
@github-actions
Copy link

github-actions bot commented Jul 16, 2025

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 22e380b1-61d4-4ee3-9a16-e76f2d432911
Computing main repo mapping: 
Computing main repo mapping: 
DEBUG: Rule 'rules_boost~' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-aSViuHoOdF32Ue/Cx02/mOzyEebHMFuifjZs4GNWjsE="
DEBUG: Repository rules_boost~ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:387:31: in <toplevel>
Computing main repo mapping: 
WARNING: For repository 'googletest', the root module requires module version googletest@1.14.0, but got googletest@1.15.0 in the resolved dependency graph.
WARNING: For repository 'aspect_rules_lint', the root module requires module version aspect_rules_lint@1.0.3, but got aspect_rules_lint@1.4.2 in the resolved dependency graph.
Computing main repo mapping: 
Loading: 
Loading: 1 packages loaded
Analyzing: target //:license-check (2 packages loaded, 0 targets configured)
Analyzing: target //:license-check (2 packages loaded, 0 targets configured)

Analyzing: target //:license-check (55 packages loaded, 10 targets configured)

Analyzing: target //:license-check (99 packages loaded, 10 targets configured)

Analyzing: target //:license-check (107 packages loaded, 10 targets configured)

Analyzing: target //:license-check (107 packages loaded, 10 targets configured)

Analyzing: target //:license-check (157 packages loaded, 972 targets configured)

Analyzing: target //:license-check (165 packages loaded, 2810 targets configured)

Analyzing: target //:license-check (165 packages loaded, 2810 targets configured)

Analyzing: target //:license-check (168 packages loaded, 4816 targets configured)

Analyzing: target //:license-check (170 packages loaded, 5060 targets configured)

Analyzing: target //:license-check (170 packages loaded, 5060 targets configured)

Analyzing: target //:license-check (170 packages loaded, 5060 targets configured)

INFO: Analyzed target //:license-check (171 packages loaded, 6979 targets configured).
[8 / 13] [Prepa] Expanding template license.check.license_check
ERROR: /home/runner/work/inc_mw_per/inc_mw_per/BUILD:36:21: Generating Dash formatted dependency file ... failed: missing input file '//:cargo_lock'
ERROR: /home/runner/work/inc_mw_per/inc_mw_per/BUILD:36:21: Generating Dash formatted dependency file ... failed: 1 input file(s) do not exist
Target //:license.check.license_check failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/runner/work/inc_mw_per/inc_mw_per/BUILD:36:21 Generating Dash formatted dependency file ... failed: 1 input file(s) do not exist
INFO: Elapsed time: 188.622s, Critical Path: 0.33s
INFO: 12 processes: 2 disk cache hit, 10 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@github-actions
Copy link

The created documentation from the pull request is available at: docu-html

All tests are kept in separate files as the working directory is always
changed. If there is more than one test in a file both tests are run in
parallel and use the same working directory which will led to wrong results.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I think it'd be better to remove this README.md file and add a proper one to the root of repository.

  • This README.md doesn't contain anything useful.
  • It's better to have all basic information in one place.
  • You can copy the one from orch repo, with minor changes it should do just fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, please check new readme

deps = __cit_deps,
)

rust_test(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fond of having a target for every file, but TBH couldn't find a way to do it better without breaking existing cargo test runs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me too, so far the only way I found to group tests is by using test suite and I think this will be our way of running all component tests at once:
bazel test //src/rust/rust_kvs:cit

Created bazel targets for component integration tests.
Groupped them under one test suite.
enable autoformatting bazel files on save
@PiotrKorkus PiotrKorkus force-pushed the piotrkorkus_cit_bazel branch from e283498 to f3ea1d4 Compare July 23, 2025 07:38

```bash
sudo apt-get update
sudo apt-get install -y curl build-essential protobuf-compiler libclang-dev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did You check those deps are relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I checked it out in docker

Build all targets:

```bash
bazel build //...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this will work in this repo right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs are the only that don't. But in general that command shall be always working. Created ticket - #52

README.md Outdated
```bash
cargo run --help
```
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to project root

added info about bazel, cargo, testing and cli tool
@PiotrKorkus PiotrKorkus force-pushed the piotrkorkus_cit_bazel branch from f3ea1d4 to eb2fdea Compare July 23, 2025 14:03
@arkjedrz
Copy link
Contributor

LGTM

@vinodreddy-g vinodreddy-g merged commit 3e664ce into eclipse-score:main Jul 28, 2025
11 checks passed
atarekra pushed a commit to Valeo-S-CORE-Organization/persistency that referenced this pull request Nov 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants