Skip to content

Commit

Permalink
net5 (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-garcia authored Nov 10, 2020
1 parent c3f6c85 commit 234f34c
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.AspNetCore.Server" Version="2.33.1"/>
<PackageReference Include="Grpc.Net.Client" Version="2.33.1"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.9"/>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.2.0"/>
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.2"/>
<PackageReference Include="Grpc.Tools" Version="2.33.1" PrivateAssets="All"/>
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions test/Sentry.AspNetCore.Tests/Sentry.AspNetCore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -16,8 +16,8 @@

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1' OR '$(TargetFramework)' == 'net461'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1' OR '$(TargetFramework)' == 'net461'">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.10" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.Log4Net.Tests/Sentry.Log4Net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.NLog.Tests/Sentry.NLog.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.Serilog.Tests/Sentry.Serilog.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 0 additions & 6 deletions test/Sentry.Testing/HttpClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ public static async Task<HttpRequestMessage> 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)
{
Expand Down
6 changes: 5 additions & 1 deletion test/Sentry.Testing/Sentry.Testing.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
<IsTestProject>false</IsTestProject>
</PropertyGroup>

Expand All @@ -16,4 +16,8 @@
<ItemGroup Condition="$(TargetFramework) == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net5.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.0" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions test/Sentry.Tests/Internals/Http/HttpTransportTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ public async Task SendEnvelopeAsync_CancellationToken_PassedToClient()
new SentryEvent(eventId: SentryResponses.ResponseId)
);

#if NET5_0
await Assert.ThrowsAsync<TaskCanceledException>(() => httpTransport.SendEnvelopeAsync(envelope, token).AsTask());
#else
// Act
await httpTransport.SendEnvelopeAsync(envelope, token);

// Assert
await httpHandler
.Received(1)
.VerifiableSendAsync(Arg.Any<HttpRequestMessage>(), Arg.Is<CancellationToken>(c => c.IsCancellationRequested));
#endif
}

[Fact]
Expand Down
8 changes: 2 additions & 6 deletions test/Sentry.Tests/Sentry.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../../src/Sentry/Sentry.csproj" />
<ProjectReference Include="../Sentry.Testing/Sentry.Testing.csproj" />
</ItemGroup>

<PropertyGroup Condition="$(TargetFramework.StartsWith('netcoreapp'))">
<DefineConstants>NETCOREAPP;$(AdditionalConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
<DefineConstants>NETFX;$(AdditionalConstants)</DefineConstants>
</PropertyGroup>

Expand Down

0 comments on commit 234f34c

Please sign in to comment.