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

C3: Better e2e quarantine dx #4096

Merged
merged 8 commits into from
Oct 10, 2023
Merged

C3: Better e2e quarantine dx #4096

merged 8 commits into from
Oct 10, 2023

Conversation

jculvey
Copy link
Contributor

@jculvey jculvey commented Oct 3, 2023

What this PR solves / how to test:

This PR seeks to improve the dev experience around quarantined e2e tests. Quarantine tests fail sometimes, by design, and this can be confusing if you aren't engaged in c3 development day to day. Ideally, we'd have a system where tests could fail, but we would still get the green check mark that lets us know things are good to merge.

Unfortunately Github Actions doesn't support a allow-failure option for jobs. It's a feature that's been heavily requested (see here and here), though it doesn't appear that Github plans to implement this feature.

This change makes it so that quarantine runs are only performed on merge to master, so PR authors won't see confusing failed builds.

I've also refactored the runCliWithDeploy logic to reduce duplication between quarantined/not-quarantined runs.

Associated docs issue(s)/PR(s):

  • [insert associated docs issue(s)/PR(s)]

Author has included the following, where applicable:

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

@jculvey jculvey requested review from a team as code owners October 3, 2023 20:22
@changeset-bot
Copy link

changeset-bot bot commented Oct 3, 2023

⚠️ No Changeset found

Latest commit: 7073f53

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jculvey jculvey changed the title C3: Catch errors in quarantined e2e tests C3: Better e2e quarantine dx Oct 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6460178561/npm-package-wrangler-4096

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6460178561/npm-package-wrangler-4096

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6460178561/npm-package-wrangler-4096 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6460178561/npm-package-cloudflare-pages-shared-4096

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.11.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20231002.1 3.20231002.1
workerd 1.20231002.0 1.20231002.0
workerd --version 1.20231002.0 2023-10-02

|

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Tentative approval, I both like and dislike the idea of always passing the tests, at the very least I think it might be worth a try, but hopefully we can keep an eye on the quarantined tests and try to remove them from the quarantine when possible

testCommitMessage: true,
},
gatsby: {
quarantine: true,
Copy link
Member

Choose a reason for hiding this comment

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

does gatsby need to be quarantined? I thought you made it better 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's better but not better enough quite yet. It's failing somewhat consistently with bun atm and I need to debug why. Don't worry, clearing out the quarantine is next on my list of things to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took it out of quarantine in another PR: https://github.com/cloudflare/workers-sdk/pull/4120/files

@petebacondarwin
Copy link
Contributor

If we are going to move the e2e quarantined tests to main branch pushes only, then perhaps this PR is not really needed any more?
By the way, I wondered if we could get retries and green-on-failure by adding another step after the two potentially failing steps that just says all is fine?

@jculvey
Copy link
Contributor Author

jculvey commented Oct 9, 2023

If we are going to move the e2e quarantined tests to main branch pushes only, then perhaps this PR is not really needed any more?

This pr contains the changes to run quarantine the tests on main only.

Apart from that, I still think there's value in splitting up the workflow into multiple files and creating a common step for running the e2e since it eliminates redundancy b/w the standard and quarantine runs. It also makes it easier for PR authors to navigate all of the tests run on their PR.

If there's particular things that you don't want included can I maybe remove those and keep the bulk of the refactor?

By the way, I wondered if we could get retries and green-on-failure by adding another step after the two potentially failing steps that just says all is fine?

Yup, that sounds like it could work. If we really want to retain retries that might be the way to go. I still think that there's not a ton of value in running retries on quarantined framework, since there's a high likelihood that they'll fail.

@petebacondarwin
Copy link
Contributor

petebacondarwin commented Oct 9, 2023

If we are going to move the e2e quarantined tests to main branch pushes only, then perhaps this PR is not really needed any more?

This pr contains the changes to run quarantine the tests on main only.

Ah! OK. I was confused by this in the PR description:

This change will alter quarantine runs by explicitly catching any errors that occur and reporting it to the user, allowing the test to pass despite it's actual failed state. This allows quarantine runs to pass with all green, but still allows us to inspect the logs to see if quarantined frameworks are actually failing runs.

I don't think we need to make quarantined tests look green if they're not, when they are no longer running on PRs.

@jculvey
Copy link
Contributor Author

jculvey commented Oct 9, 2023

I don't think we need to make quarantined tests look green if they're not, when they are no longer running on PRs.

Fair enough. I just pushed a commit that lets them fail again, with retries.

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Merging #4096 (7073f53) into main (5fc7a88) will increase coverage by 0.29%.
Report is 13 commits behind head on main.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4096      +/-   ##
==========================================
+ Coverage   75.09%   75.39%   +0.29%     
==========================================
  Files         217      223       +6     
  Lines       12077    12203     +126     
  Branches     3128     3154      +26     
==========================================
+ Hits         9069     9200     +131     
+ Misses       3008     3003       -5     

see 36 files with indirect coverage changes

@petebacondarwin petebacondarwin added the e2e Run e2e tests on a PR label Oct 10, 2023
@jculvey jculvey merged commit 44c66ab into main Oct 10, 2023
38 checks passed
@jculvey jculvey deleted the better-quarantine branch October 10, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e tests on a PR
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants