Skip to content

Commit

Permalink
Pull in output printing bug fix from core
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed May 10, 2024
1 parent e205244 commit 45eb783
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<NSubstituteVersion>5.1.0</NSubstituteVersion>
<TunnelVisionLabsReferenceAssemblyAnnotatorVersion>1.0.0-alpha.160</TunnelVisionLabsReferenceAssemblyAnnotatorVersion>
<XunitAnalyzersVersion>1.14.0-pre.3</XunitAnalyzersVersion>
<XunitVersion>2.8.1-pre.10</XunitVersion>
<XunitVersion>2.8.1-pre.11</XunitVersion>
</PropertyGroup>

</Project>
12 changes: 1 addition & 11 deletions src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public VsExecutionSink(
ITestExecutionRecorder recorder,
LoggerHelper logger,
Dictionary<string, TestCase> testCasesMap,
Func<bool> cancelledThunk,
bool showLiveOutput)
Func<bool> cancelledThunk)
{
this.innerSink = innerSink;
this.recorder = recorder;
Expand All @@ -46,9 +45,6 @@ public VsExecutionSink(
Execution.TestMethodCleanupFailureEvent += HandleTestMethodCleanupFailure;
Execution.TestPassedEvent += HandleTestPassed;
Execution.TestSkippedEvent += HandleTestSkipped;

if (showLiveOutput)
Execution.TestOutputEvent += HandleTestOutput;
}

public ExecutionSummary ExecutionSummary { get; private set; }
Expand Down Expand Up @@ -131,12 +127,6 @@ void HandleTestFailed(MessageHandlerArgs<ITestFailed> args)
HandleCancellation(args);
}

void HandleTestOutput(MessageHandlerArgs<ITestOutput> args)
{
var testOutput = args.Message;
logger.Log(" {0} [OUTPUT] {1}", testOutput.Test.DisplayName, testOutput.Output.TrimEnd());
}

void HandleTestPassed(MessageHandlerArgs<ITestPassed> args)
{
var testPassed = args.Message;
Expand Down
2 changes: 1 addition & 1 deletion src/xunit.runner.visualstudio/VsTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ void RunTestsInAssembly(

reporterMessageHandler.OnMessage(new TestAssemblyExecutionStarting(runInfo.Assembly, executionOptions));

using var vsExecutionSink = new VsExecutionSink(reporterMessageHandler, frameworkHandle, logger, testCasesMap, () => cancelled, executionOptions.GetShowLiveOutputOrDefault());
using var vsExecutionSink = new VsExecutionSink(reporterMessageHandler, frameworkHandle, logger, testCasesMap, () => cancelled);
var executionSinkOptions = new ExecutionSinkOptions
{
DiagnosticMessageSink = diagnosticsSinkRemote,
Expand Down
6 changes: 2 additions & 4 deletions test/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "https://xunit.net/schema/v2.5/xunit.runner.schema.json",
"diagnosticMessages": true,
"methodDisplay": "classAndMethod",
"parallelizeAssembly": true
"$schema": "https://xunit.net/schema/v2.8.1/xunit.runner.schema.json",
"diagnosticMessages": true
}

0 comments on commit 45eb783

Please sign in to comment.