-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the post processing extension feature (#3324)
Implement the post processing extension feature
- Loading branch information
1 parent
fdca8e9
commit fd3c7e2
Showing
63 changed files
with
1,169 additions
and
37 deletions.
There are no files selected for viewing
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
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
14 changes: 14 additions & 0 deletions
14
src/Microsoft.TestPlatform.Common/Interfaces/Engine/IArtifactProcessingManager.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,14 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System.Threading.Tasks; | ||
|
||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine; | ||
|
||
internal interface IArtifactProcessingManager | ||
{ | ||
void CollectArtifacts(TestRunCompleteEventArgs testRunCompleteEventArgs, string runSettingsXml); | ||
Task PostProcessArtifactsAsync(); | ||
} |
42 changes: 42 additions & 0 deletions
42
src/Microsoft.TestPlatform.CoreUtilities/FeatureFlag/FeatureFlag.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,42 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
#if !NETSTANDARD1_0 | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.Utilities; | ||
|
||
internal partial class FeatureFlag : IFeatureFlag | ||
{ | ||
private static readonly Dictionary<string, bool> FeatureFlags = new(); | ||
|
||
private const string Prefix = "VSTEST_FEATURE_"; | ||
|
||
public static IFeatureFlag Instance => new FeatureFlag(); | ||
|
||
static FeatureFlag() | ||
{ | ||
FeatureFlags.Add(ARTIFACTS_POSTPROCESSING, false); | ||
FeatureFlags.Add(ARTIFACTS_POSTPROCESSING_SDK_KEEP_OLD_UX, false); | ||
} | ||
|
||
// Added for artifact porst-processing, it enable/disable the post processing. | ||
// Added in 17.2-preview 7.0-preview | ||
public static string ARTIFACTS_POSTPROCESSING = Prefix + "ARTIFACTS_POSTPROCESSING"; | ||
|
||
// Added for artifact porst-processing, it will show old output for dotnet sdk scenario. | ||
// It can be useful if we need to restore old UX in case users are parsing the console output. | ||
// Added in 17.2-preview 7.0-preview | ||
public static string ARTIFACTS_POSTPROCESSING_SDK_KEEP_OLD_UX = Prefix + "ARTIFACTS_POSTPROCESSING_SDK_KEEP_OLD_UX"; | ||
|
||
// For now we're checking env var. | ||
// We could add it also to some section inside the runsettings. | ||
public bool IsEnabled(string featureName) => | ||
int.TryParse(Environment.GetEnvironmentVariable(featureName), out int enabled) ? | ||
enabled == 1 : | ||
FeatureFlags.TryGetValue(featureName, out bool isEnabled) && isEnabled; | ||
} | ||
|
||
#endif |
9 changes: 9 additions & 0 deletions
9
src/Microsoft.TestPlatform.CoreUtilities/FeatureFlag/IFeatureFlag.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,9 @@ | ||
// 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.Utilities; | ||
|
||
internal interface IFeatureFlag | ||
{ | ||
bool IsEnabled(string featureName); | ||
} |
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
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
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.