Reconcile reuse and inspection with native extraction

This commit is contained in:
2026-11-30 02:20:09 +00:00
parent 52a5d483e3
commit b5b4672920
59 changed files with 515 additions and 2444 deletions

View File

@@ -21,7 +21,7 @@ import (
func TestPreparedSessionPublishAndRemoteLoad(t *testing.T) {
ctx := context.Background()
pipelinePath, campaignPath, sessionPath := writeValidConfigFiles(t, t.TempDir())
mustWriteTestFile(t, filepath.Join(filepath.Dir(campaignPath), "glossary.yml"), "campaign: {entries: [{id: watch, name: Watch, category: organization}]}\n")
mustWriteTestFile(t, filepath.Join(filepath.Dir(campaignPath), "glossary.yml"), "schema_version: maximumdirect.glossary.v1\ncollections:\n campaign: {entries: [{id: watch, name: Watch, category: organization}]}\n")
fragment := filepath.Join(filepath.Dir(sessionPath), "fragment.yml")
mustWriteTestFile(t, sessionPath, "config:\n imports:\n - path: fragment.yml\nsession_id: 2026-05-03\n")
mustWriteTestFile(t, fragment, "title: Published title\ninputs: {audio_dir: audio}\n")
@@ -117,7 +117,7 @@ func TestPreparedSessionPublishAndRemoteLoad(t *testing.T) {
}
prefix := artifacts.S3SessionPrefix("dnd", m.Campaign, m.SessionID)
key := artifacts.S3RunRelativeDestinationKey(artifacts.S3RunPrefix(prefix, m.RunID), "prepare/inputs/session.yml")
if got := string(fake.Objects[key].Data); !strings.Contains(got, "Published title") || strings.Contains(got, "imports:") || strings.Contains(got, "speakers_file:") {
if got := string(fake.Objects[key].Data); !strings.Contains(got, "Published title") || strings.Contains(got, "imports:") {
t.Fatalf("published session = %q", got)
}
for _, name := range []string{"campaign.yml", "party.yml", "glossaries/party.yml", "glossaries/campaign.yml", "glossaries/setting.yml", "glossaries/spells.yml"} {
@@ -137,8 +137,8 @@ func TestPreparedSessionPublishAndRemoteLoad(t *testing.T) {
if received.Session.Title != "Published title" || received.SessionSource.S3Key != key {
t.Fatalf("remote session = %#v, source=%#v", received.Session, received.SessionSource)
}
if got := received.StableInputs.SpeakersFile; got.Source != "campaign_config" || got.Path != filepath.Join(filepath.Dir(campaignPath), "speakers.yml") {
t.Fatalf("receiving campaign speakers = %#v", got)
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)
if err != nil {