Isolate secrets bootstrap in maintained example tests
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user