Skip to content

Commit

Permalink
Ignore AotCompatibilityTests on ADO (#2992)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmprieur authored Nov 9, 2024
1 parent 8dc81e6 commit dafdc0d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public AotCompatibilityTests(ITestOutputHelper testOutputHelper)
///
/// You can also 'dotnet publish' the 'Microsoft.IdentityModel.AotCompatibility.TestApp.csproj' as well to get the errors.
/// </summary>
[Fact]
[IgnoreOnAzureDevopsFact]
public void EnsureAotCompatibility()
{
string testAppPath = Path.Combine("..", "..", "..", "..", "Microsoft.IdentityModel.AotCompatibility.TestApp");
Expand Down
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;
}
}
}

0 comments on commit dafdc0d

Please sign in to comment.