Skip to content

test(image): make testinfra suite portable across Debian and Nix images - #645

Merged
c-vigo merged 3 commits into
feature/625-nix-claude-migrationfrom
feature/635-portable-testinfra
Jun 23, 2026
Merged

c-vigo merged 3 commits into
feature/625-nix-claude-migrationfrom
feature/635-portable-testinfra

Conversation

@c-vigo

@c-vigo c-vigo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes tests/test_image.py path-agnostic (T2.2) so the testinfra suite stays valid against both the current Debian image and the future Nix image. Pure test refactor — no conftest.py image source/name changes.

  • Convert dpkg host.package(...).is_installed checks (git, curl, openssh-client, nano, tmux, rsync) to --version/-V runs via a small assert_tool_runs helper.
  • Resolve gh, just, hadolint, taplo and cargo-installed tools via PATH (command -v, new assert_tool_on_path helper) instead of hardcoded /usr/local/bin, /root/.cargo/bin, /root/.local/bin.
  • Drop the DEBIAN_FRONTEND env assertion and the apt-sourced version-prefix checks (git, curl, tmux, rsync) from EXPECTED_VERSIONS.
  • Reviewed the /root/assets/workspace/ mount assertions: they use POSIX host.file(...) checks on image-controlled /root/... paths (not Debian-FHS/dpkg), so they are already portable and left functionally intact.

Note: bumped the manually-installed just version pin 1.53. -> 1.54. to match the current latest-release binary in the image (the old pin was already failing on a fresh build, independent of this refactor).

Verification

  • Built the Debian image with isolated tag wt635 (./scripts/build.sh wt635 ...), no :latest/:dev clobber, nothing pushed.
  • just test-image wt635: 64 passed in 193.32s (green).
  • just precommit: all hooks pass.
  • No Debian/FHS-only assertions remain (no is_installed/host.package, no hardcoded /usr/local/bin etc., no DEBIAN_FRONTEND, no apt version prefixes) — remaining textual matches are docstrings/comments only.

Refs: #635

Replace Debian/FHS-specific assertions in tests/test_image.py with
path-agnostic equivalents so the suite is valid against both the current
Debian image and the future Nix image:

- convert dpkg host.package(...).is_installed checks (git, curl,
  openssh-client, nano, tmux, rsync) to --version/-V runs
- resolve gh, just, hadolint, taplo and cargo-installed tools via PATH
  (command -v) instead of hardcoded /usr/local/bin, /root/.cargo/bin and
  /root/.local/bin locations
- drop the DEBIAN_FRONTEND env assertion and apt-sourced version-prefix
  checks (git, curl, tmux, rsync) from EXPECTED_VERSIONS

Refs: #635
@c-vigo
c-vigo marked this pull request as ready for review June 23, 2026 08:18
c-vigo added 2 commits June 23, 2026 10:21
…' into feature/635-portable-testinfra

# Conflicts:
#	CHANGELOG.md
#	assets/workspace/.devcontainer/CHANGELOG.md
…' into feature/635-portable-testinfra

# Conflicts:
#	CHANGELOG.md
#	assets/workspace/.devcontainer/CHANGELOG.md
@c-vigo
c-vigo merged commit eee9cf9 into feature/625-nix-claude-migration Jun 23, 2026
2 checks passed
@c-vigo
c-vigo deleted the feature/635-portable-testinfra branch June 23, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant