Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
38febc9
Migrate from `vstest` to `Microsoft.Testing.Platform` (#43)
Evangelink Oct 11, 2025
3fe7b21
Format
Tyrrrz Oct 11, 2025
a2b5bd6
wip
Tyrrrz Oct 11, 2025
3cd65bd
Format
Tyrrrz Oct 11, 2025
e42c6a6
asd
Tyrrrz Oct 11, 2025
ad398b2
asd
Tyrrrz Oct 11, 2025
d1c23fa
asd
Tyrrrz Oct 11, 2025
09cb57f
asd
Tyrrrz Oct 12, 2025
4e8b5df
Retrofit support for VSTest via an abstraction layer
Tyrrrz Oct 14, 2025
0fa368d
asd
Tyrrrz Oct 14, 2025
ee603f1
asd
Tyrrrz Oct 14, 2025
0ff54ee
asd
Tyrrrz Oct 14, 2025
b0959a1
asd
Tyrrrz Oct 14, 2025
2a04ac6
asd
Tyrrrz Oct 14, 2025
b375377
asd
Tyrrrz Oct 14, 2025
c3baa5e
asd
Tyrrrz Oct 14, 2025
7e73608
asd
Tyrrrz Oct 14, 2025
1ec70f8
asd
Tyrrrz Oct 14, 2025
baa088e
asd
Tyrrrz Oct 14, 2025
e202765
asd
Tyrrrz Oct 14, 2025
05fc4e5
asd
Tyrrrz Oct 15, 2025
3896f9a
asd
Tyrrrz Oct 15, 2025
4555bd6
asd
Tyrrrz Oct 15, 2025
d34bd30
asd
Tyrrrz Oct 15, 2025
86232b4
asd
Tyrrrz Oct 17, 2025
d418098
asd
Tyrrrz Oct 17, 2025
d680c00
asd
Tyrrrz Oct 17, 2025
1084ae2
MTP demo works
Tyrrrz Oct 22, 2025
af06bef
asd
Tyrrrz Oct 25, 2025
23601ff
asd
Tyrrrz Nov 1, 2025
ed6a032
asd
Tyrrrz Nov 1, 2025
201dcae
asd
Tyrrrz Nov 3, 2025
460ef7b
Upgrade to MTP v2
Tyrrrz Nov 11, 2025
77f8f51
asd
Tyrrrz Nov 11, 2025
12e4e65
Merge
Tyrrrz Nov 11, 2025
ab562cc
asd
Tyrrrz Nov 11, 2025
c367f57
Use peer deps
Tyrrrz Nov 12, 2025
f4582b9
tests
Tyrrrz Nov 14, 2025
80ff683
Async github interactions
Tyrrrz Nov 14, 2025
65a9c48
Add MTP tests
Tyrrrz Nov 17, 2025
3c4f5d5
asd
Tyrrrz Nov 17, 2025
29a8325
asd
Tyrrrz Nov 17, 2025
b6a8c73
Migrate demo projects to MSTest
Tyrrrz Nov 17, 2025
b25749c
asd
Tyrrrz Nov 17, 2025
423a9d9
asd
Tyrrrz Nov 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Async github interactions
  • Loading branch information
Tyrrrz committed Nov 14, 2025
commit 80ff683640fd441efa46bcd6309193a410fac094
25 changes: 13 additions & 12 deletions GitHubActionsTestLogger/GitHub/GitHubWorkflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using GitHubActionsTestLogger.Utils;
using GitHubActionsTestLogger.Utils.Extensions;

Expand All @@ -10,7 +11,7 @@ namespace GitHubActionsTestLogger.GitHub;
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
internal partial class GitHubWorkflow(TextWriter commandWriter, TextWriter summaryWriter)
{
private void InvokeCommand(
private async Task InvokeCommandAsync(
string command,
string message,
IReadOnlyDictionary<string, string>? options = null
Expand All @@ -32,17 +33,17 @@ static string Escape(string value) =>
// to make sure there is no preceding text.
// Preceding text may sometimes appear if the .NET CLI is running with
// ANSI color codes enabled.
commandWriter.WriteLine();
await commandWriter.WriteLineAsync();

commandWriter.WriteLine($"::{command} {formattedOptions}::{Escape(message)}");
await commandWriter.WriteLineAsync($"::{command} {formattedOptions}::{Escape(message)}");

// This newline is just for symmetry
commandWriter.WriteLine();
await commandWriter.WriteLineAsync();

commandWriter.Flush();
await commandWriter.FlushAsync();
}

public void CreateErrorAnnotation(
public async Task CreateErrorAnnotationAsync(
string title,
string message,
string? filePath = null,
Expand All @@ -61,21 +62,21 @@ public void CreateErrorAnnotation(
if (column is not null)
options["col"] = column.Value.ToString();

InvokeCommand("error", message, options);
await InvokeCommandAsync("error", message, options);
}

public void CreateSummary(string content)
public async Task CreateSummaryAsync(string content)
{
// If the summary file already contains HTML content, we need to first add two newlines
// in order to switch GitHub's parser from HTML mode back to markdown mode.
// It's safe to do it unconditionally because, if the file is empty, these newlines
// will simply be ignored.
// https://github.com/Tyrrrz/GitHubActionsTestLogger/issues/22
summaryWriter.WriteLine();
summaryWriter.WriteLine();
await summaryWriter.WriteLineAsync();
await summaryWriter.WriteLineAsync();

summaryWriter.WriteLine(content);
summaryWriter.Flush();
await summaryWriter.WriteLineAsync(content);
await summaryWriter.FlushAsync();
}
}

Expand Down
4 changes: 2 additions & 2 deletions GitHubActionsTestLogger/Reporting/TestReportingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public async Task HandleTestResultAsync(
// Report failed test results to job annotations
if (testResult.Outcome == TestOutcome.Failed)
{
github.CreateErrorAnnotation(
await github.CreateErrorAnnotationAsync(
FormatAnnotationTitle(testResult),
FormatAnnotationMessage(testResult),
testResult.Definition.SourceFilePath,
Expand Down Expand Up @@ -125,7 +125,7 @@ public async Task HandleTestRunEndAsync(
};

// Report the test run to the job summary
github.CreateSummary(await template.RenderAsync(cancellationToken));
await github.CreateSummaryAsync(await template.RenderAsync(cancellationToken));
}
finally
{
Expand Down