Skip to content

Add a test suite - #4

Merged
mikelangmayr merged 1 commit into
mainfrom
mike/tests
Oct 12, 2026
Merged

mikelangmayr merged 1 commit into
mainfrom
mike/tests

Conversation

@mikelangmayr

Copy link
Copy Markdown
Contributor
  • 42 tests covering the four things that were verified by hand, once, and that nothing stopped a future edit from breaking: rendering the host artefacts, target resolution, secrets discovery and deploy planning.
  • Fixtures build a throwaway host tree and the tests do real directory reads, stubbing only systemd. The instrument under test is demo, not hispec, so a leaked hispec name fails a test.
  • The rendering tests assert no @placeholder@ survives. That is what catches a template gaining a variable nobody wired up, which would otherwise reach a host as a literal @user@ inside a unit file.
  • Checked the tests actually bite by breaking six things deliberately: a unit running as root, a polkit rule scoped to wheel, an unwired template variable, the host-assignment guard removed, duplicate targets no longer dropped, and the secrets suffix hardcoded. All six fail the suite.
  • pytest is in a test extra, so it never reaches a deployment venv.

@mikelangmayr
mikelangmayr merged commit 7fa924c into main Oct 12, 2026
2 checks passed
@mikelangmayr
mikelangmayr deleted the mike/tests branch October 12, 2026 19:03
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