Migrate entire build system and test runtime to .NET Core 3.1 (#4216)

* upgraded runtimes to .NET Core 3.1

* Updated dotnet install script urls

* Fixed netcore sdk version

* Updated tests runtime for netcore to 3.1

* Typo fix

* Update MNTR publishing target

* Fix NRE exception under .net core

* Improved Akka.Remote's racy spec

* Fix compile time issue (missing using)

Co-authored-by: Aaron Stannard <aaron@petabridge.com>
This commit is contained in:
Igor Fedchenko 2020-02-14 18:03:13 +03:00 коммит произвёл GitHub
Родитель 2d93eea3fb
Коммит 4087d015bd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 14 добавлений и 20 удалений

Просмотреть файл

@ -53,7 +53,7 @@ let incrementalistReport = output @@ "incrementalist.txt"
// Configuration values for tests
let testNetFrameworkVersion = "net461"
let testNetCoreVersion = "netcoreapp2.1"
let testNetCoreVersion = "netcoreapp3.1"
Target "Clean" (fun _ ->
ActivateFinalTarget "KillCreatedProcesses"

Просмотреть файл

@ -31,8 +31,8 @@ Param(
$FakeVersion = "4.63.0"
$DotNetChannel = "LTS";
$DotNetVersion = "2.1.500";
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v$DotNetVersion/scripts/obtain/dotnet-install.ps1";
$DotNetVersion = "3.1.100";
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
$NugetVersion = "4.3.0";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"
$ProtobufVersion = "3.4.0"

Просмотреть файл

@ -13,8 +13,8 @@ NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe
FAKE_VERSION=4.63.0
FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe
DOTNET_EXE=$SCRIPT_DIR/.dotnet/dotnet
DOTNET_VERSION=2.1.500
DOTNET_INSTALLER_URL=https://raw.githubusercontent.com/dotnet/cli/v$DOTNET_VERSION/scripts/obtain/dotnet-install.sh
DOTNET_VERSION=3.1.100
DOTNET_INSTALLER_URL=https://dot.net/v1/dotnet-install.sh
DOTNET_CHANNEL=LTS
PROTOBUF_VERSION=3.4.0
INCREMENTALIST_VERSION=0.2.1

Просмотреть файл

@ -15,7 +15,7 @@
<NewtonsoftJsonVersion>12.0.3</NewtonsoftJsonVersion>
<NBenchVersion>1.2.2</NBenchVersion>
<ProtobufVersion>3.11.2</ProtobufVersion>
<NetCoreTestVersion>netcoreapp2.1</NetCoreTestVersion>
<NetCoreTestVersion>netcoreapp3.1</NetCoreTestVersion>
<NetFrameworkTestVersion>net461</NetFrameworkTestVersion>
<NetStandardLibVersion>netstandard2.0</NetStandardLibVersion>
<NetFrameworkLibVersion>net452</NetFrameworkLibVersion>

Просмотреть файл

@ -16,6 +16,6 @@
</metadata>
<files>
<file src="bin\Release\net461\win7-x64\publish\*.*" target="lib\net461\" />
<file src="bin\Release\netcoreapp2.1\win7-x64\publish\*.*" target="lib\netcoreapp2.1\" />
<file src="bin\Release\netcoreapp3.1\win7-x64\publish\*.*" target="lib\netcoreapp3.1\" />
</files>
</package>

Просмотреть файл

@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Configuration;
using Akka.Dispatch;
@ -303,7 +304,7 @@ namespace Akka.Remote.Tests
}
[Fact]
public void RemoteRouter_must_set_supplied_SupervisorStrategy()
public async Task RemoteRouter_must_set_supplied_SupervisorStrategy()
{
var probe = CreateTestProbe(masterSystem);
var escalator = new OneForOneStrategy(ex =>
@ -320,9 +321,9 @@ namespace Akka.Remote.Tests
// Need to be able to bind EventFilter to additional actor system (masterActorSystem in this case) before this code works
// EventFilter.Exception<ActorKilledException>().ExpectOne(() =>
probe.ExpectMsg<Routees>().Members.Head().Send(Kill.Instance, TestActor);
probe.ExpectMsg<Routees>(TimeSpan.FromSeconds(10)).Members.Head().Send(Kill.Instance, TestActor);
//);
probe.ExpectMsg<ActorKilledException>();
probe.ExpectMsg<ActorKilledException>(TimeSpan.FromSeconds(10));
}
[Fact(Skip = "Remote actor's DCN is currently not supported")]

Просмотреть файл

@ -1,4 +1,4 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// <copyright file="ExceptionSupport.cs" company="Akka.NET Project">
// Copyright (C) 2009-2019 Lightbend Inc. <http://www.lightbend.com>
// Copyright (C) 2013-2019 .NET Foundation <https://github.com/akkadotnet/akka.net>
@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization.Formatters;
using Akka.Actor;
using Akka.Util;
using Akka.Util.Internal;
@ -149,14 +150,6 @@ namespace Akka.Remote.Serialization
}
#else
private TypeInfo ExceptionTypeInfo = typeof(Exception).GetTypeInfo();
private static readonly Func<Type, object> GetUninitializedObjectDelegate = (Func<Type, object>)
typeof(string)
.GetTypeInfo()
.Assembly
.GetType("System.Runtime.Serialization.FormatterServices")
?.GetTypeInfo()
?.GetMethod("GetUninitializedObject", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static)
?.CreateDelegate(typeof(Func<Type, object>));
internal Proto.Msg.ExceptionData ExceptionToProtoNetCore(Exception exception)
{
@ -193,7 +186,7 @@ namespace Akka.Remote.Serialization
Type exceptionType = Type.GetType(proto.TypeName);
var obj = GetUninitializedObjectDelegate(exceptionType);
var obj = System.Runtime.Serialization.FormatterServices.GetUninitializedObject(exceptionType);
if (!string.IsNullOrEmpty(proto.Message))
ExceptionTypeInfo?.GetField("_message", All)?.SetValue(obj, proto.Message);