Merge imported products into local session state
This commit is contained in:
@@ -140,11 +140,11 @@ func TestPreparedSessionPublishAndRemoteLoad(t *testing.T) {
|
||||
if got := received.StableInputs.SpeakersFile; got.Source != "session_config" || got.Path != filepath.Join(filepath.Dir(campaignPath), "speakers.yml") {
|
||||
t.Fatalf("receiving session speakers = %#v", got)
|
||||
}
|
||||
current, err := discoverRemoteCurrentState(ctx, received, fake)
|
||||
current, err := discoverRemotePublication(ctx, received, fake)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
plan, err := buildRestorePlan(ctx, received, current, fake, RestorePlanOptions{Force: true})
|
||||
plan, err := buildInventoryRestorePlan(ctx, received, current, fake, RestorePlanOptions{Force: true})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -161,6 +161,9 @@ func TestPreparedSessionPublishAndRemoteLoad(t *testing.T) {
|
||||
}
|
||||
}
|
||||
paths := store.SessionPathsFor(m.Campaign, m.SessionID)
|
||||
if err := (&manifest.LocalStore{}).Save(ctx, paths.ManifestPath, m); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, name := range []string{"session.yml", "campaign.yml", "party.yml", "glossaries/party.yml", "glossaries/campaign.yml", "glossaries/setting.yml", "glossaries/spells.yml"} {
|
||||
if name == "glossaries/campaign.yml" {
|
||||
if err := os.WriteFile(filepath.Join(paths.InputsDir, name), []byte("local change"), 0644); err != nil {
|
||||
@@ -212,7 +215,7 @@ func TestPreparedSessionPublishAndRemoteLoad(t *testing.T) {
|
||||
if string(fake.Objects[key].Data) != committedBytes {
|
||||
t.Fatal("authoring update changed committed input")
|
||||
}
|
||||
if _, err := discoverRemoteCurrentState(ctx, authored, fake); err != nil {
|
||||
if _, err := discoverRemotePublication(ctx, authored, fake); err != nil {
|
||||
t.Fatalf("committed state after authoring update: %v", err)
|
||||
}
|
||||
// Remove the authored override to exercise committed-snapshot integrity below.
|
||||
|
||||
Reference in New Issue
Block a user