From aaf9c0bba703cc604a374f02091fd9ac458f9652 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Wed, 4 Nov 2026 19:59:49 +0100 Subject: [PATCH] test(render): pin the merged phase 4 render sizes end to end With P1's geometry merged, the render follows the chosen proportions, so the server's managed fallback now writes the advised 16:9 inside the 96x64 box (96x54) instead of the preset's ratio; the test expected the old size. A new Data test renders a turned, straightened 9:16 project with a sepia look through the job engine and checks that every output (fixed box and source-sized) has the size the job was routed with, which P5 could not check before P1's RenderGeometry was in. Co-Authored-By: Claude Opus 5.5 --- .../Processing/RenderJobTests.cs | 29 +++++++++++++++++++ .../Storage/ProcessingModuleTests.cs | 3 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/Chronos.Data.Tests/Processing/RenderJobTests.cs b/tests/Chronos.Data.Tests/Processing/RenderJobTests.cs index e68c4aa5..61ce9e73 100644 --- a/tests/Chronos.Data.Tests/Processing/RenderJobTests.cs +++ b/tests/Chronos.Data.Tests/Processing/RenderJobTests.cs @@ -637,6 +637,35 @@ public sealed class RenderJobTests(TestContext context) Assert.Equal(2, ProcessingJobs.RequiredFormat(portrait, png with { Batch = ["4k-h264"] }, 6000, 4000)); } + /// + /// Owner review 1, phase 4, end to end: a turned, portrait project with a look renders each output at the size its job + /// was routed with (the fixed box adapted to 9:16, the source-sized output on the turned view) and records it so. + /// + [Test] + public async Task ATurnedPortraitProjectRendersAtTheSizeItsJobWasRoutedWith() + { + await using var fx = await ProcessingFixture.CreateAsync(context); + var sequence = await fx.AddAsync(Scene()); + await fx.StartEngineAsync(); + + var settings = new ProjectSettings + { + Camera = new CameraSettings { Aspect = new Auto().WithManual("9:16"), Rotate = 90, Straighten = 2 }, + Look = new LookSettings { Filter = "sepia", Strength = 0.6 }, + }; + var request = ProcessingJobs.Render(sequence, Mjpeg with { Batch = ["png-sequence"] }, 96, 64, settings); + var routed = ProcessingJobs.ReadRender(request.ParametersJson).Parameters; + Assert.Equal((54, 96, 2), (routed.Width, routed.Height, routed.RequiredSettingsFormat)); + await fx.WaitForAsync((await fx.EnqueueAsync(request)).Id, JobState.Done); + + var renders = (await fx.Db.Renders.ListBySequenceAsync(sequence.Id, fx.Ct)).OrderBy(r => r.OutputPath, StringComparer.Ordinal).ToList(); + Assert.SequenceEqual([(54, 96), (54, 96)], renders.Select(r => (r.Width, r.Height))); + var pngs = Directory.GetFiles(Path.Combine(fx.Folder(sequence).Exports, "clip-PNG")).Order().ToList(); + Assert.Equal(Frames, pngs.Count); + using var decoded = DecoderFactory.CreateServer().Decode(new DecodeRequest(pngs[^1])); + Assert.Equal((54, 96), (Assert.NotNull(decoded).Pixels.Width, decoded.Pixels.Height)); + } + /// Settings of a newer Chronos fail the render with the reason in the user's language, never as an English message. [Test] public async Task AnOverFormatRenderFailsSayingANewerChronosIsNeeded() diff --git a/tests/Chronos.Server.Tests/Storage/ProcessingModuleTests.cs b/tests/Chronos.Server.Tests/Storage/ProcessingModuleTests.cs index daff16a8..63e106cd 100644 --- a/tests/Chronos.Server.Tests/Storage/ProcessingModuleTests.cs +++ b/tests/Chronos.Server.Tests/Storage/ProcessingModuleTests.cs @@ -168,7 +168,8 @@ public sealed class ProcessingModuleTests(TestContext context) var done = await JobApiTests.WaitForAsync(editor, job.Id, "done"); Assert.Equal(JobEngineHost.WorkerId, done.NodeId?.Split('#')[0]); var render = (await server.Database.Renders.ListBySequenceAsync(sequence.Id)).Single(); - Assert.Equal(($"{sequence.Folder}/exports/clip-MJPEG.avi", "Mjpeg", 96, 64), (render.OutputPath, render.Codec, render.Width, render.Height)); + // The analysis advises 16:9, and the chosen proportions win over the 96×64 box (owner review 1, phase 4): 96×54. + Assert.Equal(($"{sequence.Folder}/exports/clip-MJPEG.avi", "Mjpeg", 96, 54), (render.OutputPath, render.Codec, render.Width, render.Height)); Assert.Contains(Loc.L("Export.Log.NoRenderNode", Loc.L("Export.Preset.Custom"), "HEVC", "MJPEG"), done.LogTail); }