Skip to content

test(cli): build the command-line tests only with the cli feature - #4

Merged
adammharris merged 1 commit into
masterfrom
agent/backlog-fix-cli-tests-run-without-the-cli
Nov 3, 2026
Merged

adammharris merged 1 commit into
masterfrom
agent/backlog-fix-cli-tests-run-without-the-cli

Conversation

@adammharris

Copy link
Copy Markdown
Member

What changed

Cargo.toml declares tests/cli.rs as a [[test]] named cli with required-features = ["cli"], the same requirement the fig-schema binary has. The task file is marked done with a Status section.

Why

tests/cli.rs runs the binary through env!("CARGO_BIN_EXE_fig-schema"). As an auto-discovered test target it compiled without the cli feature, but the binary did not, so cargo test --no-default-features (the configuration prov, flower and twig-export build) failed all 33 CLI tests with NotFound. The library's own tests were passing all along; only the test setup was wrong.

Closes docs/tasks/cli-tests-run-without-the-cli.md. Whether CI should also get a job that runs the library without default features is still the separate decision the task leaves open.

Verification

  • Before: cargo test --no-default-features --no-fail-fast gave tests/cli.rs: 0 passed, 33 failed.
  • After: the same command passes (lib 118, non_exhaustive 15, doctests 18; cli is skipped).
  • cargo test with default features still runs all 33 CLI tests, and they pass.
  • ship ci: all 5 jobs passed (fmt, clippy -D warnings, test, doc, msrv).

tests/cli.rs runs the fig-schema binary, which needs the cli feature, but
as an auto-discovered test target it compiled without it, so
`cargo test --no-default-features` failed all 33 tests on a binary cargo
had not built. Declaring it a [[test]] with required-features = ["cli"],
as the binary is, skips it there; default-feature runs are unchanged.

Closes docs/tasks/cli-tests-run-without-the-cli.md.
@adammharris
adammharris merged commit 006b101 into master Nov 3, 2026
6 checks passed
@adammharris
adammharris deleted the agent/backlog-fix-cli-tests-run-without-the-cli branch November 3, 2026 04:43
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.

1 participant