Skip to content

Commit

Permalink
add GithubActions test logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Jan 8, 2024
1 parent cbda2a4 commit 198df72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build/scripts/Targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ let private test _ =
let junitOutput = Path.Combine(testOutputPath.FullName, "junit-{assembly}-{framework}-test-results.xml")
let loggerPathArgs = $"LogFilePath=%s{junitOutput}"
let loggerArg = $"--logger:\"junit;%s{loggerPathArgs}\""
let githubActionsLogger = $"--logger:\"GitHubActions:summary.includePassedTests\""
let tfmArgs = if OS.Current = OS.Windows then [] else ["-f"; "net8.0"]
exec {
run "dotnet" (["test"; "-c"; "Release"; loggerArg] @ tfmArgs)
run "dotnet" (
["test"; "-c"; "Release"; loggerArg; githubActionsLogger]
@ tfmArgs
@ ["--"; "RunConfiguration.CollectSourceInformation=true"]
)
}

let private validatePackages _ =
Expand Down
1 change: 1 addition & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<ItemGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(ProjectName), '^(.*)Tests$'))">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />

<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" PrivateAssets="All" />
<PackageReference Include="JunitXml.TestLogger" Version="3.0.114" PrivateAssets="All" />
<PackageReference Include="Nullean.VsTest.Pretty.TestLogger" Version="0.3.0" PrivateAssets="All" />

Expand Down

0 comments on commit 198df72

Please sign in to comment.