Isolate secrets bootstrap in maintained example tests

This commit is contained in:
2026-11-23 04:22:35 +00:00
parent 26dd5252ab
commit dbf62718d2
2 changed files with 18 additions and 0 deletions

View File

@@ -6,6 +6,17 @@ Reviewed implementation Stages 1–12 at commit
## Isolate Secrets Bootstrap In The Maintained-Example Test
**Status: Complete.** The sweep now registers `t.Setenv` cleanup before
unsetting the synthetic variable, exercising provisioning from absence while
restoring the original presence and value after the test. Production bootstrap
and comparison behavior are unchanged.
Verification passed: a temporary test overlay failed before the fix and now
passes for initially absent and pre-existing values, including three repeated
race runs. Maintained-example/bootstrap tests passed five shuffled race runs;
the full normal and race suites, vet, build, formatting, and whitespace checks
also passed.
**Location:** `internal/adapter/cli/examples_test.go:20–30`, reached through
`examples/config.secrets.yml` and its synthetic secrets directory.

View File

@@ -8,6 +8,13 @@ import (
)
func TestMaintainedApplicationExamplesUseNativeLoading(t *testing.T) {
const token = "SCRIPTORIUM_EXAMPLE_TOKEN"
// Exercise provisioning from absence, restoring the original environment at cleanup.
t.Setenv(token, "")
if err := os.Unsetenv(token); err != nil {
t.Fatal(err)
}
root, err := filepath.Abs(filepath.Join("..", "..", ".."))
if err != nil {
t.Fatal(err)