Problem
Several nix-unit integration tests re-import tests/test-flake-helpers.nix, which in turn re-evaluates tests/flake.nix and reconstructs the flake/module graph via flake-parts.lib.mkFlake.
That creates avoidable repeated evaluation work across the test suite. In the current CI profile, the detector step is already spending most of its time in flake evaluation / cache probing, so the duplicated test harness eval makes the overall situation worse.
Evidence
tests/flake.nix instantiates the test harness flake.
- Multiple test files import
tests/test-flake-helpers.nix instead of sharing one evaluated fixture.
- The slow CI job
nix / ☃️ detect flake outputs spent almost all of its runtime in compute build-needed matrix via nix-eval-jobs.
Proposed fix
Refactor the test harness so the expensive flake evaluation happens once and is reused by the integration tests.
Likely shape:
- move the shared evaluated test fixture to one place
- pass that fixture into the integration tests
- keep pure/unit tests separate so they do not pay the harness cost
- remove any now-redundant nested flake evaluation path
Acceptance criteria
- The integration tests no longer re-instantiate the flake separately per file.
- The shared test fixture is evaluated once and reused.
- The affected tests still pass.
- CI evaluation time improves measurably, or at least the refactor clearly reduces duplicated evaluation in the test harness.
Notes
This is a performance and test-structure cleanup, not a behavior change.
Problem
Several nix-unit integration tests re-import
tests/test-flake-helpers.nix, which in turn re-evaluatestests/flake.nixand reconstructs the flake/module graph viaflake-parts.lib.mkFlake.That creates avoidable repeated evaluation work across the test suite. In the current CI profile, the detector step is already spending most of its time in flake evaluation / cache probing, so the duplicated test harness eval makes the overall situation worse.
Evidence
tests/flake.nixinstantiates the test harness flake.tests/test-flake-helpers.nixinstead of sharing one evaluated fixture.nix / ☃️ detect flake outputsspent almost all of its runtime incompute build-needed matrix via nix-eval-jobs.Proposed fix
Refactor the test harness so the expensive flake evaluation happens once and is reused by the integration tests.
Likely shape:
Acceptance criteria
Notes
This is a performance and test-structure cleanup, not a behavior change.