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

junitrunner: Report suppressed and ignored tests as skipped. #13717

Closed
wants to merge 1 commit into from

Conversation

benjaminp
Copy link
Collaborator

@benjaminp benjaminp commented Jul 19, 2021

Fixes #6688
(after java tools release)

@google-cla
Copy link

google-cla bot commented Jul 19, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Jul 19, 2021
@benjaminp benjaminp force-pushed the skip-test-reporting branch from e873a47 to 91e8a87 Compare July 19, 2021 23:27
@google-cla
Copy link

google-cla bot commented Jul 19, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@benjaminp benjaminp force-pushed the skip-test-reporting branch from 91e8a87 to 61158a5 Compare July 19, 2021 23:34
@google-cla
Copy link

google-cla bot commented Jul 19, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@benjaminp benjaminp force-pushed the skip-test-reporting branch from 61158a5 to ef8b27c Compare July 20, 2021 00:57
@google-cla google-cla bot added cla: yes and removed cla: no labels Jul 20, 2021
@meisterT meisterT requested a review from comius July 20, 2021 20:19
Comment on lines 121 to 138
TestSuiteNode parent = createTestSuite();
TestCaseNode skipped = createTestCase(parent);
skipped.started(testInstant(Instant.ofEpochMilli(1)));
skipped.testSkipped(testInstant(Instant.ofEpochMilli(2)));
TestCaseNode suppressed = createTestCase(parent);
suppressed.testSuppressed(testInstant(Instant.ofEpochMilli(4)));
resultWriter.writeTestSuites(writer, root.getResult());
Document document = parseXml(stringWriter.toString());
NodeList caseElems = document.getElementsByTagName("testcase");
assertThat(caseElems.getLength()).isEqualTo(2);
for (int i = 0; i < 2; i++) {
Element caseElem = (Element) caseElems.item(i);
NodeList skippedElems = caseElem.getElementsByTagName("skipped");
System.out.println(stringWriter.toString());
assertThat(skippedElems.getLength()).isEqualTo(1);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please break the test into three blocks: arrange (setting things up), act (running), assert (verifying results). Separate each block with an empty line.
Remove System.out.println.

@benjaminp benjaminp force-pushed the skip-test-reporting branch from ef8b27c to 0609ee4 Compare July 21, 2021 05:57
@bazel-io bazel-io closed this in 45092bb Jul 21, 2021
@benjaminp benjaminp deleted the skip-test-reporting branch July 21, 2021 14:25
@or-shachar
Copy link
Contributor

YEY! :) ❤️

@Yannic
Copy link
Contributor

Yannic commented Jun 24, 2022

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Jun 24, 2022
@Yannic
Copy link
Contributor

Yannic commented Jun 24, 2022

Eh, wait. This should already be in Bazel 5.

@ckolli5
Copy link

ckolli5 commented Jun 27, 2022

@bazel-io fork 5.3.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Jun 27, 2022
@ckolli5
Copy link

ckolli5 commented Jun 28, 2022

@Yannic Yes, this change is already present. Closing the forked issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

java_test does not report about skipped tests
6 participants