-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding test run attachments processing (#2463)
* v1 * Merging v1 * Rename to MultiTestRunsFinalization * New version * More changes * More changes * Next changes * Fix * test * More changes * Dmc chagnes * next * small changes * compiled * More changes * acceptance tests green * Review comments #1 * Resolving more comments * Tests for design mode client * Tests for events handler * revert not related changes * More changes * Compiling OK, tests OK * Unit tests for manager * More changes * More tests * tests for reqeust sender * more tests * Tests for cancelling * Acceptance tests done * Remove not used stuff * Fix comments * Fix race condition in test * Fix another race condition * Fix converting to xml * fix next test * fix test * Next changes * Review changes #1 * Fixing multi test finalization manager tests * Fixes * Fix last unit test * Fix acceptance tests * Progress feature, compiling + unit tests * acceptance tests changes * More changes * Fixing resources accesability * Fix test * Fix race conditions in acceptance tests * RFC changes merged * Log warning in case of unexpected message id * Fix spelling * Additional comment * Restore some stuff in interfaces * Big renaming * Added processingSettings * Fix naming * Move explanation to <remarks>
- Loading branch information
Showing
67 changed files
with
3,250 additions
and
491 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
...ft.TestPlatform.Client/AttachmentsProcessing/TestRunAttachmentsProcessingEventsHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.Client.TestRunAttachmentsProcessing | ||
{ | ||
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces; | ||
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; | ||
using System.Collections.Generic; | ||
|
||
/// <summary> | ||
/// The test run attachments processing events handler. | ||
/// </summary> | ||
/// | ||
public class TestRunAttachmentsProcessingEventsHandler : ITestRunAttachmentsProcessingEventsHandler | ||
{ | ||
private readonly ICommunicationManager communicationManager; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="TestRunAttachmentsProcessingEventsHandler"/> class. | ||
/// </summary> | ||
/// <param name="communicationManager"> The communication manager. </param> | ||
public TestRunAttachmentsProcessingEventsHandler(ICommunicationManager communicationManager) | ||
{ | ||
this.communicationManager = communicationManager; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void HandleTestRunAttachmentsProcessingComplete(TestRunAttachmentsProcessingCompleteEventArgs attachmentsProcessingCompleteEventArgs, IEnumerable<AttachmentSet> lastChunk) | ||
{ | ||
if (EqtTrace.IsInfoEnabled) | ||
{ | ||
EqtTrace.Info("Test run attachments processing completed."); | ||
} | ||
|
||
var payload = new TestRunAttachmentsProcessingCompletePayload() | ||
{ | ||
AttachmentsProcessingCompleteEventArgs = attachmentsProcessingCompleteEventArgs, | ||
Attachments = lastChunk | ||
}; | ||
|
||
this.communicationManager.SendMessage(MessageType.TestRunAttachmentsProcessingComplete, payload); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void HandleTestRunAttachmentsProcessingProgress(TestRunAttachmentsProcessingProgressEventArgs attachmentsProcessingProgressEventArgs) | ||
{ | ||
var payload = new TestRunAttachmentsProcessingProgressPayload() | ||
{ | ||
AttachmentsProcessingProgressEventArgs = attachmentsProcessingProgressEventArgs, | ||
}; | ||
|
||
this.communicationManager.SendMessage(MessageType.TestRunAttachmentsProcessingProgress, payload); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void HandleProcessedAttachmentsChunk(IEnumerable<AttachmentSet> attachments) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void HandleLogMessage(TestMessageLevel level, string message) | ||
{ | ||
var testMessagePayload = new TestMessagePayload { MessageLevel = level, Message = message }; | ||
this.communicationManager.SendMessage(MessageType.TestMessage, testMessagePayload); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void HandleRawMessage(string rawMessage) | ||
{ | ||
// No-Op | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/Microsoft.TestPlatform.Common/Interfaces/Engine/ITestRunAttachmentsProcessingManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine | ||
{ | ||
/// <summary> | ||
/// Orchestrates test run attachments processing operations. | ||
/// </summary> | ||
internal interface ITestRunAttachmentsProcessingManager | ||
{ | ||
/// <summary> | ||
/// Processes attachments and provides results through handler | ||
/// </summary> | ||
/// <param name="attachments">Collection of attachments</param> | ||
/// <param name="eventHandler">EventHandler for handling test run attachments processing event</param> | ||
/// <param name="cancellationToken">Cancellation token</param> | ||
Task ProcessTestRunAttachmentsAsync(IRequestData requestData, IEnumerable<AttachmentSet> attachments, ITestRunAttachmentsProcessingEventsHandler eventHandler, CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Processes attachments | ||
/// </summary> | ||
/// <param name="attachments">Collection of attachments</param> | ||
/// <param name="cancellationToken">Cancellation token</param> | ||
/// <returns>Collection of attachments.</returns> | ||
Task<Collection<AttachmentSet>> ProcessTestRunAttachmentsAsync(IRequestData requestData, IEnumerable<AttachmentSet> attachments, CancellationToken cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...stPlatform.CommunicationUtilities/Messages/TestRunAttachmentsProcessingCompletePayload.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel | ||
{ | ||
using System.Collections.Generic; | ||
|
||
using Microsoft.VisualStudio.TestPlatform.ObjectModel; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; | ||
|
||
/// <summary> | ||
/// Test run attachments processing complete payload. | ||
/// </summary> | ||
public class TestRunAttachmentsProcessingCompletePayload | ||
{ | ||
/// <summary> | ||
/// Gets or sets the test run attachments processing complete args. | ||
/// </summary> | ||
public TestRunAttachmentsProcessingCompleteEventArgs AttachmentsProcessingCompleteEventArgs { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the attachments. | ||
/// </summary> | ||
public IEnumerable<AttachmentSet> Attachments { get; set; } | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...stPlatform.CommunicationUtilities/Messages/TestRunAttachmentsProcessingProgressPayload.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel | ||
{ | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; | ||
|
||
/// <summary> | ||
/// Test run attachments processing complete payload. | ||
/// </summary> | ||
public class TestRunAttachmentsProcessingProgressPayload | ||
{ | ||
/// <summary> | ||
/// Gets or sets the test run attachments processing complete args. | ||
/// </summary> | ||
public TestRunAttachmentsProcessingProgressEventArgs AttachmentsProcessingProgressEventArgs { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.