feat(app): smoke test reports the .NET runtime it runs on

Release and CI logs then show which runtime a self-contained build
bundles, such as 10.0.14 after a security update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Opus 5.5 committed 2026-10-26 18:12:31 +07:00
1 parent 8465c84f6e
commit b8826f542e
2 files changed
+19 -2

No files matched your search

+4 -2
View File
@@ -18,8 +18,9 @@ namespace HashTool.App.Infrastructure;
/// <summary>
/// <c>CheckHash --smoke-test [--smoke-out result.json] [--expect-version 1.2.0]</c>: starts the app headless, loads every
/// page and language, hashes and verifies a file, and reports the Velopack install state. Used by CI and the release
/// upgrade gate on published (single-file) builds.
/// page and language, hashes and verifies a file, and reports the Velopack install state and the .NET runtime it runs on
/// (the one bundled into self-contained releases). Used by CI and the release upgrade gate on published (single-file)
/// builds.
/// </summary>
public static class SmokeTest
{
@@ -131,6 +132,7 @@ public static class SmokeTest
public int Languages { get; set; }
public string? DataDirectory { get; set; }
public string Culture { get; set; } = CultureInfo.CurrentUICulture.Name;
public string Runtime { get; set; } = Environment.Version.ToString();
public List<string> Errors { get; } = [];
}
}
+15
View File
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Text.Json;
using HashTool.App.Infrastructure;
using HashTool.App.Infrastructure.Logging;
using HashTool.App.ViewModels;
@@ -74,6 +75,20 @@ public sealed class AppCommandLineTests
}
}
public sealed class SmokeReportTests
{
[Fact]
public void Json_NamesTheRuntimeTheAppRunsOn()
{
// Release logs show this value to prove which .NET runtime a self-contained build bundles.
using var json = JsonDocument.Parse(JsonSerializer.Serialize(new SmokeTest.SmokeReport(), SmokeJsonContext.Default.SmokeReport));
Assert.Equal(Environment.Version.ToString(), json.RootElement.GetProperty("runtime").GetString());
Assert.False(json.RootElement.GetProperty("ok").GetBoolean());
Assert.Equal(0, json.RootElement.GetProperty("errors").GetArrayLength());
}
}
public sealed class TextHelperTests
{
[Fact]