From 76a240de31cd9605c3c28ae75335a1305c8b33f0 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 12 Oct 2021 21:29:03 -0700 Subject: [PATCH] Drop .NET Core 2.1 tests, add .NET 6 tests, and upgrade test dependencies --- .config/dotnet-tools.json | 4 ++-- .github/workflows/ci.yml | 4 ---- src/LettuceEncrypt/LettuceEncrypt.csproj | 4 ---- test/LettuceEncrypt.Azure.UnitTests/AzureKeyVaultTests.cs | 4 ---- .../ConfigurationBindingTests.cs | 2 -- .../LettuceEncrypt.Azure.UnitTests.csproj | 7 +++---- test/LettuceEncrypt.UnitTests/ConfigurationBindingTests.cs | 2 -- .../DefaultCertificateAuthorityConfigurationTests.cs | 4 ---- test/LettuceEncrypt.UnitTests/DeveloperCertLoaderTests.cs | 4 ---- .../FileSystemAccountStoreTests.cs | 4 ---- .../FileSystemCertificateRepoTests.cs | 4 ---- .../HttpChallengeResponseMiddlewareTests.cs | 4 ---- .../LettuceEncrypt.UnitTests.csproj | 7 +++---- 13 files changed, 8 insertions(+), 46 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index c31beb8d..7f35d2cb 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,10 +3,10 @@ "isRoot": true, "tools": { "dotnet-format": { - "version": "5.1.225507", + "version": "5.1.250801", "commands": [ "dotnet-format" ] } } -} \ No newline at end of file +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b26a99d..dfc624fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,10 +38,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup .NET Core 2.1 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "2.1.x" - name: Setup .NET Core 3.1 uses: actions/setup-dotnet@v1 with: diff --git a/src/LettuceEncrypt/LettuceEncrypt.csproj b/src/LettuceEncrypt/LettuceEncrypt.csproj index 74be0047..42067594 100644 --- a/src/LettuceEncrypt/LettuceEncrypt.csproj +++ b/src/LettuceEncrypt/LettuceEncrypt.csproj @@ -26,10 +26,6 @@ This only works with Kestrel, which is the default server configuration for ASP. - - - - diff --git a/test/LettuceEncrypt.Azure.UnitTests/AzureKeyVaultTests.cs b/test/LettuceEncrypt.Azure.UnitTests/AzureKeyVaultTests.cs index 6c0de3f7..581af034 100644 --- a/test/LettuceEncrypt.Azure.UnitTests/AzureKeyVaultTests.cs +++ b/test/LettuceEncrypt.Azure.UnitTests/AzureKeyVaultTests.cs @@ -16,10 +16,6 @@ using Moq; using Xunit; -#if NETCOREAPP2_1 -using IHostEnvironment = Microsoft.Extensions.Hosting.IHostingEnvironment; -#endif - namespace LettuceEncrypt.Azure.UnitTests { public class AzureKeyVaultTests diff --git a/test/LettuceEncrypt.Azure.UnitTests/ConfigurationBindingTests.cs b/test/LettuceEncrypt.Azure.UnitTests/ConfigurationBindingTests.cs index 85bd5d6d..01b6434f 100644 --- a/test/LettuceEncrypt.Azure.UnitTests/ConfigurationBindingTests.cs +++ b/test/LettuceEncrypt.Azure.UnitTests/ConfigurationBindingTests.cs @@ -61,7 +61,6 @@ public void ExplicitOptionsWin() Assert.Equal("https://incode/", options.Value.AzureKeyVaultEndpoint); } -#if NETCOREAPP3_1_OR_GREATER [Theory] [InlineData(null)] [InlineData("")] @@ -79,6 +78,5 @@ public void ItValidatesEndpointIsUrl(string invalidEndpoint) var ex = Assert.Throws(() => options.Value); Assert.Contains(nameof(AzureKeyVaultLettuceEncryptOptions.AzureKeyVaultEndpoint), ex.Message); } -#endif } } diff --git a/test/LettuceEncrypt.Azure.UnitTests/LettuceEncrypt.Azure.UnitTests.csproj b/test/LettuceEncrypt.Azure.UnitTests/LettuceEncrypt.Azure.UnitTests.csproj index ba640a28..df1f9c27 100644 --- a/test/LettuceEncrypt.Azure.UnitTests/LettuceEncrypt.Azure.UnitTests.csproj +++ b/test/LettuceEncrypt.Azure.UnitTests/LettuceEncrypt.Azure.UnitTests.csproj @@ -1,17 +1,16 @@ - net5.0;netcoreapp3.1;netcoreapp2.1 + net6.0;net5.0;netcoreapp3.1 - + - + - diff --git a/test/LettuceEncrypt.UnitTests/ConfigurationBindingTests.cs b/test/LettuceEncrypt.UnitTests/ConfigurationBindingTests.cs index 61575994..ede7f382 100644 --- a/test/LettuceEncrypt.UnitTests/ConfigurationBindingTests.cs +++ b/test/LettuceEncrypt.UnitTests/ConfigurationBindingTests.cs @@ -66,7 +66,6 @@ public void ItParsesEnumValuesForChallengeType(string value, Acme.ChallengeType Assert.Equal(challengeType, options.AllowedChallengeTypes); } -#if NETCOREAPP3_1_OR_GREATER [Fact] public void DoesNotSupportWildcardDomains() { @@ -76,7 +75,6 @@ public void DoesNotSupportWildcardDomains() ["LettuceEncrypt:DomainNames:0"] = "*.natemcmaster.com", })); } -#endif private LettuceEncryptOptions ParseOptions(Dictionary input) { diff --git a/test/LettuceEncrypt.UnitTests/DefaultCertificateAuthorityConfigurationTests.cs b/test/LettuceEncrypt.UnitTests/DefaultCertificateAuthorityConfigurationTests.cs index 73b491e8..63d737a3 100644 --- a/test/LettuceEncrypt.UnitTests/DefaultCertificateAuthorityConfigurationTests.cs +++ b/test/LettuceEncrypt.UnitTests/DefaultCertificateAuthorityConfigurationTests.cs @@ -9,10 +9,6 @@ using Microsoft.Extensions.Options; using Xunit; -#if NETCOREAPP2_1 -using Environments = Microsoft.Extensions.Hosting.EnvironmentName; -#endif - namespace LettuceEncrypt.UnitTests { public class DefaultCertificateAuthorityConfigurationTests diff --git a/test/LettuceEncrypt.UnitTests/DeveloperCertLoaderTests.cs b/test/LettuceEncrypt.UnitTests/DeveloperCertLoaderTests.cs index a8f150a1..b8b66221 100644 --- a/test/LettuceEncrypt.UnitTests/DeveloperCertLoaderTests.cs +++ b/test/LettuceEncrypt.UnitTests/DeveloperCertLoaderTests.cs @@ -8,10 +8,6 @@ using Microsoft.Extensions.Logging.Abstractions; using Moq; using Xunit; -#if NETCOREAPP2_1 -using IHostEnvironment = Microsoft.Extensions.Hosting.IHostingEnvironment; - -#endif namespace LettuceEncrypt.UnitTests diff --git a/test/LettuceEncrypt.UnitTests/FileSystemAccountStoreTests.cs b/test/LettuceEncrypt.UnitTests/FileSystemAccountStoreTests.cs index 27c1b614..7f335fe4 100644 --- a/test/LettuceEncrypt.UnitTests/FileSystemAccountStoreTests.cs +++ b/test/LettuceEncrypt.UnitTests/FileSystemAccountStoreTests.cs @@ -15,10 +15,6 @@ using Moq; using Xunit; -#if NETCOREAPP2_1 -using IHostEnvironment = Microsoft.Extensions.Hosting.IHostingEnvironment; -#endif - namespace LettuceEncrypt.UnitTests { public class FileSystemAccountStoreTests : IDisposable diff --git a/test/LettuceEncrypt.UnitTests/FileSystemCertificateRepoTests.cs b/test/LettuceEncrypt.UnitTests/FileSystemCertificateRepoTests.cs index 4863c1cc..04de9b31 100644 --- a/test/LettuceEncrypt.UnitTests/FileSystemCertificateRepoTests.cs +++ b/test/LettuceEncrypt.UnitTests/FileSystemCertificateRepoTests.cs @@ -12,10 +12,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting.Internal; using Xunit; -#if NETCOREAPP2_1 -using IHostEnvironment = Microsoft.Extensions.Hosting.IHostingEnvironment; - -#endif namespace LettuceEncrypt.UnitTests { diff --git a/test/LettuceEncrypt.UnitTests/HttpChallengeResponseMiddlewareTests.cs b/test/LettuceEncrypt.UnitTests/HttpChallengeResponseMiddlewareTests.cs index 57072752..9652d70d 100644 --- a/test/LettuceEncrypt.UnitTests/HttpChallengeResponseMiddlewareTests.cs +++ b/test/LettuceEncrypt.UnitTests/HttpChallengeResponseMiddlewareTests.cs @@ -10,10 +10,6 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using Moq; using Xunit; -#if NETCOREAPP2_1 -using ApplicationBuilder = Microsoft.AspNetCore.Builder.Internal.ApplicationBuilder; - -#endif namespace LettuceEncrypt.UnitTests { diff --git a/test/LettuceEncrypt.UnitTests/LettuceEncrypt.UnitTests.csproj b/test/LettuceEncrypt.UnitTests/LettuceEncrypt.UnitTests.csproj index 549f751d..72724c48 100644 --- a/test/LettuceEncrypt.UnitTests/LettuceEncrypt.UnitTests.csproj +++ b/test/LettuceEncrypt.UnitTests/LettuceEncrypt.UnitTests.csproj @@ -1,17 +1,16 @@ - net5.0;netcoreapp3.1;netcoreapp2.1 + net6.0;net5.0;netcoreapp3.1 - + - + -