From d19cbd270410be7c2d4ed5fce57169b4ce253f0a Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 12 May 2025 21:29:14 +0100 Subject: [PATCH] Show target framework on GitHub report summaries --- TUnit.Engine/Reporters/GitHubReporter.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TUnit.Engine/Reporters/GitHubReporter.cs b/TUnit.Engine/Reporters/GitHubReporter.cs index 10836ea659..acfb27b269 100644 --- a/TUnit.Engine/Reporters/GitHubReporter.cs +++ b/TUnit.Engine/Reporters/GitHubReporter.cs @@ -1,5 +1,6 @@ using System.Collections.Concurrent; using System.Reflection; +using System.Runtime.InteropServices; using System.Text; using Microsoft.Testing.Platform.Extensions; using Microsoft.Testing.Platform.Extensions.Messages; @@ -69,6 +70,12 @@ public Task AfterRunAsync(int exitCode, CancellationToken cancellation) return Task.CompletedTask; } + var targetFramework = Assembly.GetExecutingAssembly() + .GetCustomAttributes() + .SingleOrDefault() + ?.FrameworkDisplayName + ?? RuntimeInformation.FrameworkDescription; + var last = _updates.ToDictionary(x => x.Key, x => x.Value.Last()); var passedCount = last.Count(x => @@ -88,7 +95,7 @@ public Task AfterRunAsync(int exitCode, CancellationToken cancellation) x.Value.TestNode.Properties.AsEnumerable().Any(p => p is InProgressTestNodeStateProperty)).ToArray(); var stringBuilder = new StringBuilder(); - stringBuilder.AppendLine($"### {Assembly.GetEntryAssembly()?.GetName().Name}"); + stringBuilder.AppendLine($"### {Assembly.GetEntryAssembly()?.GetName().Name} ({targetFramework})"); if (!string.IsNullOrEmpty(Filter)) {