akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.71k stars 1.04k forks source link

Builds aren't failing on xunit errors #3416

Open ivog opened 6 years ago

ivog commented 6 years ago

The linux unit tests build doesn't seem to run the unit tests because of the following error:

[08:42:23][docker] Running .NET Core 1.1.2 tests for framework netcoreapp1.1... [08:42:23][docker] It was not possible to find any compatible framework version [08:42:23][docker] The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found. [08:42:23][docker] - Check application dependencies and target a framework version installed at: [08:42:23][docker] / [08:42:23][docker] - Alternatively, install the framework version '1.1.2'. [08:42:24][docker] [mSearching for processes with name = xunit.console [08:42:24][docker] xUnit2 reported an error (Error Code 131)

However the build reports a success status. The same problem seems to be occurring in the windows unit tests build. Here the xunit error is:

[08:52:47][RunTests] Running desktop CLR tests for framework net452... [08:52:47][RunTests] xUnit.net Console Runner (64-bit Desktop .NET 4.0.30319.42000) [08:52:48][RunTests] System.IO.FileLoadException: Could not load file or assembly 'FSharp.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) [08:52:48][RunTests] File name: 'FSharp.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileLoadException: Could not load file or assembly 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) [08:52:48][RunTests] File name: 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [08:52:48][RunTests] [08:52:48][RunTests] [08:52:48][RunTests] WRN: Assembly binding logging is turned OFF. [08:52:48][RunTests] To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. [08:52:48][RunTests] Note: There is some performance penalty associated with assembly bind failure logging. [08:52:48][RunTests] To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. [08:52:48][RunTests] [08:52:48][RunTests] at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) [08:52:48][RunTests] at System.Signature..ctor(IRuntimeMethodInfo methodHandle, RuntimeType declaringType) [08:52:48][RunTests] at System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy() [08:52:48][RunTests] at System.Reflection.RuntimeConstructorInfo.GetParameters() [08:52:48][RunTests] at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat) [08:52:48][RunTests] at System.Exception.GetStackTrace(Boolean needFileInfo) [08:52:48][RunTests] at System.Exception.ToString(Boolean needFileLineInfo, Boolean needMessage) [08:52:48][RunTests] at System.Exception.ToString(Boolean needFileLineInfo, Boolean needMessage) [08:52:48][RunTests] at System.Exception.ToString(Boolean needFileLineInfo, Boolean needMessage) [08:52:48][RunTests] at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args) [08:52:48][RunTests] at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args) [08:52:48][RunTests] at System.String.Format(String format, Object arg0, Object arg1) [08:52:48][RunTests] at Xunit.Sdk.TestFrameworkDiscoverer.FindTestsForTypeAndWrapExceptions(ITestClass testClass, Boolean includeSourceInformation, IMessageBus messageBus, ITestFrameworkDiscoveryOptions discoveryOptions) [08:52:48][RunTests] at Xunit.Sdk.TestFrameworkDiscoverer.<>c__DisplayClass26_0.b0() [08:52:48][RunTests] at Xunit.Sdk.XunitWorkerThread.<>c.b40(Object ) [08:52:48][RunTests] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) [08:52:48][RunTests] at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) [08:52:48][RunTests] at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() [08:52:48][RunTests] at System.Threading.ThreadPoolWorkQueue.Dispatch() [08:52:48][RunTests] [08:52:48][RunTests] [08:52:48][RunTests] xUnit2 reported an error (Error Code 1)

But the build reports success.

Aaronontheweb commented 6 years ago

@ivog I have a PR open for this already: https://github.com/akkadotnet/akka.net/pull/3391

Aaronontheweb commented 6 years ago

Well, two actually: https://github.com/akkadotnet/akka.net/pull/3400 - this is the approach we'll end up going with I think.

ivog commented 6 years ago

@Aaronontheweb ah ok I totally missed that 😀. I'll try to help on fixing the xunit problem in the windows unittest build then. Maybe this issue should be about changing the teamcity configuration to fail the build whenever there's something wrong. I'll close my PR

Aaronontheweb commented 6 years ago

@ivog no problem at all man - I appreciate you trying to fix it! By all means, we have some other issues that would be good for first time contributors - I'd encourage you to give one of those a try :D

But yeah, the TeamCity build process doesn't flag it because the underlying process (xunit runner in this case) doesn't return a failure exit code. It just no-ops.

ivog commented 6 years ago

@Aaronontheweb I think to resolve the issue in the windows unit test build the latest fsharp sdk needs to be installed on the agent. http://download.microsoft.com/download/B/A/6/BA6275B8-8073-4CF4-AFF4-89FD08402EC5/Microsoft.FSharp.SDK.Core.msi I'm going to look into xunit not reporting an exitcode.

ivog commented 6 years ago

@Aaronontheweb I think this stackoverflow answer describes how TC can be configured to fail the build when there's errors happening as part of a command task: https://stackoverflow.com/a/31206924 Could you maybe give this a try in the linux and windows UT builds?