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

Refine how repeated tests are tracked #51

Open
mokagio opened this issue Mar 2, 2023 · 2 comments
Open

Refine how repeated tests are tracked #51

mokagio opened this issue Mar 2, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mokagio
Copy link
Contributor

mokagio commented Mar 2, 2023

Recently we had to take on some tech debt and enable test repetition in our unit tests to cope with the noise introduced by a few flaky tests.

If a test fails, xcodebuild will retry it up to 3 times. This is usually enough to compensate for the flakiness and obtain the successful test necessary for the whole test suite to be considered successful.

At the Test Analytics level, however, the build appears as a failure. See purple annotation in the screenshot below:

image

(Apologies for the arrow noise in the screenshot. I annotated it to service two issue in one go, the other one being #52.)

What I think is going on is that the test failures are collected and reported, correctly, but the library does not account for retries.

In a sense, I like how failures are always reported because it doesn't let flaky tests off the hook.
However, this paints a somewhat inconsistent picture between the success graph of the pipeline which is all green and that of the analytics which is all red.

It would be great if Test Analytics could detect automatic retries like the one Xcode allows for.

One idea could to track all the tests so that the reliability ratio is accurate at the Test Analytics end, but use the Xcode test report to determine whether a test run was ultimately successful or not.

I could buy into a radical "if a test failed, even just once, the build failed" approach. However, I fear that would be confusing for users who are not aware of test repetition.

@mokagio mokagio added the enhancement New feature or request label Mar 2, 2023
@iampatbrown
Copy link
Collaborator

iampatbrown commented Mar 20, 2023

@mokagio I'm on board with what you're saying.

One idea could to track all the tests so that the reliability ratio is accurate at the Test Analytics end, but use the Xcode test report to determine whether a test run was ultimately successful or not.

There has been discussion around this and I believe it's planned for the future.

I could buy into a radical "if a test failed, even just once, the build failed" approach. However, I fear that would be confusing for users who are not aware of test repetition.

I believe some flexibility is important here. People need the information that helps them, which might be different for each person. I think the main challenge is supporting multiple platforms that have different vocabulary/approaches when it comes to testing.

I'm not sure how much progress we can make on this one right now, but, it will definitely be addressed at some point :)

@kelly-scalapay
Copy link

Having the same issue with test-collector-javascript

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

No branches or pull requests

3 participants