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

feat: BuildPulse flaky test detection #11967

Merged
merged 16 commits into from
Feb 24, 2022
Merged

feat: BuildPulse flaky test detection #11967

merged 16 commits into from
Feb 24, 2022

Conversation

janpio
Copy link
Member

@janpio janpio commented Feb 21, 2022

This PR adds BuildPulse integration to our test GitHub Actions workflow:

Automatically detect flaky tests. Focus on the top offenders to quickly improve your builds. Save developer time and frustration. Regain trust in your test suite.

That sounds like something we can use right now.

Currently it adds the reporter only to our no-docker MacOS runs, where I think we have the most flaky tests right now.

To make the BuildPulse integration smoother, I also extracted the Client tests from the current no-docker job into a no-docker-client at the cost of adding 4 jobs per workflow run. I think that is worth it to get a result quicker. (Along the way I resorted our jest.config.jss to be the same order of properties)

PS: BuildPulse is currently working on a Windows reporter, as soon as that is available we can also add it for the Windows matrix runs. If Buildpulse turns out to work correctly, we can also add the reporting to our other Linux jobs of course.

Thanks @jasonrudolph for the concierge service with this.

janpio and others added 2 commits February 21, 2022 23:09
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Copy link
Contributor

@jasonrudolph jasonrudolph left a comment

Choose a reason for hiding this comment

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

👋 @janpio: A couple suggestions to make sure that forks don't run into any issues attempting to upload test results. I hope this helps. If you have any questions, just let me know. 🙇

.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
janpio and others added 2 commits February 22, 2022 18:59
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
@janpio
Copy link
Member Author

janpio commented Feb 22, 2022

The last thing left @jasonrudolph is to get the check for the OS working (before it was always skipped for some reason) until you have the Windows reporter ready (and then we will need to adapt the script to download the correct binary of course). Then I think we would be good for a first merge to get actual test run data.

@jasonrudolph
Copy link
Contributor

@janpio: That sounds right to me. We need to teach these two lines to only run for macOS:

if: startsWith(github.repository, 'prisma/') && !cancelled()

if: startsWith(github.repository, 'prisma/') && !cancelled()

I'll see if I can figure out the right syntax, and I'll let you know what I find out.

Copy link
Contributor

@jasonrudolph jasonrudolph left a comment

Choose a reason for hiding this comment

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

Following up on #11967 (comment), I think these suggestions will do the trick.

It turns out that runner.os has the values documented at https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context, so we need to check for macOS as the value.

If we were using matrix.os, then we'd check for macos-latest as the value.

.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
janpio and others added 2 commits February 23, 2022 20:04
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
Co-authored-by: Jason Rudolph <jason@jasonrudolph.com>
@ghost
Copy link

ghost commented Feb 23, 2022

CodeSee Review Map:

Review these changes using an interactive CodeSee Map

Review in an interactive map

View more CodeSee Maps

Legend

CodeSee Map Legend

@janpio janpio added this to the 3.11.0 milestone Feb 23, 2022
@janpio janpio marked this pull request as ready for review February 23, 2022 19:44
@janpio
Copy link
Member Author

janpio commented Feb 23, 2022

Thanks @jasonrudolph, that worked as intended - in the last commit we have a failure on Windows and one on MacOS - and only the MacOS one triggered the BuildPulse step and successfully reported.

We'll try to review and merge this now and see if we can get BuildPulse to recognize some of these as flaky (vs. currently "always broken" I guess 😛). Then we can also try to add Windows (when you have it working) and Linux via the other builds.

@janpio janpio requested a review from millsp February 23, 2022 19:46
@jasonrudolph
Copy link
Contributor

Thanks @jasonrudolph, that worked as intended

@janpio: That's great! Thanks for taking the time to get things set up. ⚡

Copy link
Member

@millsp millsp left a comment

Choose a reason for hiding this comment

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

Nice, thank you! Let's try this new tool out 🚀

@janpio janpio merged commit 3d07eb6 into main Feb 24, 2022
@janpio janpio deleted the janpio/buildpulse branch February 24, 2022 19:10
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 this pull request may close these issues.

None yet

3 participants