Repository navigation
test: share scaffold fixtures and consolidate nix invocations - #1420
Merged
Merged
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #1417 (WP5 of the #1413 audit): the suite's dominant wall-clock costs — repeated
init-workspace.shscaffold runs and per-testnix develop/nix buildlaunches with identical inputs — now share cached fixtures. No assertion was removed or weakened; failure attribution is preserved in every merged sweep. TDD RED-first does not apply (test-infrastructure refactor, no production behavior change).Changes
tests/workflow_scaffold.py:cached_tree(workflow)— onefunctools.cached scaffold per workflow model (default/gitflow/trunk), rendered into a private temp dir removed at exit, documented read-only. Migrated all read-only shape assertions intest_workflow_model.py(13 sites),test_sync_settings.py(2),test_workflow_devkit_upgrade.py(3 via_rendered),test_workflow_sync_checkout.py(1),test_workflow_prepare_extension.py(1). Mutating cases (upgrades, seeds, hostile-input guards, enum/contradiction guards) keep per-test scaffolds. Scaffold subprocess runs in the sweep: ~40 → 20.tests/bats/init-workspace.bats:setup_filerenders the four delivery-mode trees once per file; the read-only groups (T4.3 — Install/init UX: choose devcontainer / direnv / both #641 trio, CI + release workflows hard-coupled to the container image regardless of DEVKIT_MODE #991 ci.yml identity, Shared setup-devkit-toolchain composite action (mode-aware step-level provisioning) #994 composite ship, CI + release workflows hard-coupled to the container image regardless of DEVKIT_MODE #991 resolve-image removal, [BUG] direnv/bare scaffold ships container-only artifacts #989 ships-in) read them via_shared_tree. 19 scaffold runs → 4; upgrade/seed/preview tests untouched.tests/test_flake_devshell.py:test_each_tool_runs_in_devshellnow runs ONEnix developentry with a generated probe over all devTools (was one entry per tool, ~29), reporting each failing tool with rc + stderr; the python3 + vig-utils console-script probes merged into one--ignore-environmententry (test_devshell_own_path_binaries, [BUG] Downstream mkProjectShell dev-shell omits bare python/python3 and pre-commit (image has them) #729/Expose vig-utils console scripts host-side (dev-shell + pinned uv-tool path) #993) with per-binary attribution. The staleexposes_python3_and_precommitname is gone; the-kselection inci.ymlis updated in the same commit (collects 10/16, verified).tests/test_setup_toolchain_env.py: one module-scoped run of the devshell step feeds the ~32 byte-identical default invocations (scalar/multiline forwards, 27 denylist params, uv-pin, store-PYTHONPATH, ambient filter); distinct-input tests keep their own runs.tests/test_flake_hooks.py: the three consumer-config fixtures (customized / gitleaks-enabled / trunk) build in ONEnix buildvia a namedlinkFarm(3 module-scoped builds → 1, cached per run).Timing (local, warm nix store — CI/cold benefits are larger)
test_flake_devshell.pyfulltest_setup_toolchain_env.pyinit-workspace.bats(238 tests)test_flake_hooks.pyfixturesnix buildsVerification
test_flake_devshell.py: 15 passed, 1 skipped (NixOS-gated skip, runs on CI ubuntu); ci.yml-kexpression collects 10/16 with no stale names (grepclean).test_flake_hooks.py+test_flake_services.py -k "not services_poc_boots": 39 passed.test_setup_toolchain_env.py: 42 passed.bats tests/bats/init-workspace.bats: 238/238 ok.prek run --all-files: green.Closes #1417