Skip to content

Commit

Permalink
Merge the two summary layouts into one
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed May 19, 2023
1 parent 7ed6f2e commit 6e0b37a
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 268 deletions.
2 changes: 0 additions & 2 deletions GitHubActionsTestLogger.Tests/InitializationSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public void I_can_use_the_logger_with_a_custom_configuration()
{
["annotations.titleFormat"] = "TitleFormat",
["annotations.messageFormat"] = "MessageFormat",
["summary.compactLayout"] = "true",
["summary.includePassedTests"] = "true",
["summary.includeSkippedTests"] = "true"
};
Expand All @@ -46,7 +45,6 @@ public void I_can_use_the_logger_with_a_custom_configuration()
logger.Context.Should().NotBeNull();
logger.Context?.Options.AnnotationTitleFormat.Should().Be("TitleFormat");
logger.Context?.Options.AnnotationMessageFormat.Should().Be("MessageFormat");
logger.Context?.Options.SummaryCompactLayout.Should().BeTrue();
logger.Context?.Options.SummaryIncludePassedTests.Should().BeTrue();
logger.Context?.Options.SummaryIncludeSkippedTests.Should().BeTrue();
}
Expand Down
45 changes: 0 additions & 45 deletions GitHubActionsTestLogger/Templates/MarkdownRazorTemplate.cs

This file was deleted.

12 changes: 0 additions & 12 deletions GitHubActionsTestLogger/Templates/TestSummaryContext.cs

This file was deleted.

11 changes: 0 additions & 11 deletions GitHubActionsTestLogger/Templates/TestSummaryDetailsTemplate.cs

This file was deleted.

134 changes: 0 additions & 134 deletions GitHubActionsTestLogger/Templates/TestSummaryDetailsTemplate.cshtml

This file was deleted.

11 changes: 0 additions & 11 deletions GitHubActionsTestLogger/Templates/TestSummaryTemplate.cs

This file was deleted.

37 changes: 0 additions & 37 deletions GitHubActionsTestLogger/Templates/TestSummaryTemplate.cshtml

This file was deleted.

5 changes: 2 additions & 3 deletions GitHubActionsTestLogger/TestLoggerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.IO;
using System.Linq;
using System.Text;
using GitHubActionsTestLogger.Templates;
using GitHubActionsTestLogger.Utils.Extensions;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
Expand Down Expand Up @@ -90,7 +89,7 @@ public void HandleTestRunComplete(TestRunCompleteEventArgs args)
{
lock (_lock)
{
var context = new TestSummaryContext
var template = new TestSummaryTemplate
{
Options = Options,

Expand All @@ -105,7 +104,7 @@ public void HandleTestRunComplete(TestRunCompleteEventArgs args)
TestRunResult = new TestRunResult(_testResults, args.ElapsedTimeInRunningTests)
};

_github.CreateSummary(new TestSummaryTemplate(context).Render());
_github.CreateSummary(template.Render());
}
}
}
6 changes: 0 additions & 6 deletions GitHubActionsTestLogger/TestLoggerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ public partial class TestLoggerOptions

public string AnnotationMessageFormat { get; init; } = "$error";

public bool SummaryCompactLayout { get; init; }

public bool SummaryIncludePassedTests { get; init; }

public bool SummaryIncludeSkippedTests { get; init; }
Expand All @@ -30,10 +28,6 @@ public partial class TestLoggerOptions
parameters.GetValueOrDefault("annotations.messageFormat") ??
Default.AnnotationMessageFormat,

SummaryCompactLayout =
parameters.GetValueOrDefault("summary.compactLayout")?.Pipe(bool.Parse) ??
Default.SummaryCompactLayout,

SummaryIncludePassedTests =
parameters.GetValueOrDefault("summary.includePassedTests")?.Pipe(bool.Parse) ??
Default.SummaryIncludePassedTests,
Expand Down
Loading

0 comments on commit 6e0b37a

Please sign in to comment.