Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Report mixed tests as success in junit if the last iteration passed#280

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tylervick merged 1 commit intoXCTestHTMLReport:mainfromacecilia:main
Sep 2, 2022

Conversation

@acecilia
Copy link
Contributor

@aceciliaacecilia commentedAug 26, 2022
edited
Loading

👋

This PR introduces thesystem-err XML tag for the junit report. You can see how this is used by the teamcity junit parserhere.

This way, now when there are multiple iterations of a test, the final result of the test is the status of its last iteration. For example, having two iterations:

  • If the first succeeds, test is shown as passed
  • If the first fails and the second succeeds, test is shown as passed
  • If both fail, test is shown as failed

Failed iterations that are not the last one are reported using thesystem-err tag.

I would say this makes more sense than previous implementation, as usually when you have multiple iterations of a test is to fight against flakiness.

See for example how this looks after teamcity parses the junit XML:
In the test history:
Screenshot 2022-08-26 at 11 15 21

In the test log:
Screenshot 2022-08-26 at 11 15 37

I believe that the main issue here is that junit reports do not support reporting multiple iterations of a test 😢

@acecilia
Copy link
ContributorAuthor

acecilia commentedAug 29, 2022
edited
Loading

@tylervick Hey 👋 🙂 Any chance of getting your opinion on this? 🙏

letisLastIteration= index== testCase.iterations.indices.last
results+= iteration
.activities
.map{flatSubActivities(of: $0, indent:0, isFailureFatal: isLastIteration)}
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for this! It's frustrating that Junit doesn't support the "iterations" concept.

My only question - Is there a discernible difference between relying on the last iteration versusany successful iteration period?

For instance, what is the expected outcome when a fixed number of iterations emits mixed results?

Copy link
ContributorAuthor

@aceciliaaceciliaSep 2, 2022
edited
Loading

Choose a reason for hiding this comment

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

Thanks so much for taking the time to review this 🙌

Thanks for this! It's frustrating that Junit doesn't support the "iterations" concept.

Yes 100%. I was looking for a different popular test report format that could support it, but surprisingly I did not find a good candidate. Most iOS tooling relies on junit. Let me know if you know about any alternative :)

Is there a discernible difference between relying on the last iteration versus any successful iteration period?

I would say so. It depends on the expectation a developer has when repeating the execution of a test:

  1. To avoid flakiness: I believe the most common case when running a test more than once, is to avoid flakiness. Example: running UITests, test repetition is a must due to the inherent flakiness of such tests. Under this scenario the most representative outcome of multiple repetitions is the result of the last repetition. Xcodebuild allows this with the flag-retry-tests-on-failure
  2. To detect flakiness: other common usecase is to run a test multiple times with the expectation of detecting if it is flaky. In this case each test is run X times, or until it fails. Under this scenario the most representative outcome of multiple repetitions is the result of the last repetition. This is supported by xcodebuild with the flag-run-tests-until-failure.

For instance, what is the expected outcome when a fixed number of iterations emits mixed results?

This scenario, which is running each test X times despite the outcome, seems to me not very practical and I am not clear on what usecase it has:

  • If the expectation is to show a failed test result if all iterations fail, the option 1 above is more performant
  • If the expectation is to show a failed result if any of the iterations fail, the option 2 above is more performant
  • If the expectation is to show a passed test result if all iterations pass, the option 2 above is more performant
  • If the expectation is to show a passed test result if any of the iterations pass, the option 1 above is more performant

What do you think, are you able to identify any other usecase I am missing?

The way I see it, if we were to make a decision on what iteration is the one that represents better the result of a test with mixed iterations, based on the usecases above I would say is the last iteration

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for the detailed explanation! Completely agree on the two primary use cases for iterations.

FWIW passing-test-iterations without-retry-tests-on-failure or-run-tests-until-failure is what Xcode calls a "fixed number of iterations" in their UI. I agree that it doesn't really make sense here, and especially in the context of a junit report.

acecilia reacted with hooray emoji
@tylervicktylervick merged commit288b3c8 intoXCTestHTMLReport:mainSep 2, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tylervicktylervicktylervick approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@acecilia@tylervick

[8]ページ先頭

©2009-2025 Movatter.jp