Skip to content

BUG: Missing coverage #39

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

Closed
pms1969 opened this issue Apr 11, 2018 · 5 comments
Closed

BUG: Missing coverage #39

pms1969 opened this issue Apr 11, 2018 · 5 comments

Comments

@pms1969
Copy link
Contributor

pms1969 commented Apr 11, 2018

Just noticed this in my build pipeline

...
NUnit Adapter 3.8.0.0: Test execution complete

Total tests: 163. Passed: 144. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 2.4027 Minutes
Results File: /tmp/build/5128ae76/.output/_85bded69-6543-4650-7e86-6797d5d60ecd_2018-04-11_12_48_55.trx

Calculating coverage result...

real	5m55.490s
user	3m20.960s
sys	0m22.580s

Basically, ran 144 tests, but obviously failed silently when generating the coverage file. This happened on a number of test assemblies. :-(

Any ideas what might be causing that. I've not been able to see that happen locally.

@tonerdo
Copy link
Collaborator

tonerdo commented Apr 11, 2018

What's .trx?

@pms1969
Copy link
Contributor Author

pms1969 commented Apr 11, 2018

it's the logger output for dotnet test.

To run my tests, I do the following:

    time \
        dotnet test \
            --no-build \
            --no-restore \
            --filter 'TestCategory!=Integration&TestCategory!=Explicit&TestCategory!=Performance' \
            --logger:trx \
            -r .output/ \
            $testproj \
            /nowarn:NU1701,NU1603,NU1605 \
            /p:CollectCoverage=true \
            /p:CoverletOutputFormat=opencover

the --logger:trx, produces the trx output file (which is vstest output format?). This is then picked up by sonarqube and processed to identify failed tests.

@sampwil
Copy link

sampwil commented Apr 16, 2018

@pms1969 Once again it seems we are have some of the same issues. I think it is because we are attempting to run this in a CI/CD environment. I encountered the same no output if I have the --no-build and --no-restore switch. When I removed the switch I would I get the "because it is being used by another process" issue again. I discovered if I let the process build into empty directory it would fail. When I ran a dotnet publish and specified the configuration switch to it previously run publish directory it would succeed. I have put my successful patterns below.

dotnet publish src/Server.Tests/Server.Tests.csproj -c Debug
dotnet add src/Server.Tests/Server.Tests.csproj package coverlet.msbuild --version 1.1.0
dotnet test src/Server.Tests/Server.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=json -c Debug


dotnet publish src/Server.Tests/Server.Tests.csproj -c Release
dotnet add src/Server.Tests/Server.Tests.csproj package coverlet.msbuild --version 1.1.0
dotnet test src/Server.Tests/Server.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=json -c Release

@pms1969
Copy link
Contributor Author

pms1969 commented Apr 17, 2018

@sampwil Thanks. I haven't had time to circle back to this yet. Hopefully soon. I thought I'd managed to rid us of the "used by another process" problem. but apparently not. There's a newer version out, since I posted this originally, so maybe something in there fixes this. maybe not :/ I'll just have to play again and see.

Unfortunately publishing, and rebuilding every time doesn't work for us. The coverage job takes neigh on 22 minutes at present. Using coverlet and linux docker instead of the current dotcover and windows, I can get the time down to 14'ish minutes. It has to be something simple.

@tonerdo
Copy link
Collaborator

tonerdo commented Sep 1, 2018

Moved discussion to #72

@tonerdo tonerdo closed this as completed Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants