From 585bbcd92258d1d1bf4a4dd1648f487640fe7aa1 Mon Sep 17 00:00:00 2001 From: Adam Ralph Date: Thu, 14 Sep 2023 18:32:55 +0200 Subject: [PATCH] remove redundant test suppressions --- MinVerTests.Packages/Cleaning.cs | 5 +-- MinVerTests.Packages/MultipleProjects.cs | 5 +-- MinVerTests.Packages/Repackaging.cs | 5 +-- MinVerTests.Packages/RestrictedFact.cs | 42 ------------------------ MinVerTests.Packages/RestrictedTheory.cs | 42 ------------------------ 5 files changed, 3 insertions(+), 96 deletions(-) delete mode 100644 MinVerTests.Packages/RestrictedFact.cs delete mode 100644 MinVerTests.Packages/RestrictedTheory.cs diff --git a/MinVerTests.Packages/Cleaning.cs b/MinVerTests.Packages/Cleaning.cs index 283b3eaf..79b0e062 100644 --- a/MinVerTests.Packages/Cleaning.cs +++ b/MinVerTests.Packages/Cleaning.cs @@ -10,10 +10,7 @@ namespace MinVerTests.Packages; public static class Cleaning { - [RestrictedTheory( - new[] { "^3.*", "^5.*", "^6.*", }, - new[] { "OSX", }, - "With an SDK less than what's being used to run this test, or on macOS, there is sometimes a 15 minute delay after the `dotnet build` command when multi-targeting")] + [Theory] [InlineData(false)] [InlineData(true)] public static async Task PackagesAreCleaned(bool multiTarget) diff --git a/MinVerTests.Packages/MultipleProjects.cs b/MinVerTests.Packages/MultipleProjects.cs index 1eba2f90..eea2610e 100644 --- a/MinVerTests.Packages/MultipleProjects.cs +++ b/MinVerTests.Packages/MultipleProjects.cs @@ -10,10 +10,7 @@ namespace MinVerTests.Packages; public class MultipleProjects { - [RestrictedFact( - new[] { "^3.*", "^5.*", "^6.*", }, - new[] { "OSX", }, - "With an SDK less than what's being used to run this test, or on macOS, there is sometimes a 15 minute delay after the `dotnet build` command")] + [Fact] public async Task MultipleTagPrefixes() { // arrange diff --git a/MinVerTests.Packages/Repackaging.cs b/MinVerTests.Packages/Repackaging.cs index 43321f9c..da04d2f2 100644 --- a/MinVerTests.Packages/Repackaging.cs +++ b/MinVerTests.Packages/Repackaging.cs @@ -8,10 +8,7 @@ namespace MinVerTests.Packages; public static class Repackaging { - [RestrictedTheory( - new[] { "^3.*", "^5.*", "^6.*", }, - new[] { "OSX", }, - "With an SDK less than what's being used to run this test, or on macOS, there is sometimes a 15 minute delay after the `dotnet build` command when multi-targeting")] + [Theory] [InlineData(false)] [InlineData(true)] public static async Task DoesNotRecreatePackage(bool multiTarget) diff --git a/MinVerTests.Packages/RestrictedFact.cs b/MinVerTests.Packages/RestrictedFact.cs deleted file mode 100644 index dd8aad27..00000000 --- a/MinVerTests.Packages/RestrictedFact.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text.RegularExpressions; -using MinVerTests.Infra; -using Xunit; - -namespace MinVerTests.Packages; - -public sealed class RestrictedFact : FactAttribute -{ - private readonly List typedExcludedOsPlatforms; - - public RestrictedFact(string[] excludedSdkVersionPatterns, string[] excludedOsPlatforms, string reason) => - ( - this.ExcludedSdkVersionPatterns, - this.ExcludedOsPlatforms, - this.typedExcludedOsPlatforms, - this.Reason) = - ( - excludedSdkVersionPatterns, - excludedOsPlatforms, - excludedOsPlatforms.Select(OSPlatform.Create).ToList(), - reason); - - public string[] ExcludedSdkVersionPatterns { get; } - - public string[] ExcludedOsPlatforms { get; } - - public string Reason { get; } - - public override string Skip - { - get => - this.ExcludedSdkVersionPatterns.Any(pattern => Regex.IsMatch(Sdk.Version, pattern)) || - this.typedExcludedOsPlatforms.Any(RuntimeInformation.IsOSPlatform) - ? this.Reason - : base.Skip; - - set => base.Skip = value; - } -} diff --git a/MinVerTests.Packages/RestrictedTheory.cs b/MinVerTests.Packages/RestrictedTheory.cs deleted file mode 100644 index 25014e39..00000000 --- a/MinVerTests.Packages/RestrictedTheory.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text.RegularExpressions; -using MinVerTests.Infra; -using Xunit; - -namespace MinVerTests.Packages; - -public sealed class RestrictedTheory : TheoryAttribute -{ - private readonly List typedExcludedOsPlatforms; - - public RestrictedTheory(string[] excludedSdkVersionPatterns, string[] excludedOsPlatforms, string reason) => - ( - this.ExcludedSdkVersionPatterns, - this.ExcludedOsPlatforms, - this.typedExcludedOsPlatforms, - this.Reason) = - ( - excludedSdkVersionPatterns, - excludedOsPlatforms, - excludedOsPlatforms.Select(OSPlatform.Create).ToList(), - reason); - - public string[] ExcludedSdkVersionPatterns { get; } - - public string[] ExcludedOsPlatforms { get; } - - public string Reason { get; } - - public override string Skip - { - get => - this.ExcludedSdkVersionPatterns.Any(pattern => Regex.IsMatch(Sdk.Version, pattern)) || - this.typedExcludedOsPlatforms.Any(RuntimeInformation.IsOSPlatform) - ? this.Reason - : base.Skip; - - set => base.Skip = value; - } -}