From 45eb7838531b6b94ee30c823ea59be48c483da6c Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Fri, 10 May 2024 12:27:21 -0700 Subject: [PATCH] Pull in output printing bug fix from core --- Versions.props | 2 +- .../Sinks/VsExecutionSink.cs | 12 +----------- src/xunit.runner.visualstudio/VsTestRunner.cs | 2 +- test/xunit.runner.json | 6 ++---- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Versions.props b/Versions.props index ee4d2dca..97f8b65d 100644 --- a/Versions.props +++ b/Versions.props @@ -9,7 +9,7 @@ 5.1.0 1.0.0-alpha.160 1.14.0-pre.3 - 2.8.1-pre.10 + 2.8.1-pre.11 diff --git a/src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs b/src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs index 62460a05..07324952 100644 --- a/src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs +++ b/src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs @@ -22,8 +22,7 @@ public VsExecutionSink( ITestExecutionRecorder recorder, LoggerHelper logger, Dictionary testCasesMap, - Func cancelledThunk, - bool showLiveOutput) + Func cancelledThunk) { this.innerSink = innerSink; this.recorder = recorder; @@ -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; } @@ -131,12 +127,6 @@ void HandleTestFailed(MessageHandlerArgs args) HandleCancellation(args); } - void HandleTestOutput(MessageHandlerArgs args) - { - var testOutput = args.Message; - logger.Log(" {0} [OUTPUT] {1}", testOutput.Test.DisplayName, testOutput.Output.TrimEnd()); - } - void HandleTestPassed(MessageHandlerArgs args) { var testPassed = args.Message; diff --git a/src/xunit.runner.visualstudio/VsTestRunner.cs b/src/xunit.runner.visualstudio/VsTestRunner.cs index 903f9668..79bf42d6 100644 --- a/src/xunit.runner.visualstudio/VsTestRunner.cs +++ b/src/xunit.runner.visualstudio/VsTestRunner.cs @@ -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, diff --git a/test/xunit.runner.json b/test/xunit.runner.json index 18ac72b1..5bb2ed0a 100644 --- a/test/xunit.runner.json +++ b/test/xunit.runner.json @@ -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 }