Create run workspaces only when needed

This commit is contained in:
2026-09-05 16:34:59 +00:00
parent c2806a1615
commit 51d21676c1
9 changed files with 64 additions and 6 deletions

View File

@@ -138,6 +138,7 @@ func TestPlannedStageModelMatchesStageExecution(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
at := time.Date(2026, time.May, 3, 12, 0, 0, 0, time.UTC)
cfg := testConfig(t)
workDir := filepath.Join(t.TempDir(), "run")
cfg.Pipeline.Notarius = &config.NotariusConfig{Enabled: test.result == nil || test.result.Disposition != stage.StageDispositionSkipped}
planned := manifest.New("2026-05-03", at)
executed := manifest.New("2026-05-03", at)
@@ -164,7 +165,7 @@ func TestPlannedStageModelMatchesStageExecution(t *testing.T) {
ctx: context.Background(),
cfg: cfg,
opts: RunOptions{Force: test.force},
identity: invocationIdentity{RunID: "20260503T120000Z-a1b2c3d4"},
identity: invocationIdentity{RunID: "20260503T120000Z-a1b2c3d4", LocalWorkDir: workDir},
env: &stage.Env{Config: cfg, Logger: slog.New(slog.NewTextHandler(io.Discard, nil))},
manifestStore: &manifest.LocalStore{},
manifestPath: filepath.Join(t.TempDir(), "manifest.json"),