Preserve derived publication and preparation evidence
This commit is contained in:
@@ -6,13 +6,18 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestInspectionSnapshotPreservesFinalValuesWithoutResolvingCredentialsAgain(t *testing.T) {
|
||||
func TestPipelineMaterializationPreservesFinalValuesWithoutResolvingCredentialsAgain(t *testing.T) {
|
||||
const name = "NARRATIO_SNAPSHOT_TEST_KEY"
|
||||
const secret = "synthetic-snapshot-secret"
|
||||
t.Setenv(name, secret)
|
||||
path := writePipelineFixture(t, t.TempDir(), "pipeline.yml", `audita:
|
||||
credentials: [NARRATIO_SNAPSHOT_TEST_KEY]
|
||||
scriptorium:
|
||||
artifact_families:
|
||||
character_notes:
|
||||
enabled: false
|
||||
for_each: party.characters
|
||||
output_path_pattern: artifacts/{character_id}.md
|
||||
artifacts:
|
||||
recap:
|
||||
vars:
|
||||
@@ -24,9 +29,6 @@ scriptorium:
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
artifact := cfg.Scriptorium.Artifacts["recap"]
|
||||
artifact.Vars["config"] = map[string]any{"extends": "ordinary-data"}
|
||||
cfg.Scriptorium.Artifacts["recap"] = artifact
|
||||
if err := os.Unsetenv(name); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -37,7 +39,7 @@ scriptorium:
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, expected := range []string{name, "9007199254740993", "ordinary-data", "nothing: null", "empty: []"} {
|
||||
for _, expected := range []string{name, "9007199254740993", "nothing: null", "empty: []", "character_notes:", "artifact_families:"} {
|
||||
if !strings.Contains(string(data), expected) {
|
||||
t.Fatalf("snapshot missing %q: %s", expected, data)
|
||||
}
|
||||
@@ -47,7 +49,7 @@ scriptorium:
|
||||
}
|
||||
}
|
||||
|
||||
func TestInspectionSnapshotKeepsEmptyCredentialListDistinctFromNull(t *testing.T) {
|
||||
func TestPipelineMaterializationKeepsEmptyCredentialListDistinctFromNull(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
nullPath := writePipelineFixture(t, dir, "null.yml", "audita: {credentials: null}\n")
|
||||
emptyPath := writePipelineFixture(t, dir, "empty.yml", "audita: {credentials: []}\n")
|
||||
|
||||
Reference in New Issue
Block a user