Skip to content

ci: compile feature-gated code in the fast lane - #67

Merged
LKSNDRTMLKV merged 1 commit into
mainfrom
ci/check-feature-gated-code
Jul 31, 2026
Merged

ci: compile feature-gated code in the fast lane#67
LKSNDRTMLKV merged 1 commit into
mainfrom
ci/check-feature-gated-code

Conversation

@LKSNDRTMLKV

Copy link
Copy Markdown
Member

Closes #59.

One fast-lane job that compiles the feature-gated suites without running them. No Docker, no test execution, no needs:.

It bit a third time, after the issue was filed

The issue records two instances on 2026-07-28. A third landed on the 0.13.0 repin branch two days later: crates/dpp-vault/tests/audience_read_route.rs#![cfg(feature = "integration-tests")] at line 20 — still imported the credential types from dpp_crypto after 0.13.0 moved them to dpp_vc.

Run 30579767809 is the shape of the problem in one screenshot: eight jobs green, one red. Format check, Clippy, Unit tests, Postgres integration tests, Security audit and all three grep gates passed. The only failure was Integration tests (testcontainers) — the Docker tier, which is needs: [test-unit], so it starts last and would not have run at all on a machine without Docker. The fix is fix(vault): repoint credential imports in gated tests, merged in #66.

Same shape as the 0.11.0 instance in the issue: a core repin moves a symbol, the default-feature workspace goes clean, and the gated suites are found one at a time afterwards.

Answering the issue's own caveat

The issue proposed --all-features and flagged that it also enables s3 and desktop. The full feature set of the workspace:

Crate Feature
dpp-dal, dpp-vault, dpp-plugin-host integration-tests wanted
dpp-node integration-tests → pulls s3 wanted
dpp-plugin-host wasm-fixture-tests needs the wasm32-wasip1 target; tests/sdk_abi.rs shells out to a nested cargo build --target wasm32-wasip1
cli desktop rfd + wayland-client

--all-features does not fail — I ran it, exit 0 — so the caveat's worry about a broken build is unfounded. But it compiles rfd, and cli/Cargo.toml states the feature is off by default precisely to keep "rfd's ashpd/Wayland stack (a large, Linux-desktop-only subtree) out of a server-side build". Switching it on in CI contradicts a decision the manifest writes down. wasm-fixture-tests is the same kind of mismatch: compiling a suite this lane can never execute.

So features are named per package — the second option the issue offered.

Why one invocation rather than a loop

just check-integration, merged in #66, loops cargo test --no-run over the four crates. CI uses a single cargo check --workspace --all-targets --features dpp-dal/…,dpp-vault/…,dpp-plugin-host/…,dpp-node/… instead.

Measured locally on a warm target dir, so the two are comparable: four per-crate invocations took 24 + 35 + 17 + 45 = 121 s; the single package-qualified invocation took 27 s. Four passes re-check the shared dependency graph under four separate feature resolutions; one pass unifies it. (The --all-features run above is not in this comparison — it ran cold and its 111 s is not measuring the same thing.)

The single pass is also more coverage, not less: it checks every workspace target with the gated features unified, where the loop only checks the four named crates.

Two honest differences from the local recipe: cargo check does not link, so this proves the gated tests compile, not that their binaries link; and the two commands are not identical, so they can drift. Mirroring the recipe exactly instead is a fair alternative — it just costs ~4× the wall time for the linking guarantee.

Verification

Locally: just check green (586/586) and the new command exit 0 against published dpp-core, no [patch.crates-io] override.

On CI, run 30614915331 — all ten jobs green on a clean runner, including Feature-gated code compiles.

It costs nothing in wall time. The job has no needs:, so it runs alongside the rest of the fast lane. At 182 s on a cold cache it finishes well inside Integration tests (testcontainers) at 291 s, which remains the critical path. The run is no longer than it was before this job existed.

The integration-tests suites were compiled nowhere but the Docker tiers, so a stale import in one of them surfaced late or not at all.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@LKSNDRTMLKV
LKSNDRTMLKV merged commit dabdc7e into main Jul 31, 2026
21 checks passed
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.

CI: the fast lane runs default features only, so feature-gated code breaks invisibly

1 participant