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

Test fixups & skip tests for docs changes #6770

Merged
merged 16 commits into from
Oct 2, 2024
Merged

Conversation

penalosa
Copy link
Contributor

@penalosa penalosa commented Sep 19, 2024

What this PR solves / how to test

Fixes #6685

  • Fixup tests to not run E2E tests on forks
  • Only run normal tests when a non-markdown file has been changed (example PR: Update README.md #6774)

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because: workflows change
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: workflows change
  • Changeset (Changeset guidelines)
    • TODO (before merge)
    • Changeset included
    • Changeset not necessary because: this shouldn't trigger a release
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: workflows change

Copy link

changeset-bot bot commented Sep 19, 2024

⚠️ No Changeset found

Latest commit: 9af85e3

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

Copy link
Contributor

github-actions bot commented Sep 19, 2024

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/11124819674/npm-package-wrangler-6770

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11124819674/npm-package-wrangler-6770 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11124819674/npm-package-create-cloudflare-6770 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11124819674/npm-package-cloudflare-kv-asset-handler-6770
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11124819674/npm-package-miniflare-6770
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11124819674/npm-package-cloudflare-pages-shared-6770
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11124819674/npm-package-cloudflare-vitest-pool-workers-6770
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11124819674/npm-package-cloudflare-workers-editor-shared-6770
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11124819674/npm-package-cloudflare-workers-shared-6770

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


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240925.0
workerd 1.20240925.0 1.20240925.0
workerd --version 1.20240925.0 2024-09-25

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

@@ -14,7 +14,7 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }}
cancel-in-progress: true
timeout-minutes: 40
if: github.repository_owner == 'cloudflare' && (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.*.labels.*.name, 'e2e' )))
if: (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.*.labels.*.name, 'e2e' ) && github.event.pull_request.head.repo.owner.login == 'cloudflare'))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out repository_owner is always cloudflare, even for forks


jobs:
add-to-project:
if: github.ref != 'refs/heads/changeset-release/main'
if: github.head_ref != 'changeset-release/main'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out github.ref for pull_request events refers to the pull request ref (e.g. refs/6770/merge)

os: [ubuntu-latest, windows-latest, macos-13]
filter: ["./fixtures/*"]
runs-on: ${{ matrix.os }}
if: github.head_ref == 'changeset-release/main' || contains(github.event.*.labels.*.name, 'fixtures' )
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the pertinent change—only run fixtures if the fixtures label is applied

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we auto-apply this label under certain circumstances?

eg. when the fixtures dir has been touched, when wrangler/src has been touched, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +168 to +174
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
everything_but_markdown:
- '!**/*.md'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only run the remaining tests if a non-markdown file was changed, allowing e.g. README fixes to be light on CI time

@penalosa penalosa mentioned this pull request Sep 19, 2024
12 tasks
@penalosa penalosa marked this pull request as ready for review September 19, 2024 13:40
@penalosa penalosa requested a review from a team as a code owner September 19, 2024 13:40
.github/workflows/test-and-check.yml Outdated Show resolved Hide resolved
.github/workflows/test-and-check.yml Outdated Show resolved Hide resolved
@petebacondarwin
Copy link
Contributor

Only run fixture tests when the fixtures label is applied (or on Version Packages)

I think this is dangerous. There are a lot of very useful tests in fixtures that actually test significant functionality.
But perhaps what we need to do is pull those tests out of fixtures and put them somewhere else if we are going to not both running the tests on most PRs.

@penalosa
Copy link
Contributor Author

There are a lot of very useful tests in fixtures that actually test significant functionality.

They're also really flaky, though. In most cases (especially from forks where the turbo cache isn't available) I think any signal in fixtures is lost to the noise of flakes. We'll still be running them on Version Packages, so we won't be releasing with fixture failures. Of course, this might end up in loads of things needing to be reverted/fixed in Version Packages, but if that's the case we can revisit things—it seems like it's worth a try to make opening PRs and contributing smoother?

@petebacondarwin
Copy link
Contributor

Could we then only skip the flaky ones if this label is not applied?

@penalosa
Copy link
Contributor Author

Could we then only skip the flaky ones if this label is not applied?

And keep the rest running? That could work

Comment on lines +2 to +3
// @ts-expect-error This is a JS file
import { getNextMiniflareVersion } from "../../../.github/changeset-version";
Copy link
Contributor

Choose a reason for hiding this comment

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

you should be able to import js from ts

@penalosa penalosa changed the title Skip fixture tests Test fixups & skip tests for docs changes Oct 1, 2024
@penalosa penalosa merged commit 9e977b5 into main Oct 2, 2024
20 of 22 checks passed
@penalosa penalosa deleted the penalosa/skip-fixtures branch October 2, 2024 10:30
@penalosa penalosa mentioned this pull request Oct 8, 2024
12 tasks
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.

add support for skipping required checks
4 participants