-
Notifications
You must be signed in to change notification settings - Fork 4k
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
JUnit test XML does not include failures in non-declared test #19949
Labels
Comments
hvadehra
added a commit
that referenced
this issue
Oct 27, 2023
This matches the behavior of the maven surefire plugin. Fixes #19949
hvadehra
added a commit
that referenced
this issue
Oct 27, 2023
This matches the behavior of the maven surefire plugin. Fixes #19949
hvadehra
added
P1
I'll work on this now. (Assignee required)
and removed
untriaged
labels
Oct 27, 2023
hvadehra
added a commit
that referenced
this issue
Oct 27, 2023
This matches the behavior of the maven surefire plugin. Fixes #19949
hvadehra
added a commit
that referenced
this issue
Oct 31, 2023
This matches the behavior of the maven surefire plugin. Fixes #19949
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this issue
Oct 31, 2023
This matches the behavior of the maven surefire plugin. Fixes bazelbuild#19949 Closes bazelbuild#19966. PiperOrigin-RevId: 578255510 Change-Id: I2512c387ee63adf054de8af3e19e9ddedc4e368d
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description of the bug:
JUnit 4 runners like Mockito often fires test failures after a test has been done, as in here and here. Unfortunately, since the test description is dynamically created, in Bazel's JUnit test runner
getTest(description)
would return null. So the test failure is ignored and omitted from the JUnit XML file.Ideally, Bazel's JUnit test runner should synthesize a test failure node, even for test cases that are not predeclared.
As an example, here's a sample test from our repository that uses
MockitoJUnitRunner
:Here's the form of the generated XML file:
Notice that
failures
anderrors
are both 0.However, the test log shows one failure:
Which category does this issue belong to?
Java Rules
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
See above for a sample test case. Unfortunately, I don't have a reproducible test case at hand.
Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?release 6.3.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: