MNie/Expecto.Template

dotnet test on new project built from template fails to run

MarneeDear opened this issue · 4 comments

I get this error when I dotnet test on a new Expecto project:

Starting test execution, please wait...
An exception occurred while invoking executor 'executor://yolodev/expecto': Method not found: 'Void ExpectoConfig..ctor(Boolean, Int32, Microsoft.FSharp.Core.FSharpOption1<System.TimeSpan>, System.TimeSpan, Double, Boolean, Microsoft.FSharp.Core.FSharpFunc2<Expecto.Test,Expecto.Test>, TestPrinters, Expecto.Logging.LogLevel, Microsoft.FSharp.Core.FSharpOption1<System.String>, Microsoft.FSharp.Core.FSharpFunc2<Expecto.TestCode,Expecto.SourceLocation>, Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1, Boolean, Boolean, Boolean)'.

Steps:

Create a new expecto project

dotnet new expecto

Build the project

dotnet build

Build runs, does a restore, there are no errors.

Run the tests.

dotnet test

Get this error:

Starting test execution, please wait...
An exception occurred while invoking executor 'executor://yolodev/expecto': Method not found: 'Void ExpectoConfig..ctor(Boolean, Int32, Microsoft.FSharp.Core.FSharpOption1<System.TimeSpan>, System.TimeSpan, Double, Boolean, Microsoft.FSharp.Core.FSharpFunc2<Expecto.Test,Expecto.Test>, TestPrinters, Expecto.Logging.LogLevel, Microsoft.FSharp.Core.FSharpOption1<System.String>, Microsoft.FSharp.Core.FSharpFunc2<Expecto.TestCode,Expecto.SourceLocation>, Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1, Boolean, Boolean, Boolean)'.

My dotnet --info

$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.2.105
 Commit:    7cecb35b92

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.2.105\

Host (useful for support):
  Version: 2.2.3
  Commit:  6b8ad509b6

.NET Core SDKs installed:
  2.1.300 [C:\Program Files\dotnet\sdk]
  2.1.403 [C:\Program Files\dotnet\sdk]
  2.1.505 [C:\Program Files\dotnet\sdk]
  2.2.101 [C:\Program Files\dotnet\sdk]
  2.2.105 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

I had to go back to version 8.9.1 to get the tests to run. In the fsproj from the expecto template the Expecto version is set to this:

<PackageReference Include="Expecto" Version="8.*" />

Maybe versions 8.10+ are not compatible with the Yolo test runner specified in the template's fsproj.

<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.*" />

This is going to be a problem for anyone who built their projects with the template, I am afraid, unless they pegged the Expecto version.

MNie commented

@MarneeDear as long as YoloDev.Expecto.TestSdk would be updated to support the newest changes in Expecto everything should be cool.

Yes, thank you.

YoloDev already has a patch. I tested it today and they should be publishing a new version soon.

YoloDev/YoloDev.Expecto.TestSdk#15