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

DirectoryNotFoundException when measuring code coverage #22

Closed
Georgi-Ivanov-Fourth opened this issue Jun 13, 2017 · 1 comment
Closed

Comments

@Georgi-Ivanov-Fourth
Copy link

Georgi-Ivanov-Fourth commented Jun 13, 2017

I have set of XUnit tests using EntityFramework.Testing package and when I run them using xunit runner everything is OK:

C:\WhateverProject>.\packages\xunit.runner.console.2.2.0\tools\xunit.console.exe ".\WhateverProject.UnitTests\bin\Release\WhateverProject.UnitTests.dll" -xml TestResults.WhateverProject.xml
xUnit.net Console Runner (64-bit .NET 4.0.30319.42000)
Discovering: WhateverProject.UnitTests
Discovered: WhateverProject.UnitTests
Starting: WhateverProject.UnitTests
Finished: WhateverProject.UnitTests
=== TEST EXECUTION SUMMARY ===
WhateverProject.UnitTests Total: 79, Errors: 0, Failed: 0, Skipped: 0, Time: 8.398s

However when I am using OpenCover.Console.exe to execute the tests and measure the coverage, I am getting DirectoryNotFoundException:

C:\WhateverProject>OpenCover.Console.exe -output:".\opencover.xml" -register:user -mergeoutput -target:".\packages\xunit.runner.cons
ole.2.2.0\tools\xunit.console.exe" -targetargs:"WhateverProject.UnitTests.dll" -targetdir:".\WhateverProject.UnitTests\bin\Release"
Loading coverage file C:\WhateverProject.\opencover.xml
Executing: C:\WhateverProject\packages\xunit.runner.console.2.2.0\tools\xunit.console.exe
xUnit.net Console Runner (64-bit .NET 4.0.30319.42000)
Discovering: WhateverProject.UnitTests
Discovered: WhateverProject.UnitTests
Starting: WhateverProject.UnitTests
Finished: WhateverProject.UnitTests
=== TEST EXECUTION SUMMARY ===
WhateverProject.UnitTests Total: 79, Errors: 0, Failed: 0, Skipped: 0, Time: 10.489s
Committing...
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing.Moq\MoqDbSetExtensions.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\DebugCheck.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\InMemoryAsyncQueryable{T}.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\InMemoryAsyncQueryProvider.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\InMemoryDbAsyncEnumerator{T}.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\TypeExtensions.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing.Moq\MoqDbSetExtensions.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\DebugCheck.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\InMemoryAsyncQueryable{T}.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\InMemoryAsyncQueryProvider.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\InMemoryDbAsyncEnumerator{T}.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\TypeExtensions.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing.Moq\MoqDbSetExtensions.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\DebugCheck.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\InMemoryAsyncQueryable{T}.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\InMemoryAsyncQueryProvider.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\InMemoryDbAsyncEnumerator{T}.cs'.
An System.IO.DirectoryNotFoundException occured: Could not find a part of the path 'c:\Users\Scott\Documents\GitHub\scott-xu\EntityFramework.Testing\src\EntityFramework.Testing\TypeExtensions.cs'.
Visited Classes 698 of 1722 (40.53)
Visited Methods 1638 of 5005 (32.73)
Visited Points 4722 of 13432 (35.15)
Visited Branches 2029 of 7089 (28.62)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 772 of 2016 (38.29)
Alternative Visited Methods 2545 of 8552 (29.76)

@scott-xu
Copy link
Owner

It looks like OpenCover.Console.exe is looking for the source code to calculate the unit test coverage. Try delete All EntityFramework.*.pdb files.

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

2 participants