Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command vstest.console.exe not started. Why? #218

Closed
maurosoft1973 opened this issue Apr 15, 2024 · 3 comments
Closed

Command vstest.console.exe not started. Why? #218

maurosoft1973 opened this issue Apr 15, 2024 · 3 comments
Labels
cannot repro Need a simple case of the issue to work from question

Comments

@maurosoft1973
Copy link

maurosoft1973 commented Apr 15, 2024

AltCover version 8.8.21

  1. The first command just did the instrumentation and wrote a couple of template files (for the raw output)
altcover --inputDirectory=/source/test/bin/Debug/ --outputDirectory=/source/test/bin/Debug/AltCover/ -s=Microsoft.* -s=xunit.* -s=Testcontainers.* -s=Bogus.* -s=Docker.* -s=ICSharpCode.* -s=System.* -s=Spekt.* --report=/source/test/bin/Debug/reportDir/rawReport.xml --reportFormat=OpenCover --save
  1. The second command actually run the tests and caught the raw output, and then wrote the final output report based on the raw files.
altcover Runner --recorderDirectory=/source/test/bin/Debug/AltCover --outputFile=/source/test/bin/Debug/reportDir/finalReport.xml --executable=/usr/bin/vstest.console.exe -- /source/test/bin/Debug/AltCover/MyTest.dll

This is the result of command 2:

Beginning run...
Command line : '/usr/bin/vstest.console.exe /source/test/bin/Debug/AltCover/MyTest.dll'
Getting results...
A total of 0 visits recorded
Coverage statistics flushing took 0.63 seconds
Visited Classes 0 of 142 (0)
Visited Methods 0 of 440 (0)
Visited Points 0 of 3613 (0)
Visited Branches 0 of 1417 (0)
Maximum CRAP score 0
==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 0 of 152 (0)
Alternative Visited Methods 0 of 543 (0)
Alternative maximum CRAP score 0

Why is the command /usr/bin/vstest.console.exe /source/test/bin/Debug/AltCover/MyTest.dll not called up?

Where do I go wrong?

Execution takes place in a mono container

I thank those who will give me an answer to the problem.

@maurosoft1973 maurosoft1973 changed the title Command line not started. Why? Command vstest.console.exe not started. Why? Apr 15, 2024
@SteveGilham
Copy link
Owner

The absolute silence between the Command line : ... and Getting results in your case - not even an error message being echoed - is unexpected.

The AltCover build under Linux on GitHub runs unit tests under mono, admittedly with NUnit rather than VStest, but in a very similar manner

/usr/bin/mono --debug /home/runner/work/altcover/altcover/_Binaries/AltCover/Release+AnyCPU/net472/AltCover.exe -o ./__VisualizerTestWithAltCoverRunner -s "\.DataCollector" -s Sample -s Microsoft -s testhost -t "System\." -t "Sample3\.Class2" -t Microsoft -t ICSharpCode -t <Start -t UnitTestStub -t SolutionRoot -m WaitForExitCustom --sn /home/runner/work/altcover/altcover/Build/SelfTest.snk --reportFormat OpenCover -r /home/runner/work/altcover/altcover/_Reports/VisualizerTestWithAltCoverRunner.xml --single --localSource

then

/usr/bin/mono --debug /home/runner/work/altcover/altcover/_Binaries/AltCover/Release+AnyCPU/net472/AltCover.exe Runner -r /home/runner/work/altcover/altcover/_Binaries/AltCover.Visualizer.Tests/Debug+AnyCPU/net472/./__VisualizerTestWithAltCoverRunner -x /home/runner/work/altcover/altcover/packages/nunit.consolerunner/3.12.0/tools/nunit3-console.exe -- --noheader --work=. --result=./_Reports/VisualizerTestWithAltCoverRunnerReport.xml /home/runner/work/altcover/altcover/_Binaries/AltCover.Visualizer.Tests/Debug+AnyCPU/net472/__VisualizerTestWithAltCoverRunner/AltCover.Tests.Visualizer.dll

but after echoing the command line, that shows the console output from NUnit like

Beginning run...
Command line : '/home/runner/work/altcover/altcover/packages/nunit.consolerunner/3.12.0/tools/nunit3-console.exe --noheader --work=. --result=./_Reports/VisualizerTestWithAltCoverRunnerReport.xml /home/runner/work/altcover/altcover/_Binaries/AltCover.Visualizer.Tests/Debug+AnyCPU/net472/__VisualizerTestWithAltCoverRunner/AltCover.Tests.Visualizer.dll'
Runtime Environment
   OS Version: Linux 6.5.0.1017 
   Runtime: .NET Framework CLR v4.0.30319.42000
...

Without doing the test run under the control of the runner, but just at a command line, does plain

/usr/bin/vstest.console.exe /source/test/bin/Debug/AltCover/MyTest.dll

run the tests?

If it does, then a work-around would be to run the tests like that and use

altcover runner --collect --recorderDirectory=/source/test/bin/Debug/AltCover --outputFile=/source/test/bin/Debug/reportDir/finalReport.xml

If it silently does nothing, than that would be the problem

@SteveGilham
Copy link
Owner

Any updates, or shall I close this?

@SteveGilham SteveGilham added the cannot repro Need a simple case of the issue to work from label Apr 29, 2024
@maurosoft1973
Copy link
Author

maurosoft1973 commented Apr 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot repro Need a simple case of the issue to work from question
Projects
None yet
Development

No branches or pull requests

2 participants