Skip to content

Commit a631cb0

Browse files
committed
Finish collapsing pkg/procmgr/rust onto Bazel
### What does this PR do? Remove the `procmgr_rust_tests` GitLab job and its entry from `JOBOWNERS`, and add the `rust_test` target this uncovered was missing for `dd-procmgr`. ### Motivation Investigating why `rawzip` bump (#53563) broke CI found `procmgr_rust_tests` failing because Cargo's internal registry proxy had not yet mirrored the new version, not because of anything wrong with the bump. The same registry-lag failure independently hit `uuid` bump (#53552), a dependency this crate uses directly. Bazel benefits from ADMS' centralized downloader mirror config (`.adms/bazel/adms.mirror.cfg`), while plain `cargo` instead relies on `.rust_internal_registry`'s bespoke GitLab CI redirect (`.adms/rust/gitlab.yaml`), which is what lagged, so `bazel:test:*` passed both times regardless. This is safe to rely on because `pkg/procmgr/rust/BUILD.bazel` has a `rust_test` target (since #46880) and `bazel:test:linux-amd64`, `:linux-arm64`, etc. already run every target in that file, with the same implied `rustfmt`/`clippy` `-Dwarnings` Cargo passes explicitly, on every pipeline. The one gap, caught by review on #53629, was that `cargo test --all-targets` also exercised `dd-procmgr.rs`'s own 15 `#[test]` functions via `--bins`, which no existing `rust_test` covered; this closes it with a `dd-procmgr_test` target wrapping that binary crate directly. The Cargo job also runs far more than its own path filter suggests: `.on_main_or_release_branch` matches on branch name alone, ahead of the path filter, so it fires on every push to `main`, ~900 times in the last 30 days for an average of ~140s per run. As #53615 already dropped the `extend` from the package-build jobs, removing it here finishes collapsing `pkg/procmgr/rust` onto Bazel as its only toolchain, one source of truth instead of two that are doomed to drift apart. ### Describe how you validated your changes Confirmed parity before removing anything: no test is gated by the `test-helpers` feature beyond `cfg(test)`, and `rules_rust`'s `clippy`/`rustfmt` aspects don't propagate through dependencies, so they only check whatever `//...` names directly, which is every library, binary, and test as its own target. Ran `bazel test //pkg/procmgr/rust:dd-procmgr_test --test_output=all`, confirming all 15 tests run and pass. ### Additional Notes Bazel's coverage is now a strict superset: it lints the plain and `test-helpers`-enabled lib variants as separate targets and tests the `dd-procmgr` CLI binary directly, whereas Cargo's single invocation only ever builds one feature resolution at a time.
1 parent 695123c commit a631cb0

3 files changed

Lines changed: 8 additions & 23 deletions

File tree

.gitlab/JOBOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ tests_serverless-init* @DataDog/serverless-azure-gcp
3333
security_go_generate_check @DataDog/agent-security
3434
prepare_sysprobe_ebpf_functional_tests* @DataDog/ebpf-platform
3535
prepare_secagent_ebpf_functional_tests* @DataDog/agent-security
36-
procmgr_rust_tests @DataDog/agent-runtimes
3736
test_kmt_local_setup* @DataDog/ebpf-platform
3837

3938
# Send count metrics about Golang dependencies

.gitlab/build/source_test/procmgr.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

pkg/procmgr/rust/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ rust_test(
177177
],
178178
)
179179

180+
rust_test(
181+
name = "dd-procmgr_test",
182+
crate = ":dd-procmgr",
183+
edition = "2024",
184+
rustc_flags = ["--cfg=bazel"],
185+
target_compatible_with = _LINUX_OR_WINDOWS,
186+
)
187+
180188
rust_test(
181189
name = "e2e_test",
182190
srcs = [

0 commit comments

Comments
 (0)