llewellynfalco;8422 wrote: var namer = Approvals.GetDefaultNamer();
namer.Name
namer.SourcePath
will get you where it's looking. Also the error and console should print the expected location on failure.
I just my 1st question is what's different about the vm? any chance the user permissions are causing issues?
Hmm. When I add
var namer = Approvals.GetDefaultNamer();
Console.WriteLine($"Approvals Namer: .Name= {namer.Name}.SourcePath= {namer.SourcePath}");
to my setup method, I get an error effectively saying ApprovalTests cannot recognize the testing framework I use. (Which is Nunit 3.0.1.) - and it says so on BOTH my local machine and the remote server. Whereas, without these two lines, the tests run just fine locally and on the remote machine they fail with the problem I described in my original post.
The exact error given by Approvals is:
NCrunch: This test was executed on server '(local)'
16/03/19 17:23:19 ~000037ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000037ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000010ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000010ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000000ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000000ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000000ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000000ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000001ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000001ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000001ms Variable: approvalFrame = ''
16/03/19 17:23:19 ~000001ms Variable: approvalFrame = ''
System.Exception :
Could Not Detect Test Framework
Either:
1) Optimizer Inlined Test Methods
Solutions:
a) Add [MethodImpl(MethodImplOptions.NoInlining)]
b) Set Build->Optimize Code to False
& Build->Advanced->DebugInfo to Full
or
2) Approvals is not set up to use your test framework.
It currently supports [NUnit, MsTest, MbUnit, xUnit.net, xUnit.extensions, xUnit2.net, Machine.Specifications (MSpec)]
Solution:
To add one use ApprovalTests.Namers.StackTraceParsers.StackTraceParser.AddParser() method to add implementation of ApprovalTests.Namers.StackTraceParsers.IStackTraceParser with support for your testing framework.
To learn how to implement one see
http://blog.approvaltest...01/creating-namers.html
at ApprovalTests.Namers.StackTraceParsers.StackTraceParser.Parse(StackTrace stackTrace)
at ApprovalTests.Namers.UnitTestFrameworkNamer..ctor()
at ApprovalTests.Approvals.<.cctor>b__c()
at ApprovalTests.Approvals.GetDefaultNamer()
at Activator.Transpiling.Typescript.Tests.IntegrationTests.Setup() in C:\Projects\Activator\Activator.Transpiler\transpiler\Activator.Transpiling.Typescript.Tests\IntegrationTests.cs:line 21
I checked the build settings. In the config I run, Optimize Code is unchecked and DebugInfo is set to Full.