Integration tests resolve their binary by directory depth, breaking on a relocated build directory
- Dominant language
- Rust
- Stars
- 3
- Forks
- 0
- Avg merge
- 1d 42m
- Merged PRs (30d)
- 11
Description
Seventeen tests across two targets fail on an unmodified tree, and the failure has nothing to do with what they test.
## What happens
`cargo test --workspace` exits non-zero. Sixteen failures in `cyphr-cli`'s integration target and one in `cyphr-server`'s CLI target, all with the same shape: the test tries to spawn the binary it is testing and gets `Os { code: 2, kind: NotFound }`.
Excluding those two targets, the workspace is green — 317 tests across 11 binaries.
## Why
Both targets locate the binary under test relative to `current_exe()`, assuming a fixed directory depth from the test executable to the compiled binary. That assumption holds under a default build layout and breaks when the build output directory is relocated, which puts the binary deeper than the lookup walks.
The lookup is the fragile part. A test that finds its subject by counting directory levels upward is coupled to a build layout it does not control, and the failure it produces on a layout change is indistinguishable from the binary genuinely not being built.
## Why this is filed rather than fixed
It was found while doing unrelated work, twice independently — once by stashing the changes and reproducing against an untouched tree, once by removing the new file entirely. Fixing it properly means changing how these tests resolve their subject, which is its own piece of work and does not belong folded into a change about something else.
## What it costs while open
Any check that runs the whole workspace reports failure regardless of the change under review, so whole-workspace green cannot be used as a gate. Per-target runs are unaffected and remain trustworthy.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the current_exe-based binary lookup in the integration tests for the cyphr-cli and cyphr-server CLI targets. Run cargo test --workspace before and after the change; done means all 17 affected tests find their binaries in a relocated build directory and the workspace passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, cli, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100