-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore AotCompatibilityTests on ADO (#2992)
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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
28 changes: 28 additions & 0 deletions
28
test/Microsoft.IdentityModel.AotCompatibility.Tests/IgnoreOnAzureDevopsFactAttribute.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,28 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Xunit; | ||
|
||
namespace Microsoft.IdentityModel.AotCompatibility.Tests | ||
{ | ||
public sealed class IgnoreOnAzureDevopsFactAttribute : FactAttribute | ||
{ | ||
public IgnoreOnAzureDevopsFactAttribute() | ||
{ | ||
if (!IsRunningOnAzureDevOps()) | ||
{ | ||
return; | ||
} | ||
|
||
Skip = "Ignored on Azure DevOps"; | ||
} | ||
|
||
/// <summary>Determine if runtime is Azure DevOps.</summary> | ||
/// <returns>True if being executed in Azure DevOps, false otherwise.</returns> | ||
public static bool IsRunningOnAzureDevOps() | ||
{ | ||
return Environment.GetEnvironmentVariable("SYSTEM_DEFINITIONID") != null; | ||
} | ||
} | ||
} |