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

[Feature request] Include tests marked with @org.junit.Ignore in JUnitReport.xml #629

Closed
plnice opened this issue Jan 9, 2020 · 4 comments · Fixed by #648
Closed

[Feature request] Include tests marked with @org.junit.Ignore in JUnitReport.xml #629

plnice opened this issue Jan 9, 2020 · 4 comments · Fixed by #648
Assignees
Milestone

Comments

@plnice
Copy link

plnice commented Jan 9, 2020

We often use @org.junit.Ignore annotation to mark tests we plan to fix later. When we are doing multiple changes in the specific area and we predict that some other changes will happen very soon and will break the tests again, for us it's better to mark the test as ignored for some time and go back to it when all the changes are introduced.

Such tests are (correctly) not taken into account when running test suite on FTL. However, we'd like to include ignored tests in JUnitReport.xml so that our CI environment (when the XML report gets parsed) can present ignored tests. In such way we can track which tests were ignored in the given test run.

The end result could be similar to how regular Android unit tests report looks like - sometimes we also have some unit tests marked with @Ignore, they land in the XML report and are correctly parsed by the CI.

@plnice
Copy link
Author

plnice commented Jan 10, 2020

Here's an example of an Android unit test results XML with one test marked with @Ignore:

<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="8" skipped="1" failures="0" errors="0" ...>
  ...
  <testcase name="testName" classname="com.test.ClassName" time="0.0">
    <skipped/>
  </testcase>
  ...
</testsuite>

@pawelpasterz pawelpasterz reopened this Feb 26, 2020
@pawelpasterz pawelpasterz self-assigned this Mar 1, 2020
@pawelpasterz
Copy link
Contributor

pawelpasterz commented Mar 1, 2020

@plnice Thanks for pointing this out!

@bootstraponline, current flank implementation filters tests annotated with @Ignore while creating test matrices (they are not sent to TL). As I see it, TL skips ignored tests anyway but they are included in the final report.

My proposal is to introduce new flag, --include-ignored, which would be false by default. User will decide if ignored tests are needed within final xml results, or not.

Let me know what you think.

@bootstraponline
Copy link
Contributor

@pawelpasterz I think Flank already has many flags, ideally we'll look to change default behavior when possible. For this specific use case, it's probably best to always include ignored tests in the JUnit XML. I believe JUnit does this by default for local runs.

@pawelpasterz
Copy link
Contributor

@pawelpasterz I think Flank already has many flags, ideally we'll look to change default behavior when possible. For this specific use case, it's probably best to always include ignored tests in the JUnit XML. I believe JUnit does this by default for local runs.

Sounds like a plan, thanks for answer

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 a pull request may close this issue.

3 participants