Repository navigation
Conversation
Add checks.infra-tftest: `tofu test` over the same terranix output `ark plan` uses, with every provider mocked (mock_provider), the nixos-anywhere module replaced by its outputs, and a plan plus mocked apply that must succeed. Asserts that ark.vps.ip / ark.vps.id resolve to a resource for every host with a provider and that every DNS record has content. No API calls, no tokens, runs under `nix flake check`. To make the config loadable offline, nixos-anywhere becomes a flake input (flake = false) and the deploy module is sourced from a ./nixos-anywhere symlink the terranix wrapper creates in the workdir; its all-in-one module references siblings with ../, which OpenTofu refuses from an absolute store path. This also pins the module through flake.lock instead of tracking GitHub HEAD. The terranix module list is shared through ark.infra.modules so the test and the real configuration cannot drift. Providers gain a `mock` option for their tofu test mocks (Hetzner servers get documentation addresses, Cloudflare zones a fixed id). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015WpX4JSgNq9jx8WBNNrpFt
k2on
pushed a commit
that referenced
this pull request
Oct 18, 2026
…t' (#2) from sivrad/os:adaptive-lighting into main Reviewed-on: https://git.koon.us/max/os/pulls/2
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
This PR adds an offline infrastructure test (
infra-tftest) that validates the Terraform/OpenTofu configuration without making any API calls. The test uses OpenTofu's mock providers to catch broken references, duplicate resources, and misconfigured providers early in the development cycle.Key Changes
New offline test module (
modules/ark/lib/tftest.nix): Implements a comprehensive infrastructure validation check that:Refactored terranix configuration (
modules/ark/lib/terranix.nix):ark.infra.modulesoptionProvider mock support:
mockoption to VPS providers (modules/ark/lib/vps.nix)mockoption to DNS providers (modules/ark/lib/dns.nix)hcloud_serverwith documentation IPs) and Cloudflare (cloudflare_zonewith fixed ID)nixos-anywhere integration:
./nixos-anywhere/all-in-one)Build configuration: Updated
.gitignoreto exclude the symlinked nixos-anywhere directoryImplementation Details
The test validates the provider-agnostic contract that every host relies on:
ark.vps.ipandark.vps.idresolve to real resources for each host with a providerThe mocks are provider-specific and defined alongside their real configurations, making them easy to maintain as the infrastructure evolves. The test is cheap enough to run on every push and complements the more expensive VM integration tests.
https://claude.ai/code/session_015WpX4JSgNq9jx8WBNNrpFt