Skip to content

coverlet.console with exit codes (ExitCodes.cs) #1746

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Bertk
Copy link
Collaborator

@Bertk Bertk commented Apr 4, 2025

@Bertk Bertk changed the title set exit code according ExitCodes.cs Process exit code according ExitCodes.cs Apr 4, 2025
@Bertk Bertk marked this pull request as ready for review April 4, 2025 13:19
@Bertk Bertk changed the title Process exit code according ExitCodes.cs coverlet.console with code according ExitCodes.cs Apr 14, 2025
@Bertk Bertk changed the title coverlet.console with code according ExitCodes.cs coverlet.console with exit codes (ExitCodes.cs) Apr 14, 2025
@Bertk Bertk requested a review from Copilot June 5, 2025 15:29
Copilot

This comment was marked as outdated.

Bertk added 3 commits June 6, 2025 08:44
Added a static readonly string `_expectedResult` in the `Msbuild` class to hold the expected output format. Updated multiple assertions to use this variable instead of hardcoded strings, enhancing maintainability and readability of the test code.
@Bertk Bertk requested a review from Copilot June 6, 2025 08:38
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR backports changes to support exit codes in coverlet.console, addressing issue #1747 and merging relevant changes from PR #1660. Key changes include updating project dependencies and references, modifying exit-code handling in both tests and the console program, and adjusting documentation accordingly.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/coverlet.integration.tests/coverlet.integration.tests.csproj Added a project reference for coverlet.console to the integration tests
test/coverlet.integration.tests/Msbuild.cs Updated test assertions to use a static expected result string
test/coverlet.integration.tests/DotnetTool.cs Captured and asserted command exit codes for tool invocations
test/coverlet.integration.template/DeepThought.cs Added an uncovered method for testing coverage reporting
src/coverlet.console/Program.cs Revised exit code handling by replacing local exitCode with a static field s_exitCode and updating logging behavior
src/coverlet.console/ExitCodes.cs Removed the CommandParsingException exit code (102)
Others Updated dependencies and documentation to reflect exit-code changes
Comments suppressed due to low confidence (1)

src/coverlet.console/Program.cs:361

  • Overwriting s_exitCode here may result in losing earlier error information (e.g. a test failure being masked by a subsequent threshold failure). Consider whether aggregating errors or prioritizing one exit code over the other is the intended behavior.
s_exitCode = (int)CommandExitCodes.TestFailed;

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

Successfully merging this pull request may close these issues.

1 participant