Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="8.0.1" />
<PackageVersion Include="CSharpier.MsBuild" Version="1.2.1" />
<PackageVersion Include="CSharpier.MsBuild" Version="1.2.6" />
<PackageVersion Include="FluentAssertions" Version="8.9.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="18.3.0" />
<PackageVersion Include="Microsoft.Testing.Platform" Version="2.1.0" />
<PackageVersion Include="MSTest" Version="4.1.0" />
<PackageVersion Include="PolyShim" Version="2.7.0" />
<PackageVersion Include="PolyShim" Version="2.9.0" />
<PackageVersion Include="PowerKit" Version="0.0.0-a.4" />
<PackageVersion Include="RazorBlade" Version="0.11.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.Testing.Platform" />
<PackageReference Include="PowerKit" PrivateAssets="all" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
</ItemGroup>
Expand Down
18 changes: 9 additions & 9 deletions GitHubActionsTestLogger.Tests/MtpAnnotationSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using System.Threading.Tasks;
using FluentAssertions;
using GitHubActionsTestLogger.Tests.Mtp;
using GitHubActionsTestLogger.Tests.Utils;
using Microsoft.Testing.Platform.Builder;
using PowerKit;
using Xunit;
using Xunit.Abstractions;

Expand All @@ -16,7 +16,7 @@ public class MtpAnnotationSpecs(ITestOutputHelper testOutput)
public async Task I_can_use_the_logger_to_produce_annotations_for_failed_tests()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var commandWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -58,7 +58,7 @@ public async Task I_can_use_the_logger_to_produce_annotations_for_failed_tests()
public async Task I_can_use_the_logger_to_produce_annotations_that_include_source_information_extracted_from_exceptions()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var commandWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -112,7 +112,7 @@ at CliWrap.Tests.CancellationSpecs.I_can_execute_a_command_with_buffering_and_ca
public async Task I_can_use_the_logger_to_produce_annotations_that_include_source_information_extracted_from_async_exceptions()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var commandWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -170,7 +170,7 @@ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotifi
public async Task I_can_use_the_logger_to_produce_annotations_that_include_the_test_name()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var commandWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -206,7 +206,7 @@ public async Task I_can_use_the_logger_to_produce_annotations_that_include_the_t
public async Task I_can_use_the_logger_to_produce_annotations_that_include_the_error_message()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var commandWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -246,7 +246,7 @@ public async Task I_can_use_the_logger_to_produce_annotations_that_include_the_e
public async Task I_can_use_the_logger_to_produce_annotations_that_include_the_error_stacktrace()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var commandWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -287,7 +287,7 @@ public async Task I_can_use_the_logger_to_produce_annotations_that_include_the_e
public async Task I_can_use_the_logger_to_produce_annotations_that_include_the_target_framework_version()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var commandWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -326,7 +326,7 @@ public async Task I_can_use_the_logger_to_produce_annotations_that_include_the_t
public async Task I_can_use_the_logger_to_produce_annotations_that_include_line_breaks()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var commandWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down
4 changes: 2 additions & 2 deletions GitHubActionsTestLogger.Tests/MtpInitializationSpecs.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using GitHubActionsTestLogger.Tests.Mtp;
using GitHubActionsTestLogger.Tests.Utils;
using Microsoft.Testing.Platform.Builder;
using PowerKit;
using Xunit;

namespace GitHubActionsTestLogger.Tests;
Expand All @@ -12,7 +12,7 @@ public class MtpInitializationSpecs
public async Task I_can_use_the_logger_with_the_default_configuration()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();

