From 8dbdf8710ea0c07285624677d003dc6330f50525 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Tue, 3 Nov 2026 16:49:28 +0100 Subject: [PATCH] test(projects): compare Main's mirrored settings as JSON, not as text 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 --- tests/Chronos.Data.Tests/Projects/ProjectServiceTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Chronos.Data.Tests/Projects/ProjectServiceTests.cs b/tests/Chronos.Data.Tests/Projects/ProjectServiceTests.cs index 3c0a3cbf..d49ce1fe 100644 --- a/tests/Chronos.Data.Tests/Projects/ProjectServiceTests.cs +++ b/tests/Chronos.Data.Tests/Projects/ProjectServiceTests.cs @@ -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.