Open AndersAbel opened 6 years ago
@AndersAbel
Just remove all this workaround scripts (your Install sscript) for copying appveyor logger and setting location to vstest.console
and rely on vstest.console
which is available in PATH
.
Apparently, starting from VS 2017 15.5.1 they changed the location of vstest.console with extensions to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\TestPlatform
.
Side note: nuget download is not needed too, it is up to date on build worker image.
Thank you, removing the custom install script fixed the issue.
Well, it didn't fix the problem completely, as the vstest.console.exe in the path doesn't handle code coverage. Looking into it.
Looks like I still need to use the test runner from TestAgent to be able to use code coverage. Can't get it to work with /logger:Appveyor
though. When I run the same commands from an RDP session it works, so I really don't know where to look.
For now I just excluded the /logger:AppVeyor
switch. The tests tab on the build is empty because of that, but at least the build works and runs the tests.
Could you please provide the commands you run in RDP session and that worked?
Coming back to look at this (sorry it took so long time) but can't find the commands that worked.
The problem persists: I need to run a version of vstest.console.exe that supports the /EnableCodeCoverage switch. Using the vstest.console.exe in path results in the error Data collector 'Code Coverage' message: Cannot find CodeCoverage.exe. .
Using an explicit path to 'C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\Extensions\TestPlatform\vstest.console.exe'
makes the /EnableCodeCoverage
switch work, but then /logger/AppVeyor
won't work.
I tried copying the Appveyor.MsTestLogger.VS2017.dll
to C:\Tools and used the /TestAdapterPath:C:/Tools
switch, but still no luck.
Right, we see the same. Here is little bit ugly workaround we can propose right now:
test_script:
- set path=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow;%path%
- copy "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions\appveyor.*" "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions" /y
- vstest.console /EnableCodeCoverage "C:\projects\vscodecoverage\VsCodeCoverageTests\bin\Debug\VsCodeCoverageTests.dll" /logger:trx;LogFileName=results.trx
- ps: $wc = New-Object 'System.Net.WebClient'
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\TestResults\results.trx))
In my builds I've started to get a message that the Appveyor logger can't be found by the vstest.console runner:
vstest.console.exe : Could not find a test logger with URI or FriendlyName 'appveyor'.
Build history shows that the last successful build was on December 5th and the first broken was on December 13th.
I've not done any updates to the settings during this time. The configuration for this build is in the web interface, relevant parts (ping me if more is needed):
Visual Studio 2017
Sustainsys/Saml2
master
Install script:
Test Script:
This is the cause of Sustainsys/Saml2#872