Skip to content

User cargo config silently disables the docker-tests cfg, making a documented command a false green #53

Description

@FAZuH

Found while verifying PR #52. This is not a doc nit: one of the commands AGENTS.md documents reports zero tests run as a green pass.

The mechanism

.cargo/config.toml in this repo contains only:

[build]
rustflags = ["--cfg", "feature=\"docker-tests\""]

But ~/.cargo/config.toml sets a target-specific rustflags table:

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-Wl,-rpath,/home/admin/.local/share/koharu-toolchain/lib"]

Cargo does not merge [build].rustflags with [target.<triple>].rustflags; the target table takes precedence. So on this host the --cfg feature="docker-tests" never reaches the compiler, and everything behind #[cfg(feature = "docker-tests")] is compiled out.

The symptom

AGENTS.md documents this as the way to run the suite:

cargo test -p lab-ops --test auto_discover   # auto-discover Docker integration tests

It reports:

running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

A green result for a suite that did not run. I hit this myself earlier in the session and misread it as a passing run; it took a second look to catch.

AGENTS.md asserts that .cargo/config.toml "always enables docker-tests" and that --all-features is therefore "redundant but harmless". On this host the opposite is true: --all-features is required, and omitting it silently skips the whole suite.

What to build

A state where the documented commands either work or fail loudly. Options, in order of preference:

  • (a) Add --all-features to the documented commands and correct the AGENTS.md claim. Smallest honest fix, and it makes the intent explicit at the call site rather than depending on a config file that is being overridden from outside the repo.
  • (b) Make the user-level config stop clobbering the project one. The [env] entries in ~/.cargo/config.toml are load-bearing for this host (libclang, fontconfig pkg-config), but the [target.*] rustflags entry exists only to bake an rpath. Merging the rpath into [build].rustflags in the user config, or using RUSTFLAGS plus a second flag, would let the project config apply again. This is machine config, not repo config, so it does not travel with the repo and is easier to regress.
  • (c) Add a guard so the suite cannot report green while running nothing, e.g. an assertion on the test count.

Note (b) alone does not help CI or anyone else whose config differs, so (a) is the part that travels.

Acceptance criteria

  • Every command in AGENTS.md that targets the Docker suites actually runs them on a clean host
  • Running a Docker target without the feature does not report ok. 0 passed as if it passed
  • AGENTS.md no longer claims .cargo/config.toml always enables docker-tests, and no longer calls --all-features redundant
  • The same false claim is not repeated in docs/dev/testing.md

Blocked by

None (can start immediately).

Related: PR #52 touches this harness. Its --test-threads=1 claim in AGENTS.md is also false and is reported separately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions