diff --git a/test/OrchardCore.Tests/CIFact.cs b/test/OrchardCore.Tests/CIFact.cs new file mode 100644 index 00000000000..5c9d24e67b9 --- /dev/null +++ b/test/OrchardCore.Tests/CIFact.cs @@ -0,0 +1,22 @@ +using SystemEnvironment = System.Environment; + +namespace OrchardCore.Tests; + +public class CIFactAttribute : FactAttribute +{ + public override string Skip + { + get + { + // "CI" is defined by GitHub actions + // "BUILD_BUILDID" is defined by Azure DevOps + if (SystemEnvironment.GetEnvironmentVariable("BUILD_BUILDID") == null && + SystemEnvironment.GetEnvironmentVariable("CI") == null) + { + return $"{nameof(CIFactAttribute)} tests are not run locally. To run them locally create a \"CI\" environment variable."; + } + + return null!; + } + } +} diff --git a/test/OrchardCore.Tests/Modules/OrchardCore.Resources/SubResourceIntegrityTests.cs b/test/OrchardCore.Tests/Modules/OrchardCore.Resources/SubResourceIntegrityTests.cs index edd2b1e79e5..9ca6d1d546d 100644 --- a/test/OrchardCore.Tests/Modules/OrchardCore.Resources/SubResourceIntegrityTests.cs +++ b/test/OrchardCore.Tests/Modules/OrchardCore.Resources/SubResourceIntegrityTests.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Tests.Modules.OrchardCore.Resources; public class SubResourceIntegrityTests { - [Fact] + [CIFact] public async Task SavedSubResourceIntegritiesShouldMatchCurrentResources() { // Arrange