Load campaign and session imports from their sources
This commit is contained in:
@@ -46,6 +46,24 @@ inputs:
|
||||
}
|
||||
}
|
||||
|
||||
func TestInvalidDiscoveredSessionDoesNotTriggerRemoteFallback(t *testing.T) {
|
||||
pipeline, campaign, _ := writeValidConfigFiles(t, t.TempDir())
|
||||
selected := filepath.Join(t.TempDir(), "session.yml")
|
||||
if err := os.WriteFile(selected, []byte("unexpected: value\n"), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
setSessionConfigSearchPaths(t, []string{selected})
|
||||
storeCalls := 0
|
||||
deps := fakeCommandDependencies(&storage.FakeBackend{}, &storeCalls)
|
||||
var stdout, stderr bytes.Buffer
|
||||
if code := executeWithDependencies([]string{"session", "plan", "2026-05-03", "--config", pipeline, "--campaign-file", campaign}, &stdout, &stderr, deps, executePlan); code == 0 {
|
||||
t.Fatal("invalid session was accepted")
|
||||
}
|
||||
if storeCalls != 0 || !strings.Contains(stderr.String(), "decode.unknown_field") {
|
||||
t.Fatalf("store calls=%d, stderr=%q", storeCalls, stderr.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoteSessionLoadingRetainsCampaignCanonicalParty(t *testing.T) {
|
||||
workspaceRoot := t.TempDir()
|
||||
pipelinePath, campaignPath, _ := writeValidConfigFiles(t, workspaceRoot)
|
||||
|
||||
Reference in New Issue
Block a user