Skip to content

Commit

Permalink
I think it works finally
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Sep 11, 2024
1 parent 49bb9ac commit f6b3610
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ private void EmitTestSummaryMarkdown(INukeBuild build, AbsolutePath summary)
{
// ReSharper disable once SuspiciousTypeConversion.Global
if (build.ExecutionPlan.Any(z => z.Name == nameof(IHaveTestTarget.Test))
&& build is IHaveTestArtifacts testResultReports
&& testResultReports.TestResultsDirectory.GlobFiles("**/*.trx") is { Count: > 0, } results)
&& build is IHaveTestArtifacts { TestResultsDirectory: {} testResultsDirectory }
&& testResultsDirectory.GlobFiles("**/*.trx") is { Count: > 0, } results)
{
var relativeResults = results.GetRelativePaths(testResultReports.TestResultsDirectory);
var pathArgs = results
.GetRelativePaths(testResultsDirectory)
.Aggregate(new Arguments(), (arguments, path) => arguments.Add("--inputs {value}", $"File={path}"));

if (!DotNetTool.IsInstalled("liquidtestreports.cli"))
{
Log.Warning("liquidtestreports.cli is not installed, skipping test summary generation");
Expand All @@ -41,10 +44,10 @@ private void EmitTestSummaryMarkdown(INukeBuild build, AbsolutePath summary)
_ = DotNetTasks.DotNet(
new Arguments()
.Add("liquid")
.Add("--inputs {0}", relativeResults.Select(z => $"File={z}"), ' ')
.Concatenate(pathArgs)
.Add("--output-file {0}", summary)
.RenderForExecution(),
testResultReports.TestResultsDirectory,
testResultsDirectory,
logOutput: true /* temp */,
logInvocation: build.Verbosity == Verbosity.Verbose
);
Expand Down

0 comments on commit f6b3610

Please sign in to comment.