Skip to content

Commit 3ab61da

Browse files
committed
fix(test): update scaffold_test.go for env.runner migration
The review harness now uses env.runner/env.sandbox instead of runner_env. Update scaffold_test.go assertions to check both legacy RunnerEnv and new Env.Runner fields. Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
1 parent 2b8dbaf commit 3ab61da

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

internal/scaffold/scaffold_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,8 @@ func TestHarnessesLoadAndValidate(t *testing.T) {
632632
assert.Nil(t, h.Forge, "Forge should be nil after resolution")
633633
assert.NotEmpty(t, h.PreScript, "PreScript should be set after forge resolution")
634634
assert.NotEmpty(t, h.PostScript, "PostScript should be set after forge resolution")
635-
assert.NotEmpty(t, h.RunnerEnv, "RunnerEnv should be non-empty after merge")
635+
hasRunnerEnv := len(h.RunnerEnv) > 0 || (h.Env != nil && len(h.Env.Runner) > 0)
636+
assert.True(t, hasRunnerEnv, "RunnerEnv or Env.Runner should be non-empty after merge")
636637

637638
resolveErr := h.ResolveRelativeTo(dir)
638639
require.NoError(t, resolveErr, "ResolveRelativeTo should succeed")
@@ -700,11 +701,22 @@ func TestHarnessForgeRunnerEnvMerge(t *testing.T) {
700701
h, loadErr := harness.LoadWithOpts(harnessPath, harness.LoadOpts{ForgePlatform: "github"})
701702
require.NoError(t, loadErr)
702703

704+
// Build a combined env map from both legacy RunnerEnv and new Env.Runner.
705+
combined := make(map[string]string)
706+
for k, v := range h.RunnerEnv {
707+
combined[k] = v
708+
}
709+
if h.Env != nil {
710+
for k, v := range h.Env.Runner {
711+
combined[k] = v
712+
}
713+
}
714+
703715
for _, key := range tt.topLevelKeys {
704-
assert.Contains(t, h.RunnerEnv, key, "merged RunnerEnv should contain top-level key %s", key)
716+
assert.Contains(t, combined, key, "merged env should contain top-level key %s", key)
705717
}
706718
for _, key := range tt.forgeGithubKeys {
707-
assert.Contains(t, h.RunnerEnv, key, "merged RunnerEnv should contain forge.github key %s", key)
719+
assert.Contains(t, combined, key, "merged env should contain forge.github key %s", key)
708720
}
709721
})
710722
}

0 commit comments

Comments
 (0)