-
Notifications
You must be signed in to change notification settings - Fork 386
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
Path is empty for VB My namespace #1073
Path is empty for VB My namespace #1073
Conversation
The issue is the In Visual Basic the compiler injects the Maybe there are also other scenarios where a sequence point doesn't have a reference to a source file that we haven't encountered yet. So I created a PR that excludes code like this within an assembly. But I could also think of a solution that really just filters out the |
Thx Dave, need to go deeper on it to understand if as you said make sense something for that injected namespace. Can we add a new VB project and create a test?Is it too complex? |
I will give it a try. |
I agree...but we need to be pretty sure to not break something, so I'm ok with the update but I'd like to have a test in place for future issue on it. |
@@ -597,7 +597,7 @@ public int SampleMethod() | |||
} | |||
else | |||
{ | |||
Assert.NotEmpty(result.Documents); | |||
Assert.Empty(result.Documents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm is this correct?(didn't tested on my own but seem we expect opposite behavior)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compiled assembly in this test doesn't have a reference to a source file an thus the result is always empty. Before my change in the Instrumenter
this test returned a result with a empty document source which is exactly what would create the bug in the report generation.
After my change such a InstrumenterResult
isn't created anymore and that's why now result.Documents
is also empty here.
To make this test the way it was intended the dynamically created assembly must contain sequence points with a reference to the source file. But what ever I tried here the assemblies sequence points never had source file information.
var emitResult = compilation.Emit(outputStream, pdbStream, options: isWindows ? emitOptions : emitOptions.WithDebugInformationFormat(DebugInformationFormat.PortablePdb)); |
The assemblies sequence points were always without source information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it...pls can you add a comment on top of that assert with this explanation for future reference?
@MarcoRossignoli It seems the My namespace in VB is only in .NET Framework projects. I think it isn't possible to add a project with .NET Framework as target to the coverlet solution? Or at least I couldn't do it without crashing the build jobs? |
I think it's possible, AFAIK .NET Framework project can be compiled on all plat through If it'll be too hard to do, we can merge and open a ticket to follow up this. |
3f11164
to
02c92d6
Compare
@MarcoRossignoli I'm still working on this but it seems that Linux and Mac build jobs can't build the project. Windows build job is green now. But for the others I'm getting ( |
Thanks, but now I get a |
Ok Dave open an issue on the dotnet repo, I never used that ref I only know about the existence |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi, I've been trying to get a coverage report for a .Net Framework project displayed in Devops for 3 days. After updating all possible tools on our build agent, the test is finally running via DotNetCli. But unfortunately I also get the "The path is empty" error at the end. It is a VB project. |
@@ -510,7 +510,12 @@ private void InstrumentType(TypeDefinition type) | |||
|
|||
private void InstrumentMethod(MethodDefinition method) | |||
{ | |||
//_logger.LogInformation($"Instrumenting method '{method.FullName}' in module '{_module}'."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daveMueller I see this line as commented, is it on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure I just used it for debugging. So no need to keep this in the log.
@daveMueller do you plan to move on this one or can I take over? It's pretty old and I think we can exclude tests from Mac/Linux and run failing one only on Win. |
@MarcoRossignoli I totally forgot about this one. I'm currently really busy so I would be glad if you could take over. I'm fine with excluding the test for Mac/Linux. Thank you. |
Great, thanks a lot for the effort here! |
# Conflicts: # coverlet.sln # src/coverlet.core/Instrumentation/Instrumenter.cs # test/coverlet.core.tests/Instrumentation/InstrumenterTests.cs # test/coverlet.core.tests/coverlet.core.tests.csproj
# Conflicts: # Documentation/Changelog.md
Is this good to merge now? |
@MarcoRossignoli yes I worked on it again and made the integration test run on all platforms now. So this is ready for review/merge. I asked in the issue (#775 (comment)) if someone can give it a try. |
Thanks @daveMueller |
closes #775