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

TestLauncher reports test success even if test fails #26195

Closed
donat opened this issue Aug 28, 2023 · 0 comments · Fixed by #26200
Closed

TestLauncher reports test success even if test fails #26195

donat opened this issue Aug 28, 2023 · 0 comments · Fixed by #26200
Assignees
Milestone

Comments

@donat
Copy link
Member

donat commented Aug 28, 2023

Current Behavior

If I run the test task using BuildLauncher, I get Task :test failed in DefaultTaskFinishEvent and DefaultTaskFailureResult as the execution result. If I run the test task using TestLauncher, I get Task :test SUCCESS in DefaultTaskFinishEvent and DefaultTaskSuccessResult as the execution result.

Expected Behavior

The test outcome and the reported TAPI events should both fail.

Context (optional)

No response

Steps to Reproduce

reproducer project

Gradle version

Gradle 8.2

Build scan URL (optional)

No response

Your Environment (optional)

No response

@donat donat self-assigned this Aug 28, 2023
@donat donat added this to the 8.4 RC1 milestone Aug 29, 2023
bot-gradle added a commit that referenced this issue Aug 31, 2023
…r more uniform

The TestLauncher calls AbstractTestTask.setIgnoreFailures(true) which makes the build pass even if the test failed. This is an unexpected behavior compared to the BuildLauncher as users do expect build failures.

The failures were ignored in order not to stop the execution when a test task failed. At the same time, the client can always run the build with the `--continue` flag and have the same behavior.

Fixes #26195

TODO
- [x] Mention this in the release notes as a potential breaking change

Co-authored-by: Donát Csikós <donat@gradle.com>
bot-gradle added a commit that referenced this issue Sep 1, 2023
…r more uniform

The TestLauncher calls AbstractTestTask.setIgnoreFailures(true) which makes the build pass even if the test failed. This is an unexpected behavior compared to the BuildLauncher as users do expect build failures.

The failures were ignored in order not to stop the execution when a test task failed. At the same time, the client can always run the build with the `--continue` flag and have the same behavior.

Fixes #26195

TODO
- [x] Mention this in the release notes as a potential breaking change

Co-authored-by: Donát Csikós <donat@gradle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant