Skip to content

Commit

Permalink
Merge pull request #137 from OctopusDeploy/andrew-w/update-netcoreapp
Browse files Browse the repository at this point in the history
Update netcoreapp to 3.1
  • Loading branch information
andrew-at-octopus authored Aug 30, 2021
2 parents d4ba489 + 1ed1ea1 commit 9b7ce34
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 56 deletions.
6 changes: 3 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//////////////////////////////////////////////////////////////////////
#tool "nuget:?package=GitVersion.CommandLine&version=4.0.0"
#tool "nuget:?package=gitlink&version=3.1.0"
#tool "nuget:?package=JetBrains.DotMemoryUnit&version=3.0.20171219.105559"
#tool "nuget:?package=JetBrains.DotMemoryUnit&version=3.1.20200127.214830"
#addin "Cake.FileHelpers&version=3.2.0"

//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -95,7 +95,7 @@ Task("Test")
args.Append("--no-build");
return args;
},
ToolPath = "./tools/JetBrains.dotMemoryUnit.3.0.20171219.105559/lib/tools/dotMemoryUnit.exe"
ToolPath = "./tools/JetBrains.dotMemoryUnit.3.1.20200127.214830/lib/tools/dotMemoryUnit.exe"
});
});

Expand All @@ -106,7 +106,7 @@ Task("PublishLinuxTests")
DotNetCorePublish("./source/Halibut.Tests/Halibut.Tests.csproj", new DotNetCorePublishSettings
{
Configuration = configuration,
Framework = "netcoreapp2.2",
Framework = "netcoreapp3.1",
Runtime = "linux-x64",
OutputDirectory = new DirectoryPath($"{artifactsDir}publish/linux-x64")
});
Expand Down
6 changes: 4 additions & 2 deletions source/Halibut.CertificateGenerator/CertificateGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Operators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Crypto.Prng;
using Org.BouncyCastle.Math;
Expand Down Expand Up @@ -66,10 +67,11 @@ static X509Certificate2 AttemptToGenerate(string fullName)
certGen.SetNotAfter(DateTime.Today.AddYears(100));
certGen.SetSubjectDN(new X509Name(ord, attrs));
certGen.SetPublicKey(cerKp.Public);
certGen.SetSignatureAlgorithm("SHA1WithRSA");
certGen.AddExtension(X509Extensions.BasicConstraints, true, new BasicConstraints(false));
certGen.AddExtension(X509Extensions.AuthorityKeyIdentifier, true, new AuthorityKeyIdentifier(SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(cerKp.Public)));
var x509 = certGen.Generate(cerKp.Private);

var signatureFactory = new Asn1SignatureFactory("SHA1WithRSA", cerKp.Private);
var x509 = certGen.Generate(signatureFactory);

var x509Certificate = DotNetUtilities.ToX509Certificate(x509);
return new X509Certificate2(x509Certificate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BouncyCastle" Version="1.7.0" />
<PackageReference Include="BouncyCastle" Version="1.8.9" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
Expand Down
6 changes: 3 additions & 3 deletions source/Halibut.SampleClient/Halibut.SampleClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Serilog" Version="2.3.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="3.0.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
Expand Down
6 changes: 3 additions & 3 deletions source/Halibut.SampleLoadTest/Halibut.SampleLoadTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<VersionPrefix>0.0.0</VersionPrefix>
<TargetFrameworks>net45;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<AssemblyName>Halibut.SampleLoadTest</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Halibut.SampleLoadTest</PackageId>
Expand All @@ -18,8 +18,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.3.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="2.0.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="3.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions source/Halibut.SamplePolling/Halibut.SamplePolling.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Halibut\Halibut.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.3.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="2.0.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="3.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions source/Halibut.SampleServer/Halibut.SampleServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Serilog" Version="2.3.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="3.0.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
Expand Down
4 changes: 2 additions & 2 deletions source/Halibut.Tests/DiscoveryClientFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public void DiscoverMethodReturnsEndpointDetails()
var client = new DiscoveryClient();
var discovered = client.Discover(new ServiceEndPoint(endpoint.BaseUri, ""));

discovered.RemoteThumbprint.ShouldBeEquivalentTo(endpoint.RemoteThumbprint);
discovered.BaseUri.ShouldBeEquivalentTo(endpoint.BaseUri);
discovered.RemoteThumbprint.Should().BeEquivalentTo(endpoint.RemoteThumbprint);
discovered.BaseUri.Should().BeEquivalentTo(endpoint.BaseUri);
}

