mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-23 17:25:03 +01:00
* Skip unit tests when Docker is not running in Linux container mode using DockerIsRunningInLinuxContainerModeFact * IgnoreOnContinuousIntegrationFact
22 lines
810 B
C#
22 lines
810 B
C#
// Copyright © WireMock.Net
|
|
|
|
using System;
|
|
using Xunit;
|
|
|
|
namespace WireMock.Net.Tests.Facts;
|
|
|
|
public sealed class IgnoreOnContinuousIntegrationFact : FactAttribute
|
|
{
|
|
private const string SkipReason = "Ignore when run via CI/CD";
|
|
private static readonly bool IsContinuousIntegrationAzure = bool.TryParse(Environment.GetEnvironmentVariable("TF_BUILD"), out var isTF) && isTF;
|
|
private static readonly bool IsContinuousIntegrationGithub = bool.TryParse(Environment.GetEnvironmentVariable("GITHUB_ACTIONS"), out var isGH) && isGH;
|
|
private static readonly bool IsContinuousIntegration = IsContinuousIntegrationAzure || IsContinuousIntegrationGithub;
|
|
|
|
public IgnoreOnContinuousIntegrationFact()
|
|
{
|
|
if (IsContinuousIntegration)
|
|
{
|
|
Skip = SkipReason;
|
|
}
|
|
}
|
|
} |