27 lines
805 B
Go
27 lines
805 B
Go
package cli
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
)
|
|
|
|
func TestConfigCommandsDoNotAllocateRunState(t *testing.T) {
|
|
for _, args := range [][]string{
|
|
{"config", "validate"}, {"config", "show"}, {"pipeline", "list"}, {"pipeline", "validate", "dnd-session"},
|
|
} {
|
|
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")
|
|
}
|
|
}
|
|
}
|