feat: single setup, mass-pass progress, per-server homes, Desktop shares its library (owner review 5, v1.1.0) (#68)
CI / Build and test (push) Successful in 11m36s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 12s
Release / Build, test and publish (push) Successful in 14m56s
CI / PostgreSQL 16 integration (push) Successful in 10m11s
CI / PostgreSQL 17 integration (push) Successful in 10m15s
CI / Docker image (push) Successful in 45s
Release / Server image (push) Successful in 4m55s
CI / Build and test (push) Successful in 11m36s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 12s
Release / Build, test and publish (push) Successful in 14m56s
CI / PostgreSQL 16 integration (push) Successful in 10m11s
CI / PostgreSQL 17 integration (push) Successful in 10m15s
CI / Docker image (push) Successful in 45s
Release / Server image (push) Successful in 4m55s
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #68.
This commit is contained in:
1 parent
988068ee8e
commit
20d64af4a4
793 files changed
+23882
-2096
No files matched your search
@@ -0,0 +1,82 @@
|
||||
using Chronos.Core.Diagnostics.Synthetic;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Archiving.Jobs;
|
||||
using Chronos.Data.Jobs;
|
||||
using Chronos.Data.Processing;
|
||||
using Chronos.Data.Tests.Jobs;
|
||||
using Chronos.Testing;
|
||||
|
||||
namespace Chronos.Data.Tests.Processing;
|
||||
|
||||
/// <summary>What the analysis and render jobs say they are doing (owner review 5, #65), as the job's progress detail.</summary>
|
||||
[Category("processing")]
|
||||
public sealed class ProcessingProgressDetailTests(TestContext context)
|
||||
{
|
||||
private const int Frames = 12;
|
||||
|
||||
private static SyntheticSequence Scene() => SyntheticSequence.Create(new SyntheticSequenceOptions { FrameCount = Frames, StartEv = 0.5, EndEv = -0.5 });
|
||||
|
||||
private static async Task<(DetailRecorder Recorder, JobEngine Engine)> StartAsync(ProcessingFixture fx)
|
||||
{
|
||||
var recorder = new DetailRecorder();
|
||||
var engine = recorder.Engine(fx.Db, fx.Processing.CreateJobHandlers());
|
||||
await engine.StartAsync(fx.Ct);
|
||||
return (recorder, engine);
|
||||
}
|
||||
|
||||
private static async Task<Guid> RunAsync(ProcessingFixture fx, JobEngine engine, ArchiveJobRequest request)
|
||||
{
|
||||
var job = await engine.EnqueueAsync(request, cancellationToken: fx.Ct);
|
||||
await fx.WaitForAsync(job.Id, JobState.Done);
|
||||
return job.Id;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AnAnalysisNamesEachSequenceAndADeepOneCountsItsPhotos()
|
||||
{
|
||||
await using var fx = await ProcessingFixture.CreateAsync(context);
|
||||
var first = await fx.AddAsync(Scene(), "First");
|
||||
var second = await fx.AddAsync(Scene(), "Second");
|
||||
var (recorder, engine) = await StartAsync(fx);
|
||||
await using var _ = engine;
|
||||
|
||||
var light = await RunAsync(fx, engine, ProcessingJobs.LightAnalysis([first.Id, second.Id], "both"));
|
||||
var details = recorder.Details(light);
|
||||
Assert.True(details.All(d => d.Step == JobStep.Analyse && d.PartUnit == JobPartUnit.Sequence && d.Parts == 2 && d.ItemTotal == 0), string.Join("; ", details));
|
||||
Assert.SequenceEqual([(1, first.DisplayTitle), (2, second.DisplayTitle)], details.Select(d => (d.Part, d.Item!)));
|
||||
|
||||
var deep = await RunAsync(fx, engine, ProcessingJobs.DeepAnalysis([first.Id]));
|
||||
details = recorder.Details(deep);
|
||||
Assert.True(details.All(d => d.Step == JobStep.Analyse && d.Item == first.DisplayTitle && d.Part == 1 && d.Parts == 1 && d.ItemTotal == Frames),
|
||||
string.Join("; ", details));
|
||||
Assert.True(details.Max(d => d.ItemDone) > 0, string.Join("; ", details));
|
||||
Assert.True(details.All(d => d.ItemDone <= Frames));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ARenderPreparesEncodesThenVerifiesWithoutTextInTheDetail()
|
||||
{
|
||||
await using var fx = await ProcessingFixture.CreateAsync(context);
|
||||
var sequence = await fx.AddAsync(Scene());
|
||||
var (recorder, engine) = await StartAsync(fx);
|
||||
await using var _ = engine;
|
||||
var mjpeg = new ExportSettings
|
||||
{
|
||||
Preset = new Auto<string>().WithManual("mjpeg-avi"),
|
||||
Overrides = new ExportOverrides { Width = 96, Height = 64 },
|
||||
NameTemplate = "clip-{codec}",
|
||||
};
|
||||
|
||||
var id = await RunAsync(fx, engine, ProcessingJobs.Render(sequence, mjpeg, 96, 64));
|
||||
Assert.SequenceEqual([JobStep.Analyse, JobStep.Encode, JobStep.Verify], recorder.Steps(id));
|
||||
var details = recorder.Details(id);
|
||||
Assert.Equal(new JobDetail(JobStep.Analyse, sequence.DisplayTitle), details[0]);
|
||||
var encode = details.Where(d => d.Step == JobStep.Encode).ToList();
|
||||
Assert.True(encode.All(d => d.Item == sequence.DisplayTitle && d.Parts == 0 && d.ItemDone <= d.ItemTotal), string.Join("; ", encode));
|
||||
Assert.True(encode.Max(d => d.ItemDone) > 0, string.Join("; ", encode));
|
||||
Assert.Equal(new JobDetail(JobStep.Verify, "clip-MJPEG.avi"), details[^1]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user