Routing sizes render jobs from the resolved preset, and the node wait applies the same routing as the claim, so a re-routed job neither keeps a stale size nor waits for a node that will never take it. Settings an older server cannot read stay on this side for the remote editor, archive sync and workspace push, and the reason is shown where it applies. A turn on one side and a framing on the other merge as one conflict. Orientation and framing fixes: an out-of-range crop turns with the content it shows, the aspect text transposes exactly, the Rotation row counts turns as shown on screen, and Reset framing undoes the orientation press by press, so keyframes and aspect stay on their content. The advisor places the horizon in the view as shown. A look at zero strength is cleared and no longer reaches the motion vectors. Preview changes: the middle button pans, a press inside a box with no slack pans while zoomed, the selected box shows a ring, and screen readers hear when the crop value changes. Tooltips in en and it updated; stale translations of changed tooltips removed so they fall back to English. Test changes: the pinned hash is OS-independent, and the tautological encoder and warning assertions became real checks. Added a non-screen test of the Straighten slider binding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
4.1 KiB
C#
79 lines
4.1 KiB
C#
using Chronos.Core.Render.Diagnostics;
|
|
using Chronos.Core.Video;
|
|
using Chronos.Testing;
|
|
|
|
namespace Chronos.Core.Tests.Render;
|
|
|
|
public sealed class SelfTestTests
|
|
{
|
|
private static readonly string[] Groups = ["plan", "export", "select", "codec", "render", "proc", "robust"];
|
|
|
|
private readonly TestContext _context;
|
|
|
|
public SelfTestTests(TestContext context) => _context = context;
|
|
|
|
[Test]
|
|
public void ChecksAreUniqueAndGrouped()
|
|
{
|
|
Assert.GreaterOrEqual(SelfTest.Checks.Count, 60);
|
|
Assert.Equal(SelfTest.Checks.Count, SelfTest.Checks.Select(c => c.Id).Distinct().Count());
|
|
Assert.True(SelfTest.Checks.All(c => Groups.Contains(c.Group) && c.Id.StartsWith(c.Group + ".", StringComparison.Ordinal) && c.Description.Length > 0));
|
|
Assert.True(Groups.All(g => SelfTest.Checks.Any(c => c.Group == g)));
|
|
}
|
|
|
|
[Test]
|
|
public async Task FastGroupsPassAndCleanUp()
|
|
{
|
|
var work = _context.CreateTempDirectory();
|
|
var reported = new List<SelfTestResult>();
|
|
var results = await SelfTest.RunAsync(new SelfTestOptions { WorkDirectory = work, Filters = ["plan.", "export.", "select.", "codec."] },
|
|
new RenderFixture.Sink<SelfTestResult>(reported.Add), _context.Cancellation);
|
|
foreach (var r in results.Where(r => r.Outcome != SelfTestOutcome.Passed)) _context.Log($"{r.Id}: {r.Outcome} {r.Detail}");
|
|
Assert.Equal(SelfTest.Checks.Count(c => c.Group is "plan" or "export" or "select" or "codec"), results.Count);
|
|
Assert.True(results.All(r => r.Outcome == SelfTestOutcome.Passed));
|
|
Assert.SequenceEqual(results.Select(r => r.Id), reported.Select(r => r.Id));
|
|
Assert.Empty(Directory.GetFileSystemEntries(work));
|
|
}
|
|
|
|
[Test]
|
|
public async Task RenderGroupPassesWithManagedEncoders()
|
|
{
|
|
var results = await SelfTest.RunAsync(new SelfTestOptions { WorkDirectory = _context.CreateTempDirectory(), Filters = ["render."] }, cancellationToken: _context.Cancellation);
|
|
foreach (var r in results) _context.Log($"{r.Id}: {r.Outcome} {r.Detail}");
|
|
Assert.Equal(SelfTestOutcome.Skipped, results.Single(r => r.Id == "render.mp4").Outcome);
|
|
Assert.True(results.Where(r => r.Id != "render.mp4").All(r => r.Outcome == SelfTestOutcome.Passed));
|
|
}
|
|
|
|
[Test]
|
|
public async Task GeometryChecksPass()
|
|
{
|
|
string[] ids = ["proc.orient", "proc.straighten", "proc.portrait", "proc.aspect", "proc.crop", "proc.look"];
|
|
var results = await SelfTest.RunAsync(new SelfTestOptions { WorkDirectory = _context.CreateTempDirectory(), Filters = ids }, cancellationToken: _context.Cancellation);
|
|
foreach (var r in results) _context.Log($"{r.Id}: {r.Outcome} {r.Detail}");
|
|
Assert.SequenceEqual(ids.Order(StringComparer.Ordinal), results.Select(r => r.Id).Order(StringComparer.Ordinal));
|
|
Assert.True(results.All(r => r.Outcome == SelfTestOutcome.Passed));
|
|
}
|
|
|
|
[Test]
|
|
public async Task FailuresAreReportedNotThrown()
|
|
{
|
|
// An "MP4 encoder" that writes nothing: the inspection of its missing file must fail the check, not the run.
|
|
var fake = new CapturingEncoderProvider("fake", new EncoderCapability(VideoCodec.H264, "Fake H.264", true, 4096, 4096, false));
|
|
var results = await SelfTest.RunAsync(new SelfTestOptions { WorkDirectory = _context.CreateTempDirectory(), Filters = ["render.mp4"], PlatformEncoders = [fake] },
|
|
cancellationToken: _context.Cancellation);
|
|
var result = results.Single();
|
|
Assert.Equal(SelfTestOutcome.Failed, result.Outcome);
|
|
Assert.Contains("FileNotFoundException", result.Detail);
|
|
}
|
|
|
|
[Test]
|
|
public async Task CancellationStopsTheRunAndCleansUp()
|
|
{
|
|
var work = _context.CreateTempDirectory();
|
|
using var cts = CancellationTokenSource.CreateLinkedTokenSource(_context.Cancellation);
|
|
var progress = new RenderFixture.Sink<SelfTestResult>(_ => cts.Cancel());
|
|
await Assert.ThrowsAsync<OperationCanceledException>(() => SelfTest.RunAsync(new SelfTestOptions { WorkDirectory = work, Filters = ["plan."] }, progress, cts.Token));
|
|
Assert.Empty(Directory.GetFileSystemEntries(work));
|
|
}
|
|
}
|