Preserve campaign defaults in materialized sessions
This commit is contained in:
@@ -24,7 +24,7 @@ func TestSessionInitMaterializesLocalTemplateImports(t *testing.T) {
|
||||
if err := os.Remove(fragment); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
loaded, err := config.LoadSession(output)
|
||||
loaded, err := config.LoadSessionWithOptions(output, sessionInitLoadOptions(t, campaign))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -46,7 +46,7 @@ func TestSessionInitPublishesStandaloneImportedTemplate(t *testing.T) {
|
||||
if err := os.Remove(fragment); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
loaded, err := config.LoadSessionBytesWithOptions("remote session", fake.Objects[key].Data, config.SessionLoadOptions{})
|
||||
loaded, err := config.LoadSessionBytesWithOptions("remote session", fake.Objects[key].Data, sessionInitLoadOptions(t, campaign))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -61,7 +61,7 @@ func TestSessionInitPersistsInvocationRelativeAudio(t *testing.T) {
|
||||
if err := invokeNativeCommandWith(context.Background(), []string{"session", "init", "2026-06-07", "--config", pipeline, "--campaign-file", campaign, "--output", output, "--audio-dir", "./audio"}, &bytes.Buffer{}, executePlan, commandDependencies{}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
loaded, err := config.LoadSession(output)
|
||||
loaded, err := config.LoadSessionWithOptions(output, sessionInitLoadOptions(t, campaign))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -73,3 +73,12 @@ func TestSessionInitPersistsInvocationRelativeAudio(t *testing.T) {
|
||||
t.Fatalf("audio = %q; want %q", loaded.Inputs.AudioDir, want)
|
||||
}
|
||||
}
|
||||
|
||||
func sessionInitLoadOptions(t *testing.T, campaignPath string) config.SessionLoadOptions {
|
||||
t.Helper()
|
||||
campaign, err := config.LoadCampaign(campaignPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return config.SessionLoadOptions{Campaign: campaign, CampaignPath: campaignPath}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user