Skip to content

libsimlin: silent fixture-skip guards can turn integration tests into no-op passes #897

Closed

Description

@bpowers

Problem

Several libsimlin integration tests guard fixture loading with a silent-skip pattern:

if !path.exists() {
    eprintln!("missing ... fixture; skipping");
    return;
}

This pattern already caused real damage: in src/libsimlin/tests/integration/simulation.rs the guard pointed at a nonexistent path (../../src/engine/testdata/SIR_project.pb) for a long time, so test_interactive_set_get and test_set_value_phases silently passed while exercising nothing -- test_set_value_phases was still asserting a NotSimulatable error contract that had been obsolete for months. Those two were fixed on the conveyor-engine branch (path corrected to testdata/SIR_project.pb, guards replaced with hard .expect(...) failures), but the same landmine remains at:

  • src/libsimlin/tests/integration/diagram.rs:18 (SIR.stmx)
  • src/libsimlin/tests/integration/project.rs:81, :166, :1083 (SIR.stmx, SIR.mdl)
  • src/libsimlin/tests/integration/serialization.rs:311 (SIR_project.pb)
  • src/libsimlin/tests/integration/patch.rs:1178, :1259, :1593 (src/pysimlin/tests/fixtures/teacup.stmx)

All of these fixtures currently exist, so the tests run today -- but a moved or renamed fixture silently converts each test into a no-op pass, exactly the failure mode that hid the stale test_set_value_phases assertion.

Why it matters

Silently-skipped tests are worse than missing tests: they report green while verifying nothing, and let obsolete behavioral contracts linger unnoticed. The same class of bug was previously hit in the engine (#623).

Suggested fix

All fixtures are committed to the repo, so there is no legitimate "fixture may be absent" case. Replace each guard with a hard failure, e.g. std::fs::read(&path).expect("fixture must exist: ..."), matching the fixed tests in simulation.rs.

Context

Identified while fixing the stale test_set_value_phases test on the conveyor-engine branch (PR #869 follow-up work).

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