Two-node VM test for forge-sync: clone, open a PR, be refused on master #140
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes#140
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
forge-sync(allod/nexus#84) is the command that makes a forge VM usable, and the repository it lives in has no NixOS test harness — only shell tests. This is its executable witness: a two-node test where the command runs against a real Forgejo and a dev-shaped client does the thing the whole arc exists for.Primary goals:
forgeCLI, and deliberately no git hooks, so a refusal comes from the server rather than from a local policy hook.forge pr create, and reads it back through the API.Current state and specifics
This repository already has the harness and the node shape.
checks/forgejo.nixis slice 1's two-node test (forge,client) with the forge in fresh, plain-http mode, clone on 2222 and administrative ssh on 22; it already demonstrates the two idioms this test needs — acurlconfig on stdin so no credential is ever an argument, and a token transported as a copied file rather than a command line.checks/service-vm.nixis the newer example of composingserviceModulesdirectly rather than reimplementing production.Two mechanics worth knowing before starting, both measured: a NixOS VM test's
$outkeeps no driver log, andextraDriverArgs = [ "--junit-xml" "junit.xml" ]produces one including serial consoles — which is what makes the token-absence grep possible at all; and the kernel prints 40-hex certificate fingerprints into that log, so a "no token-shaped string" grep must skip^<machine> #lines or it will match them.This repository consumes
allod/nexusas an input, andnexus-provisioning-scriptscopiesscripts/out of the whole flake source path, so the command under test is reachable from here.Scope
In: the test, and whatever parameterisation of the command it needs to be driven from a test driver rather than an operator's terminal — note allod/nexus#84 gives it a
--userflag for exactly this reason, so no interactive prompt blocks the driver. Out: the command itself, and anything that would make the command aware it is under test — a fixture flag or anisTestbranch on a path that handles a token as root is the contaminationtesting.mdforbids.Part of allod/strategy#65
Landed on master as
03f4d4d. Itsnexuspin bump is a follow-up, since the check callsforge-syncwhich landed after the pin was taken.