From 44c5fdc3ae0707b244307fb28c0260a904631bdb Mon Sep 17 00:00:00 2001 From: Jakub Chocholowicz Date: Wed, 10 Jun 2020 20:27:42 +0200 Subject: [PATCH] acceptance tests green --- .../MultiTestRunsFinalizationEventsHandler.cs | 2 +- .../MultiTestRunsFinalizationManager.cs | 6 +----- .../CodeCoverageDataAttachmentsHandler.cs | 8 ++++++-- .../TranslationLayerTests/FinalizeMultiTestRunsTests.cs | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.TestPlatform.Client/MultiTestRunsFinalization/MultiTestRunsFinalizationEventsHandler.cs b/src/Microsoft.TestPlatform.Client/MultiTestRunsFinalization/MultiTestRunsFinalizationEventsHandler.cs index 67dcab7c2c..e9111ad903 100644 --- a/src/Microsoft.TestPlatform.Client/MultiTestRunsFinalization/MultiTestRunsFinalizationEventsHandler.cs +++ b/src/Microsoft.TestPlatform.Client/MultiTestRunsFinalization/MultiTestRunsFinalizationEventsHandler.cs @@ -46,7 +46,7 @@ public void HandleMultiTestRunsFinalizationComplete(ICollection a var payload = new MultiTestRunsFinalizationCompletePayload() { - Attachments = null + Attachments = attachments }; // Send run complete to translation layer diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunsFinalization/MultiTestRunsFinalizationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunsFinalization/MultiTestRunsFinalizationManager.cs index 036077669b..77ba2d5331 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunsFinalization/MultiTestRunsFinalizationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunsFinalization/MultiTestRunsFinalizationManager.cs @@ -53,11 +53,7 @@ public async Task FinalizeMultiTestRunsAsync(ICollection attachme var completedTask = await Task.WhenAny(task, taskCompletionSource.Task); - if (completedTask == task) - { - eventHandler.HandleMultiTestRunsFinalizationComplete(attachments); - } - else + if (completedTask != task) { eventHandler.HandleMultiTestRunsFinalizationComplete(null); } diff --git a/src/Microsoft.TestPlatform.Utilities/CodeCoverageDataAttachmentsHandler.cs b/src/Microsoft.TestPlatform.Utilities/CodeCoverageDataAttachmentsHandler.cs index 822dded6a0..f2ceeac7f2 100644 --- a/src/Microsoft.TestPlatform.Utilities/CodeCoverageDataAttachmentsHandler.cs +++ b/src/Microsoft.TestPlatform.Utilities/CodeCoverageDataAttachmentsHandler.cs @@ -89,14 +89,18 @@ private string MergeCodeCoverageFiles(IList files, CancellationToken can } catch (OperationCanceledException) { - if (EqtTrace.IsInfoEnabled) + if (EqtTrace.IsWarningEnabled) { - EqtTrace.Info("CodeCoverageDataCollectorAttachmentsHandler: operation was cancelled."); + EqtTrace.Warning("CodeCoverageDataCollectorAttachmentsHandler: operation was cancelled."); } throw; } catch (ObjectDisposedException) { + if (EqtTrace.IsWarningEnabled) + { + EqtTrace.Warning("CodeCoverageDataCollectorAttachmentsHandler: object disposed."); + } throw; } catch (Exception ex) diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/FinalizeMultiTestRunsTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/FinalizeMultiTestRunsTests.cs index bb26430a8b..f2093e7b7f 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/FinalizeMultiTestRunsTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/FinalizeMultiTestRunsTests.cs @@ -56,6 +56,7 @@ public void FinalizeMultiTestRuns(RunnerInfo runnerInfo) this.vstestConsoleWrapper.FinalizeMultiTestRuns(runEventHandler.Attachments, multiTestRunsFinalizationEventHandler); // Assert + multiTestRunsFinalizationEventHandler.EnsureSuccess(); Assert.AreEqual(testEnvironment.RunnerFramework.Equals(IntegrationTestBase.DesktopRunnerFramework) ? 1 : 2, this.multiTestRunsFinalizationEventHandler.Attachments.Count); }