hardkoded
hardkoded

Reputation: 21695

Github Actions: Report dotnet test result as annotations

If you run tests using Azure Pipelines you would get some cool results on the checks tabs.

enter image description here

Is there any way to do the same from Github Actions so we don't have to go through the console output?

enter image description here

Upvotes: 8

Views: 4258

Answers (2)

0xced
0xced

Reputation: 26558

You can use the Test Reporter action which provides a nice test report summary.

It supports many languages / frameworks:

.NET / xUnit / NUnit / MSTest
Dart / test
Flutter / test
Java / JUnit
JavaScript / JEST / Mocha

Here's what a report looks like (screenshot from the Test Reporter project): Test results sample

Upvotes: 3

Happypig375
Happypig375

Reputation: 1052

Here is one solution: https://github.com/microsoft/vstest/issues/2370#issuecomment-602233131

GitHub user Tyrrrz made a small proof of concept using GitHub Actions commands. This reports test failures to the GH Actions platform, letting you see them in the Annotations view and navigate to the exact/file that triggered it. This is not exactly the solution to "support colorized output" but may solve the underlying issue that GitHub Actions doesn't show the list of failed tests nicely.

https://github.com/Tyrrrz/GitHubActionsTestLogger https://github.com/Tyrrrz/GitHubActionsTestLogger/runs/525594126?check_suite_focus=true

Upvotes: 8

Related Questions