test(projects): compare Main's mirrored settings as JSON, not as text
CI / Build and test (pull_request) Successful in 10m29s
CI / Windows tests and installer (pull_request) Skipped
CI / YAML check (pull_request) Successful in 13s
CI / PostgreSQL 16 integration (pull_request) Successful in 10m19s
CI / PostgreSQL 17 integration (pull_request) Successful in 11m54s
CI / Docker image (pull_request) Successful in 54s

PostgreSQL stores sequences.settings_json as jsonb, which reorders keys
and drops whitespace, so the exact text match with project.json failed
on the PostgreSQL integration jobs. The other mirror tests already
compare with JsonNode.DeepEquals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-03 16:49:28 +01:00
1 parent 94b277e295
commit 8dbdf8710e
1 file changed
+3 -1
@@ -154,7 +154,9 @@ public abstract class ProjectServiceTests(TestContext context) : DatabaseTest(co
Assert.SequenceEqual([0, 4], mirrored.ExcludedFrames);
Assert.Equal(0.7, mirrored.Exposure.ExposureOffsetEv);
Assert.Equal(frames[2].Id, after.HeroFrameId);
Assert.Equal(after.SettingsJson, File.ReadAllText(fx.Paths.Sequence(sequence.Folder).ProjectPath));
// PostgreSQL stores the settings as jsonb, which reorders keys: compare the JSON, not the text.
Assert.True(System.Text.Json.Nodes.JsonNode.DeepEquals(System.Text.Json.Nodes.JsonNode.Parse(after.SettingsJson!),
System.Text.Json.Nodes.JsonNode.Parse(File.ReadAllText(fx.Paths.Sequence(sequence.Folder).ProjectPath))), "project.json mirrors Main's head");
var row = (await fx.Db.Projects.GetAsync(main.Id))!;
Assert.Equal((stored.Id, after.SettingsVersion), (row.MirroredVersionId, row.MirroredSettingsVersion));
// The mirror is no outside change: no version is added for it.