fix: Windows test of 1.1.0 — job log local time, Jobs Type column, stale screen tests (1.1.1) (#71)
CI / Build and test (push) Successful in 12m32s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 19s
Release / Build, test and publish (push) Successful in 17m13s
CI / PostgreSQL 16 integration (push) Successful in 9m1s
CI / PostgreSQL 17 integration (push) Successful in 9m30s
CI / Docker image (push) Successful in 49s
Release / Server image (push) Successful in 1m49s
The Windows hands-on test of v1.1.0 on the development PC (#70). - The App suite runs whole on Windows again. Five stale screen smoke tests are brought up to date. - The Reorganize capture gives the sample sidecars. - Forget fits in the Bulgarian certificate rows. - The job log shows local time. It stays UTC on disk, and lines are dated backwards from the job's end. - The Jobs and Server › Jobs Type column takes a 1* share (90–170 px). - Builds without a tag say 1.1.1. Closes #70 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
No files matched your search
@@ -100,7 +100,7 @@ public sealed class ArchiveScreenSmokeTests
|
||||
Assert.NotEmpty(reorganize.Rows, "the dry run lists the sequences that change");
|
||||
Assert.Null(reorganize.ErrorText);
|
||||
await app.ExpectAsync<ArchiveView>("archive-reorganize");
|
||||
Assert.True(ButtonFor(app, reorganize.ApplyCommand).IsEnabled, "Apply follows the dry run");
|
||||
Assert.True(ButtonFor(app, reorganize.ApplyCommand).IsEnabled, "Apply follows the dry run: " + reorganize.ApplyToolTip);
|
||||
Assert.True(ButtonFor(app, reorganize.CloseCommand).IsDefault, "Enter takes the safe way out");
|
||||
foreach (var box in app.FindAll<CheckBox>().Where(c => c.IsVisible)) Assert.NotNull(box.ToolTip, "every template switch says what it does");
|
||||
AssertNoErrorShown(app);
|
||||
@@ -149,7 +149,7 @@ public sealed class ArchiveScreenSmokeTests
|
||||
// The dialogs' templates exist once they are laid out: render first, then look inside.
|
||||
await ArchiveScenes.ShowAsync(app.Shell, "rebuild");
|
||||
await app.ExpectAsync<ArchiveView>("archive-rebuild-ar");
|
||||
Assert.Equal(FlowDirection.LeftToRight, TextFor(app, archive.SelectedArchive!.RootPath).FlowDirection, "the archive folder reads left to right");
|
||||
Assert.Equal(FlowDirection.LeftToRight, TextFor(app, AppEnvironment.Shown(archive.SelectedArchive!.RootPath)).FlowDirection, "the archive folder reads left to right");
|
||||
|
||||
await ArchiveScenes.ShowAsync(app.Shell, "reorganize");
|
||||
var reorganize = Assert.NotNull(archive.Dialog as ReorganizeDialogViewModel);
|
||||
@@ -299,7 +299,14 @@ public sealed class ArchiveScreenSmokeTests
|
||||
UiLanguage.Apply(language);
|
||||
window.UpdateLayout();
|
||||
await window.Dispatcher.InvokeAsync(() => { }, System.Windows.Threading.DispatcherPriority.ApplicationIdle);
|
||||
// A language switch builds the tree's rows again; they may arrive a few layout passes later.
|
||||
var years = TreeItems(app).Where(i => ((ArchiveTreeRowViewModel)i.DataContext).IsYear).ToList();
|
||||
for (var until = DateTime.UtcNow.AddSeconds(TestTiming.Budget(5)); years.Count == 0 && DateTime.UtcNow < until;)
|
||||
{
|
||||
await Task.Delay(50);
|
||||
window.UpdateLayout();
|
||||
years = TreeItems(app).Where(i => ((ArchiveTreeRowViewModel)i.DataContext).IsYear).ToList();
|
||||
}
|
||||
Assert.True(years.Count > 0, $"{language}: year rows show");
|
||||
foreach (var item in years)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using Chronos.App.Jobs;
|
||||
using Chronos.Testing;
|
||||
|
||||
namespace Chronos.App.Tests.Jobs;
|
||||
|
||||
/// <summary>The job log stores UTC times; the Jobs table shows them in local time like the rows (#70).</summary>
|
||||
public sealed class JobLogTimesTests
|
||||
{
|
||||
private static readonly TimeZoneInfo Rome = TimeZoneInfo.CreateCustomTimeZone("Test+1", TimeSpan.FromHours(1), "Test+1", "Test+1");
|
||||
|
||||
[Test]
|
||||
public void LeadingTimesTurnLocal()
|
||||
{
|
||||
var finished = new DateTimeOffset(2026, 11, 16, 12, 40, 0, TimeSpan.Zero);
|
||||
var tail = "12:35:04 Copying photos\n12:36:10 Done\nno time here";
|
||||
Assert.Equal("13:35:04 Copying photos\n13:36:10 Done\nno time here", JobLogTimes.ToLocal(tail, finished, Rome));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ALineBeforeMidnightBelongsToTheDayBefore()
|
||||
{
|
||||
// Finished at 00:10 UTC on the 17th: 23:58 is the 16th's, and both days convert with their own offset.
|
||||
var finished = new DateTimeOffset(2026, 11, 17, 0, 10, 0, TimeSpan.Zero);
|
||||
var zone = TimeZoneInfo.CreateCustomTimeZone("Test-5", TimeSpan.FromHours(-5), "Test-5", "Test-5");
|
||||
Assert.Equal("18:58:00 Start\n19:05:00 End", JobLogTimes.ToLocal("23:58:00 Start\n00:05:00 End", finished, zone));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ARunLongerThanADayDatesEachLineAcrossTheClockChange()
|
||||
{
|
||||
// Rome leaves summer time on 2026-10-25 at 01:00 UTC. A run from the 24th 10:00 UTC to the 25th 11:00 UTC: its
|
||||
// first line is a day and more before the end, still in summer time (12:00), its last after the change (12:00).
|
||||
var rome = TimeZoneInfo.FindSystemTimeZoneById("Europe/Rome");
|
||||
var finished = new DateTimeOffset(2026, 10, 25, 12, 0, 0, TimeSpan.Zero);
|
||||
var tail = "10:00:00 Start\n23:00:00 Midway\n11:00:00 End";
|
||||
Assert.Equal("12:00:00 Start\n01:00:00 Midway\n12:00:00 End", JobLogTimes.ToLocal(tail, finished, rome));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TextWithoutTimesStaysAsItIs()
|
||||
{
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
Assert.Equal(string.Empty, JobLogTimes.ToLocal(string.Empty, now, Rome));
|
||||
Assert.Equal("1:2:3 short", JobLogTimes.ToLocal("1:2:3 short", now, Rome));
|
||||
Assert.Equal("12:35:04", JobLogTimes.ToLocal("12:35:04", now, Rome));
|
||||
Assert.Equal("ab:cd:ef text", JobLogTimes.ToLocal("ab:cd:ef text", now, Rome));
|
||||
}
|
||||
}
|
||||
@@ -129,6 +129,47 @@ public sealed class JobsScreenSmokeTests
|
||||
}
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// In a 1440 px window (a 1920 px screen at 100 %), the Type column shows the Italian kinds whole, the longest
|
||||
/// "Analisi approfondita" included: it was cut at a 0.7* share (#70).
|
||||
/// </summary>
|
||||
[Test]
|
||||
public Task KindsFitTheTypeColumnInItalianAt1440() => ScreenHost.RunAsync(async () =>
|
||||
{
|
||||
await using var app = await ScreenSmokeTests.SampleApp.StartAsync();
|
||||
var shell = app.Shell;
|
||||
await app.Sample.FillAsync();
|
||||
await shell.Jobs.ReloadAsync();
|
||||
shell.Navigate(SectionKey.Jobs);
|
||||
await app.ExpectAsync<JobsView>("jobs");
|
||||
app.Window.Width = 1440;
|
||||
UiLanguage.Apply("it");
|
||||
try
|
||||
{
|
||||
app.Window.UpdateLayout();
|
||||
await app.Window.Dispatcher.InvokeAsync(() => { }, System.Windows.Threading.DispatcherPriority.ApplicationIdle);
|
||||
var items = app.FindAll<ListBoxItem>().Where(i => i.DataContext is JobRowViewModel && i.IsVisible).ToList();
|
||||
Assert.True(items.Count > 3, "several rows are on screen");
|
||||
foreach (var item in items)
|
||||
{
|
||||
var row = (JobRowViewModel)item.DataContext;
|
||||
var kind = Descendants<TextBlock>(item).First(t => t.Text == row.Kind);
|
||||
Assert.True(Needed(kind, kind.Text) <= kind.ActualWidth + 0.5, $"'{row.Kind}' needs {Needed(kind, kind.Text):0.0} px, has {kind.ActualWidth:0.0}");
|
||||
var deep = JobText.Kind(Core.Model.JobKind.DeepAnalyse);
|
||||
Assert.True(Needed(kind, deep) <= kind.ActualWidth + 0.5, $"'{deep}' needs {Needed(kind, deep):0.0} px, has {kind.ActualWidth:0.0}");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
UiLanguage.Apply("en");
|
||||
}
|
||||
});
|
||||
|
||||
/// <summary>The width <paramref name="text"/> takes in <paramref name="cell"/>'s font.</summary>
|
||||
private static double Needed(TextBlock cell, string text) => new FormattedText(text, System.Globalization.CultureInfo.CurrentUICulture, cell.FlowDirection,
|
||||
new Typeface(cell.FontFamily, cell.FontStyle, cell.FontWeight, cell.FontStretch), cell.FontSize, Brushes.Black,
|
||||
VisualTreeHelper.GetDpi(cell).PixelsPerDip).WidthIncludingTrailingWhitespace;
|
||||
|
||||
/// <summary>The left and right edges of an element in window coordinates, whichever way the window reads.</summary>
|
||||
private static (double Left, double Right) Span(FrameworkElement element, Window window)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,8 @@ public sealed class ServerScreenSmokeTests
|
||||
var sunrise = Row(table, "Sunrise over Superga");
|
||||
Assert.Equal(SyncStatus.ProxiesOnly, sunrise.Entry.Status);
|
||||
Assert.Equal(Loc.L("Server.Sync.Proxies"), sunrise.LocalText);
|
||||
Assert.SequenceEqual([SyncAction.OpenWithProxies, SyncAction.DownloadOriginals], Actions(sunrise));
|
||||
// A server without projects: open with proxies; the workspace is offered, disabled with the reason (phase 5b).
|
||||
Assert.SequenceEqual([SyncAction.OpenWithProxies, SyncAction.DownloadOriginals, SyncAction.OpenInWorkspace], Actions(sunrise));
|
||||
Assert.SequenceEqual([SyncAction.Upload], Actions(Row(table, "Clouds over the Langhe")));
|
||||
var conflict = Row(table, "Holy grail · Monviso");
|
||||
Assert.Equal(StatusKind.Warning, conflict.StateKind);
|
||||
|
||||
@@ -83,7 +83,7 @@ public sealed class ScreenSmokeTests
|
||||
Assert.Equal(0, shell.Library.SelectionCount);
|
||||
|
||||
shell.Navigate(SectionKey.Jobs);
|
||||
Assert.Equal(9, shell.Jobs.Rows.Count);
|
||||
Assert.Equal(10, shell.Jobs.Rows.Count, string.Join(" | ", shell.Jobs.Rows.Select(r => r.AccessibleName)));
|
||||
Assert.True(shell.IsJobActive, "running jobs show in the job bar");
|
||||
shell.Jobs.Rows[0].IsExpanded = true;
|
||||
await app.ExpectAsync<JobsView>("jobs");
|
||||
|
||||
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |