2026-07-18 15:59:57 +00:00
|
|
|
package cli
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"bytes"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
2026-11-22 05:24:30 +00:00
|
|
|
func TestConfigCommandsDoNotAllocateRunState(t *testing.T) {
|
2026-07-18 15:59:57 +00:00
|
|
|
for _, args := range [][]string{
|
2026-11-22 05:24:30 +00:00
|
|
|
{"config", "validate"}, {"config", "show"}, {"pipeline", "list"}, {"pipeline", "validate", "dnd-session"},
|
2026-07-18 15:59:57 +00:00
|
|
|
} {
|
2026-11-22 05:24:30 +00:00
|
|
|
fixture := newStateRunFixture(t)
|
|
|
|
|
var stdout, stderr bytes.Buffer
|
|
|
|
|
command := append(append([]string(nil), args...), "--config", fixture.configPath)
|
|
|
|
|
code := RunWithOptions(command, &stdout, &stderr, fixture.options)
|
|
|
|
|
if code != 0 {
|
|
|
|
|
t.Fatalf("%v status=%d stdout=%q stderr=%q", args, code, stdout.String(), stderr.String())
|
|
|
|
|
}
|
|
|
|
|
assertAbsent(t, fixture.outputRoot)
|
|
|
|
|
assertAbsent(t, fixture.cacheRoot)
|
|
|
|
|
assertAbsent(t, fixture.debugRoot)
|
|
|
|
|
if len(fixture.client.requestsSnapshot()) != 0 {
|
|
|
|
|
t.Fatal("inspection invoked provider")
|
|
|
|
|
}
|
2026-07-18 15:59:57 +00:00
|
|
|
}
|
|
|
|
|
}
|