diff --git a/.appveyor.yml b/.appveyor.yml index 087e395a67..81a1c5689a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,7 +4,7 @@ environment: global: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1" # Used by the dotnet SDK prior to v3.0 DOTNET_CLI_TELEMETRY_OPTOUT: "1" - PREVIEW_DOTNET: "5.0.100-preview.8.20417.9" + PREVIEW_DOTNET: "5.0.100" branches: only: - main diff --git a/.travis.yml b/.travis.yml index a59341755e..0bc7d2b5e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: script: - curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 2.1.507 - curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 3.1.200 - - curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 5.0.100-preview.8.20417.9 + - curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 5.0.100 - export PATH=$PATH:~/.dotnet - dotnet --info - ./build.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index ad668478e3..0d6126e915 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Add a list of .NET Frameworks installed when available. (#531) @lucas-zimerman * Parse Mono and IL2CPP stacktraces for Unity and Xamarin (#578) @bruno-garcia * Update TFMs and dependency min version (#580) @bruno-garcia +* Run all tests on .NET 5 (#583) @bruno-garcia ## 3.0.0-alpha.4 diff --git a/test/Sentry.AspNetCore.Grpc.Tests/Sentry.AspNetCore.Grpc.Tests.csproj b/test/Sentry.AspNetCore.Grpc.Tests/Sentry.AspNetCore.Grpc.Tests.csproj index 252de8d5cb..564d5c1d34 100644 --- a/test/Sentry.AspNetCore.Grpc.Tests/Sentry.AspNetCore.Grpc.Tests.csproj +++ b/test/Sentry.AspNetCore.Grpc.Tests/Sentry.AspNetCore.Grpc.Tests.csproj @@ -1,15 +1,12 @@ - netcoreapp3.1 + net5.0;netcoreapp3.1 - - - diff --git a/test/Sentry.AspNetCore.Tests/Sentry.AspNetCore.Tests.csproj b/test/Sentry.AspNetCore.Tests/Sentry.AspNetCore.Tests.csproj index 57f4f55371..b9d58a0ca2 100644 --- a/test/Sentry.AspNetCore.Tests/Sentry.AspNetCore.Tests.csproj +++ b/test/Sentry.AspNetCore.Tests/Sentry.AspNetCore.Tests.csproj @@ -6,7 +6,7 @@ - netcoreapp3.1;netcoreapp2.1 + net5.0;netcoreapp3.1;netcoreapp2.1 @@ -16,8 +16,8 @@ - - + + diff --git a/test/Sentry.Extensions.Logging.Tests/MelDiagnosticLoggerTests.cs b/test/Sentry.Extensions.Logging.Tests/MelDiagnosticLoggerTests.cs index c34afa43d3..dcc94ae3b6 100644 --- a/test/Sentry.Extensions.Logging.Tests/MelDiagnosticLoggerTests.cs +++ b/test/Sentry.Extensions.Logging.Tests/MelDiagnosticLoggerTests.cs @@ -42,9 +42,9 @@ public void LogLevel_HigherLevel_IsEnabled() Assert.False(sut.IsEnabled(SentryLevel.Info)); } - // .NET Core 3 has turned FormattedLogValues into an internal readonly struct + // .NET Core 3 (and hence .NET 5) has turned FormattedLogValues into an internal readonly struct // and now we can't match that with NSubstitute -#if !NETCOREAPP3_1 +#if NETCOREAPP2_1 || NET461 [Fact] public void Log_PassedThrough() { diff --git a/test/Sentry.Extensions.Logging.Tests/Sentry.Extensions.Logging.Tests.csproj b/test/Sentry.Extensions.Logging.Tests/Sentry.Extensions.Logging.Tests.csproj index ba1b2485ec..3b2f6df6de 100644 --- a/test/Sentry.Extensions.Logging.Tests/Sentry.Extensions.Logging.Tests.csproj +++ b/test/Sentry.Extensions.Logging.Tests/Sentry.Extensions.Logging.Tests.csproj @@ -1,17 +1,20 @@  - netcoreapp3.1;netcoreapp2.1;net461 + net5.0;netcoreapp3.1;netcoreapp2.1;net461 - + - - + + + + + diff --git a/test/Sentry.Log4Net.Tests/Sentry.Log4Net.Tests.csproj b/test/Sentry.Log4Net.Tests/Sentry.Log4Net.Tests.csproj index 74b859746a..3035d93186 100644 --- a/test/Sentry.Log4Net.Tests/Sentry.Log4Net.Tests.csproj +++ b/test/Sentry.Log4Net.Tests/Sentry.Log4Net.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;netcoreapp2.1;net461 + net5.0;netcoreapp3.1;netcoreapp2.1;net461 diff --git a/test/Sentry.NLog.Tests/Sentry.NLog.Tests.csproj b/test/Sentry.NLog.Tests/Sentry.NLog.Tests.csproj index 55f52310a9..edb5fa7e45 100644 --- a/test/Sentry.NLog.Tests/Sentry.NLog.Tests.csproj +++ b/test/Sentry.NLog.Tests/Sentry.NLog.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;netcoreapp2.1;net461 + net5.0;netcoreapp3.1;netcoreapp2.1;net461 diff --git a/test/Sentry.Serilog.Tests/Sentry.Serilog.Tests.csproj b/test/Sentry.Serilog.Tests/Sentry.Serilog.Tests.csproj index ac9261934c..d9280e97bc 100644 --- a/test/Sentry.Serilog.Tests/Sentry.Serilog.Tests.csproj +++ b/test/Sentry.Serilog.Tests/Sentry.Serilog.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;netcoreapp2.1;net461 + net5.0;netcoreapp3.1;netcoreapp2.1;net461 diff --git a/test/Sentry.Testing/HttpClientExtensions.cs b/test/Sentry.Testing/HttpClientExtensions.cs index 0f08906b7d..0675bb80f2 100644 --- a/test/Sentry.Testing/HttpClientExtensions.cs +++ b/test/Sentry.Testing/HttpClientExtensions.cs @@ -31,12 +31,6 @@ public static async Task CloneAsync(this HttpRequestMessage { var clone = new HttpRequestMessage(source.Method, source.RequestUri) {Version = source.Version}; - // Properties - foreach (var prop in source.Properties) - { - clone.Properties.Add(prop); - } - // Headers foreach (var (key, value) in source.Headers) { diff --git a/test/Sentry.Testing/Sentry.Testing.csproj b/test/Sentry.Testing/Sentry.Testing.csproj index 737e639988..094c334f03 100644 --- a/test/Sentry.Testing/Sentry.Testing.csproj +++ b/test/Sentry.Testing/Sentry.Testing.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;netcoreapp2.1;net461 + net5.0;netcoreapp3.1;netcoreapp2.1;net461 false @@ -16,4 +16,8 @@ + + + + diff --git a/test/Sentry.Tests/Internals/Http/HttpTransportTests.cs b/test/Sentry.Tests/Internals/Http/HttpTransportTests.cs index ce5c1af73e..a81e74f3c4 100644 --- a/test/Sentry.Tests/Internals/Http/HttpTransportTests.cs +++ b/test/Sentry.Tests/Internals/Http/HttpTransportTests.cs @@ -39,6 +39,9 @@ public async Task SendEnvelopeAsync_CancellationToken_PassedToClient() new SentryEvent(eventId: SentryResponses.ResponseId) ); +#if NET5_0 + await Assert.ThrowsAsync(() => httpTransport.SendEnvelopeAsync(envelope, token).AsTask()); +#else // Act await httpTransport.SendEnvelopeAsync(envelope, token); @@ -46,6 +49,7 @@ public async Task SendEnvelopeAsync_CancellationToken_PassedToClient() await httpHandler .Received(1) .VerifiableSendAsync(Arg.Any(), Arg.Is(c => c.IsCancellationRequested)); +#endif } [Fact] diff --git a/test/Sentry.Tests/Sentry.Tests.csproj b/test/Sentry.Tests/Sentry.Tests.csproj index 6fdb7a784a..107e39711e 100644 --- a/test/Sentry.Tests/Sentry.Tests.csproj +++ b/test/Sentry.Tests/Sentry.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;netcoreapp2.1;net461 + net5.0;netcoreapp3.1;netcoreapp2.1;net461 @@ -9,11 +9,7 @@ - - NETCOREAPP;$(AdditionalConstants) - - - + NETFX;$(AdditionalConstants)