[Test]
Expand Down
3 changes: 2 additions & 1 deletion source/Halibut.Tests/FailureModesFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public void FailOnInvalidHostname()
}
else
{
new [] {"No such device or address", "Resource temporarily unavailable"}.Any(message.Contains).Should().BeTrue();
// Failed with: An error occurred when sending a request to 'https://sduj08ud9382ujd98dw9fh934hdj2389u982:8000/', before the request could begin: Name or service not known, but found False.
new [] {"No such device or address", "Resource temporarily unavailable", "Name or service not known"}.Any(message.Contains).Should().BeTrue($"Message does not match known strings: {message}");
}
}
}
Expand Down
37 changes: 15 additions & 22 deletions source/Halibut.Tests/Halibut.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
</PropertyGroup>
<PropertyGroup Condition="!$([MSBuild]::IsOSUnixLike())">
<TargetFrameworks>net462;netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSUnixLike())">
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Remove="PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress.NETCore.approved.cs" />
Expand All @@ -35,26 +35,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.dotMemoryUnit" Version="3.0.20171219.105559" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.2" />
<PackageReference Include="Assent" Version="1.3.1" />
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
<PackageReference Include="Serilog.Sinks.NUnit" Version="1.0.1" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.6.0" />
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.15" />
<PackageReference Include="Serilog" Version="2.3.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="2.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.dotMemoryUnit" Version="3.1.20200127.214830" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0" />
<PackageReference Include="Assent" Version="1.7.0" />
<PackageReference Include="FluentAssertions" Version="6.1.0" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.NUnit" Version="1.0.3" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="5.0.1" />
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.26" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="3.0.1" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net462' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ public TypeNotAllowedException(Type type, string path) { }
public Type DisallowedType { get; }
public string Path { get; }
}
public class WebSocketStream : Stream, IDisposable
public class WebSocketStream : Stream, IDisposable, IAsyncDisposable
{
public WebSocketStream(WebSocket context) { }
public bool CanRead { get; }
Expand Down
2 changes: 1 addition & 1 deletion source/Halibut.Tests/TcpConnectionFactoryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void ShouldCreateIpv4Socket_WhenIPv6Disabled()
client.Invoking(c =>
{
var dualMode = c.Client.DualMode;
}).ShouldThrow<NotSupportedException>();
}).Should().Throw<NotSupportedException>();
}
}
}
8 changes: 4 additions & 4 deletions source/Halibut.Tests/Util/AsyncEx/TaskExtensionsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public async Task When_TaskDoesNotCompleteWithinTimeout_ThrowsTimeoutException()
triggered = true;
});
Func<Task> act = async () => await task.TimeoutAfter(TimeSpan.FromMilliseconds(100), CancellationToken.None);
act.ShouldThrow<TimeoutException>();
await act.Should().ThrowAsync<TimeoutException>();
triggered.Should().Be(false, "we should have stopped waiting on the task when timeout happened");
await Task.Delay(200);
triggered.Should().Be(true, "task should have continued executing in the background");
Expand All @@ -61,7 +61,7 @@ public async Task When_TaskGetsCancelled_ThrowsTaskCanceledException()
});
#pragma warning restore 4014
Func<Task> act = async () => await task.TimeoutAfter(TimeSpan.FromMilliseconds(150), cancellationTokenSource.Token);
act.ShouldThrow<TaskCanceledException>();
await act.Should().ThrowAsync<OperationCanceledException>();
triggered.Should().Be(false, "we should have stopped waiting on the task when cancellation happened");
await Task.Delay(200);
triggered.Should().Be(true, "task should have continued executing in the background (not entirely ideal, but this task is designed to handle non-cancelable tasks)");
Expand Down Expand Up @@ -89,7 +89,7 @@ public async Task When_TaskGetsCanceledButStillThrowsExceptionAfterCancellation_
await Task.Delay(TimeSpan.FromMilliseconds(100));
cancellationTokenSource.Cancel();
});
await VerifyNoUnobservedExceptions<TaskCanceledException>(Task.Run(async () =>
await VerifyNoUnobservedExceptions<OperationCanceledException>(Task.Run(async () =>
{
await Task.Delay(TimeSpan.FromMilliseconds(200));
throw new ApplicationException("this task threw an exception after timeout");
Expand All @@ -106,7 +106,7 @@ static async Task VerifyNoUnobservedExceptions<T>(Task task)
try
{
Func<Task> act = async () => await task;
act.ShouldThrow<T>();
await act.Should().ThrowAsync<T>();

//delay long enough to ensure the task throws its exception
await Task.Delay(200);
Expand Down
10 changes: 3 additions & 7 deletions source/Halibut/Halibut.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.2" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="4.4.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.1" />
<PackageReference Include="System.Reflection.DispatchProxy" Version="4.4.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
Expand Down

0 comments on commit 9b7ce34

Please sign in to comment.