var builder = await TestApplication.CreateBuilderAsync([
"--results-directory",
Expand Down
21 changes: 11 additions & 10 deletions GitHubActionsTestLogger.Tests/MtpSummarySpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
using System.Threading.Tasks;
using FluentAssertions;
using GitHubActionsTestLogger.Tests.Mtp;
using GitHubActionsTestLogger.Tests.Utils;
using GitHubActionsTestLogger.Tests.Utils.Extensions;
using Microsoft.Testing.Platform.Builder;
using PowerKit;
using PowerKit.Extensions;
using Xunit;
using Xunit.Abstractions;

Expand All @@ -18,7 +19,7 @@ public class MtpSummarySpecs(ITestOutputHelper testOutput)
public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_the_test_suite_name()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var summaryWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -47,7 +48,7 @@ public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_the_te
public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_the_list_of_failed_tests()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var summaryWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -99,7 +100,7 @@ public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_the_li
public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_the_list_of_passed_tests()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var summaryWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -141,7 +142,7 @@ public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_the_li
public async Task I_can_use_the_logger_to_produce_a_summary_that_does_not_include_the_list_of_passed_tests()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var summaryWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -184,7 +185,7 @@ public async Task I_can_use_the_logger_to_produce_a_summary_that_does_not_includ
public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_the_list_of_skipped_tests()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var summaryWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -226,7 +227,7 @@ public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_the_li
public async Task I_can_use_the_logger_to_produce_a_summary_that_does_not_include_the_list_of_skipped_tests()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var summaryWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -269,7 +270,7 @@ public async Task I_can_use_the_logger_to_produce_a_summary_that_does_not_includ
public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_empty_test_runs()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var summaryWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -297,7 +298,7 @@ public async Task I_can_use_the_logger_to_produce_a_summary_that_includes_empty_
public async Task I_can_use_the_logger_to_produce_a_summary_that_does_not_include_empty_test_runs()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
await using var summaryWriter = new StringWriter();

var builder = await TestApplication.CreateBuilderAsync([
Expand Down Expand Up @@ -326,7 +327,7 @@ public async Task I_can_use_the_logger_to_produce_a_summary_that_does_not_includ
public async Task I_can_try_to_use_the_logger_to_produce_a_summary_when_the_output_file_is_nearly_full_and_get_a_truncated_summary()
{
// Arrange
using var testResultsDir = TempDir.Create();
using var testResultsDir = TempDirectory.Create();
using var summaryFile = TempFile.Create();

const int prefillSize = 1024 * 1024 - 250;
Expand Down
38 changes: 0 additions & 38 deletions GitHubActionsTestLogger.Tests/Utils/Extensions/FileExtensions.cs

This file was deleted.

36 changes: 0 additions & 36 deletions GitHubActionsTestLogger.Tests/Utils/TempDir.cs

This file was deleted.

37 changes: 0 additions & 37 deletions GitHubActionsTestLogger.Tests/Utils/TempFile.cs

This file was deleted.

3 changes: 2 additions & 1 deletion GitHubActionsTestLogger.Tests/VsTestSummarySpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
using System.Text;
using System.Threading.Tasks;
using FluentAssertions;
using GitHubActionsTestLogger.Tests.Utils;
using GitHubActionsTestLogger.Tests.Utils.Extensions;
using GitHubActionsTestLogger.Tests.VsTest;
using PowerKit;
using PowerKit.Extensions;
using Xunit;
using Xunit.Abstractions;
using TestOutcome = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome;
Expand Down
2 changes: 1 addition & 1 deletion GitHubActionsTestLogger/GitHub/GitHubEnvironment.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.IO;
using GitHubActionsTestLogger.Utils.Extensions;
using PowerKit.Extensions;

namespace GitHubActionsTestLogger.GitHub;

Expand Down
5 changes: 3 additions & 2 deletions GitHubActionsTestLogger/GitHub/GitHubWorkflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;
using GitHubActionsTestLogger.Utils;
using GitHubActionsTestLogger.Utils.Extensions;
using PowerKit.Extensions;

namespace GitHubActionsTestLogger.GitHub;

Expand Down Expand Up @@ -171,5 +171,6 @@ internal partial class GitHubWorkflow
// and employs retry logic to handle potential race conditions.
GitHubEnvironment
.SummaryFilePath?.Pipe(f => new ContentionTolerantWriteFileStream(f, FileMode.Append))
.Pipe(s => new StreamWriter(s)) ?? TextWriter.Null;
.Pipe(s => new StreamWriter(s))
?? TextWriter.Null;
}
1 change: 1 addition & 0 deletions GitHubActionsTestLogger/GitHubActionsTestLogger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
/>
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" PrivateAssets="all" />
<PackageReference Include="PolyShim" PrivateAssets="all" />
<PackageReference Include="PowerKit" PrivateAssets="all" />
<PackageReference Include="RazorBlade" ExcludeAssets="compile;runtime" PrivateAssets="all" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions GitHubActionsTestLogger/MtpLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.Testing.Platform.Extensions.Messages;
using Microsoft.Testing.Platform.Extensions.TestHost;
using Microsoft.Testing.Platform.Services;
using PowerKit.Extensions;

namespace GitHubActionsTestLogger;

Expand Down
1 change: 1 addition & 0 deletions GitHubActionsTestLogger/MtpLoggerOptionsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Testing.Platform.CommandLine;
using Microsoft.Testing.Platform.Extensions;
using Microsoft.Testing.Platform.Extensions.CommandLine;
using PowerKit.Extensions;

namespace GitHubActionsTestLogger;

Expand Down
Loading