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

dotnet-coverage connect returns successful exit code even if subprocess fails #133

Closed
mvromer opened this issue Aug 30, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mvromer
Copy link

mvromer commented Aug 30, 2024

This seems to be similar to an issue raised two years ago in regard to dotnet-coverage collect exhibiting the same behavior. That issue was raised and addressed here.

In my situation, I have an Azure Pipeline where I'm starting a coverage collection server with dotnet-coverage collect --server-mode --background --session-id {session} in one step. Later in another step I will run dotnet-coverage connect {session} dotnet test to kick off all my unit and integration tests and gather coverage data.

What I've noticed is that this latter command will always return with an exit status of 0, even if dotnet test returns non-zero when at least one of the tests fail. This means I can't stop and fail the pipeline run on test failure like I used to prior to incorporating dotnet-coverage in my pipelines. I've been able to confirm this behavior locally by doing a similar setup except instead of calling dotnet test I instead will call a .NET console app that simply returns an exit status of 1. In that case, the exit status of dotnet-coverage connect is still zero.

I think if dotnet-coverage connect runs the client not in background mode, then it should relay the exit status of the client subprocess. This would allow for automated tests and pipelines to properly detect if the underlying client/test runner fails and to respond appropriately.

@fhnaseer fhnaseer added the bug Something isn't working label Aug 30, 2024
@fhnaseer fhnaseer self-assigned this Aug 30, 2024
@fhnaseer
Copy link
Member

fhnaseer commented Sep 6, 2024

This has been fixed and will be available in the next release of dotnet-coverage (17.12.4).

@fhnaseer fhnaseer closed this as completed Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants