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

Test run fails when Oracle.ManagedDataAccess is added #189

Closed
henrihs opened this issue Sep 7, 2018 · 5 comments
Closed

Test run fails when Oracle.ManagedDataAccess is added #189

henrihs opened this issue Sep 7, 2018 · 5 comments

Comments

@henrihs
Copy link

henrihs commented Sep 7, 2018

First of all I want to thank you for the amazing tool you've made!

I've got this issue in a project which targets full framework (4.6.1), where the test run writes out this error during execution:

C:\Users\user\.nuget\packages\coverlet.msbuild\2.3.0\build\netstandard2.0\coverlet.msbuild.targets(16,5): error : Invalid directory size. [C:\work\temp\demotest\demotest.csproj]

I've been able to isolate the problem, and it seems to only occur when I add a reference to the package Oracle.ManagedDataAccess. The issue is not present when targeting netstandard2.0/netcoreapp2.1 and using Oracle.ManagedDataAccess.Core, but since this package still is in beta we're not able to ship software relying on it, yet.

Steps to reproduce

Execute the following lines (was performed in wsl-terminal). I've truncated the classes to single lines to make it easier to copy-paste.

mkdir temp && cd temp
dotnet new classlib -n demo
dotnet new xunit -n demotest
dotnet add demotest/ reference demo/demo.csproj

sed -i 's\netcoreapp2.1\net461\' demotest/demotest.csproj
sed -i 's\netstandard2.0\net461\' demo/demo.csproj

dotnet add demotest/ package coverlet.msbuild

echo 'namespace demo { public class TestableClass { public static int Answer() { return 42; } } }' > demo/TestableClass.cs
echo 'using demo; using Xunit; namespace demotest { public class TestClass { [Fact] public void Test() { Assert.Equal(42, TestableClass.Answer()); } } }' > demotest/TestClass.cs

dotnet test demotest/ /p:collectcoverage=true
echo Return code $?

dotnet add demo/ package Oracle.ManagedDataAccess
dotnet test demotest/ /p:collectcoverage=true
echo Return code $?

Issue

The first test run is successfully executed, and returns exit code 0.
As you can see, the latter test run writes out the error message mentioned in the top after build, before proceeding (and successfully executing) with the test run, and returns exit code 1.

@tonerdo
Copy link
Collaborator

tonerdo commented Sep 7, 2018

Hey @henrihs, at this time Coverlet only has complete support for .NET Core and not the full framework. Bringing it to the full framework is definitely something I've thought about but so far there's been very little in the way of demand or perceived ROI.

Opencover and AltCover might be alternatives to explore

@henrihs
Copy link
Author

henrihs commented Sep 7, 2018

I see. It actually looks like it work pretty good, besides from this particular issue, that is. The coverage seem to be calculated correctly as well.

@tonerdo
Copy link
Collaborator

tonerdo commented Sep 7, 2018

Well there's nothing technically stopping Coverlet from working on .NET Framework, it's just not a scenario I've tested so there are definitely gonna be some kinks here and there.

However, since Oracle.ManagedDataAccess is a public package I'll try to reproduce this locally and come up with a solution

@SteveGilham
Copy link

SteveGilham commented Sep 9, 2018

[UPDATED]
I've had a quick look at this, and

  1. It looks to be purely cosmetic with coverage of the system under test being generated OK at the end of the day
  2. The latest version of Oracle.ManagedDataAccess.dll (which is of course copied to the output directory for a full framework build) fails to decompile in the latest ILSpy (it raises an exception when it tries reading the debug header with an invalid length)
  3. AltCover traps such ArgumentExceptions from Cecil when scanning for assemblies that can be instrumented, and just passes that assembly by in an equivalent to the repro steps given above.
dotnet add demotest/ package altcover
dotnet test demotest/ /p:AltCover=true -v m

@MarcoRossignoli
Copy link
Collaborator

This should be resolved in last version where we skip to instrument dll without pdb or local sources(embedded or not).
Feel free to reopen if needed.

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

4 participants