Skip to content

Conversation

markusschaber
Copy link
Contributor

@markusschaber markusschaber commented Nov 12, 2020

When the SourceRootTranslator constructor fails due to a missing file, the actual path is not mentioned. Instead, the output mentiones the csproj file after the error message, misleading the user into thinking that the project file could not be found or accesed:

C:\Some\Path\nuget\coverlet.msbuild\2.9.0\build\coverlet.msbuild.targets(31,5): error : Module test path not found [C:\Some\Path\AddOn\Tests\UnitTests\UnitTests.csproj]

This patch includes the path of the missing file in the exception message, so the user knows which file actually could not be found:

C:\Some\Path\nuget\coverlet.msbuild\2.9.2-g4b933871de\build\coverlet.msbuild.targets(31,5): error : Module test path 'C:\Some\Path\AddOn\Tests\UnitTests\bin\Debug\CODESYS.CAS.Connector.UnitTests.dll' not found [C:\Some\Path\AddOn\Tests\UnitTests\UnitTests.csproj]

My guess is that performance is not really negatively affected, as this only happens in a code path where the test execution fails anyways.

I also hope this qualifies as "very small change" according to https://github.com/coverlet-coverage/coverlet/blob/master/CONTRIBUTING.md, so I did not open an issue before the merge request. :-)

@dnfadmin
Copy link

dnfadmin commented Nov 12, 2020

CLA assistant check
All CLA requirements met.

Copy link
Collaborator

@MarcoRossignoli MarcoRossignoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!

@MarcoRossignoli MarcoRossignoli added the enhancement General enhancement request label Nov 12, 2020
@MarcoRossignoli MarcoRossignoli merged commit 3fe2d90 into coverlet-coverage:master Nov 12, 2020
@markusschaber
Copy link
Contributor Author

Thank you! :-)

@markusschaber markusschaber deleted the CoverletBetterErrorMessage branch November 12, 2020 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancement request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants