Skip to content

test: simlin-engine's simulation corpus is gated behind feature file_io (294 vs 650 tests) #925

Closed

Description

@bpowers

Problem

src/simlin-engine/tests/integration/main.rs gates the simulation corpus behind the file_io cargo feature:

#[cfg(feature = "file_io")]
mod simulate;
#[cfg(feature = "file_io")]
mod simulate_ltm;
#[cfg(feature = "file_io")]
mod simulate_ltm_wasm;

So a plain cargo test -p simlin-engine --test integration runs 294 tests. With --features file_io it runs 650. The 356 that vanish include the entire model corpus and the VM-vs-wasm parity hook -- that is, the tests most likely to catch a real regression.

Discovered while lowering the queue pass to wasm (d043434): cargo test -p simlin-engine --test integration queue reported 0 tests and 294 filtered out, which looked like the new fixtures had not been registered. They had been; the module simply was not compiled in.

Why this is wrong

file_io is meant to gate a production dependency, not test coverage. Gating tests behind it means:

  • A bare cargo test on the crate is far weaker than it appears, and silently so. There is no warning, no skip count -- the tests do not exist.
  • Anyone debugging with a filtered cargo test gets a false negative and may conclude their test is not registered, or worse, that it passes.

The pre-commit hook and CI do enable the feature, so this is not currently letting regressions through. It is a footgun for local iteration and a coverage cliff for anyone who does not know the incantation.

Suggested fix

Move the tests off the feature gate. If some individual tests genuinely need file_io-gated engine APIs, gate those tests, not the whole module. The fixture-loading helpers that read from test/ are the likely reason for the gate; if reading a fixture from disk requires the production file_io feature, that dependency direction is itself worth questioning -- a test can read a file without the library exposing file I/O.

Related but distinct: #915 (nothing runs the #[ignore]d tier).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions