Repository navigation
test(nix): smoke-test the in-container nix/direnv runtime - #679
Merged
c-vigo merged 1 commit intoJun 24, 2026
Merged
Conversation
The portable testinfra suite only asserts that nix/direnv/nix-direnv are present in the Nix-built image, not that the baked runtime functions. Add a self-contained, network-free smoke script run inside the loaded image that checks `nix --version`, `direnv version`, a real `nix eval` (evaluator + nix-command/flakes), and a direnv allow/exec round-trip, and gate the nix-image build/test job on it so a broken in-container nix/direnv fails CI. Refs: #675
c-vigo
force-pushed
the
test/675-nix-incontainer-smoke
branch
from
June 24, 2026 11:42
449f57b to
f14687d
Compare
This was referenced Jun 25, 2026
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.
What
Adds an in-container Nix runtime smoke test so a regression that leaves
nix/direnvon PATH but broken can no longer pass CI.The Nix-built image bakes the Nix toolchain live into the closure (
nix,direnv,nix-direnv— flake.niximageTools, #634). The portable testinfrasuite (
tests/test_image.py, #635) only asserts tool presence, not that theruntime functions — so a broken evaluator/direnv would slip through.
Changes
scripts/nix_runtime_smoke.sh(new, executable, shellcheck-clean) — runsINSIDE the image and checks, all network-free:
nix --versiondirenv versionnix eval --extra-experimental-features 'nix-command flakes' --expr '1 + 1'(asserts
== 2) — exercises the evaluator + experimental features, not justthe binary's
--versiondirenv allow+direnv exec . trueround-trip against a trivial.envrc— proves direnv's own allow/hook/exec runtime
.github/workflows/nix-image.yml— a new gating step inbuild-and-test(both arches), right after the testinfra run, executes the script in the image
the test-image action already loaded into podman (
${REGISTRY}:nix-image),bind-mounting
scripts/read-only:CHANGELOG.md(+ hook-syncedassets/workspace/.devcontainer/CHANGELOG.md)— one
### Addedbullet.Design notes
podman as
${REGISTRY}:nix-image; reusing that loaded image avoids asecond
docker loadof the heavy tarball.nix developagainst the scaffolded workspace flake(
/root/assets/workspace) would fetchgithub:vig-os/devcontainer+ nixpkgs(slow, flaky, can produce false failures). Instead the script uses
nix eval(evaluator path) + a
direnv allow/execround-trip (the acceptance-listeddirenv substitute), which are deterministic and still fail iff the runtime is
broken.
nix-image.yml;ci.ymluntouched (sibling PR owns it).Validation
Per the TDD note, the full image was not built locally (heavy/minutes). The
script logic was validated on the host (
nix --version,direnv version,nix eval,direnv allow/execall green) and shellcheck/yamllint are clean.Full in-image execution is deferred to the scoped
nix-image.ymlCI run.Closes #675