-
Notifications
You must be signed in to change notification settings - Fork 673
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
Skip fixture tests #6770
base: main
Are you sure you want to change the base?
Skip fixture tests #6770
Changes from 14 commits
1196a22
433c783
231b793
c8e9cbb
ac7e344
ca30779
fab3a85
a9002d6
d3a5646
f94f31f
9e52378
a753495
240db17
83e5c22
2f5025b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
name: Tests + Checks | ||
|
||
on: pull_request | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
|
||
jobs: | ||
add-to-project: | ||
if: github.ref != 'refs/heads/changeset-release/main' | ||
if: github.head_ref != 'changeset-release/main' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turns out |
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-add-pr | ||
cancel-in-progress: true | ||
|
@@ -15,7 +17,7 @@ jobs: | |
- run: curl -X POST https://devprod-status-bot.devprod.workers.dev/pr-project/workers-sdk/${{ github.event.number }} | ||
|
||
check-non-linux: | ||
if: github.ref == 'refs/heads/changeset-release/main' | ||
if: github.head_ref == 'changeset-release/main' | ||
timeout-minutes: 30 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-checks | ||
|
@@ -89,7 +91,7 @@ jobs: | |
- name: Check the changesets | ||
run: node -r esbuild-register tools/deployments/validate-changesets.ts | ||
|
||
test: | ||
fixtures: | ||
timeout-minutes: 30 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.filter }}-test | ||
|
@@ -100,8 +102,9 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-13] | ||
filter: ["./fixtures/*", "./packages/*", "./tools"] | ||
filter: ["./fixtures/*"] | ||
runs-on: ${{ matrix.os }} | ||
if: github.head_ref == 'changeset-release/main' || contains(github.event.*.labels.*.name, 'fixtures' ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
@@ -126,8 +129,69 @@ jobs: | |
TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html | ||
CI_OS: ${{ runner.os }} | ||
|
||
- name: Run changeset version tests | ||
run: node .github/changeset-version.test.js | ||
- name: Upload debug logs | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: e2e-test-debug-logs-${{ matrix.os }}-${{ matrix.node }} | ||
path: ${{ runner.temp }}/wrangler-debug-logs/ | ||
|
||
- name: Upload test report | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: e2e-test-report-${{ matrix.os }}-${{ matrix.node }} | ||
path: ${{ runner.temp }}/test-report/ | ||
|
||
test: | ||
timeout-minutes: 30 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.filter }}-test | ||
cancel-in-progress: true | ||
|
||
name: "Tests" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-13] | ||
filter: ["./packages/*"] | ||
# Things in the tools folder are for running in CI, and so only need to run on linux | ||
include: | ||
- os: ubuntu-latest | ||
filter: "./tools" | ||
edmundhung marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: dorny/paths-filter@v3 | ||
id: changes | ||
with: | ||
filters: | | ||
everything_but_markdown: | ||
- '!**/*.md' | ||
|
||
Comment on lines
+117
to
+123
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
- name: Install Dependencies | ||
if: steps.changes.outputs.everything_but_markdown == 'true' | ||
uses: ./.github/actions/install-dependencies | ||
with: | ||
turbo-api: ${{ secrets.TURBO_API }} | ||
turbo-team: ${{ secrets.TURBO_TEAM }} | ||
turbo-token: ${{ secrets.TURBO_TOKEN }} | ||
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} | ||
|
||
- name: Run tests | ||
if: steps.changes.outputs.everything_but_markdown == 'true' | ||
run: pnpm run test:ci --concurrency 1 --filter=${{ matrix.filter }} | ||
env: | ||
TMP_CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
TMP_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
NODE_OPTIONS: "--max_old_space_size=8192" | ||
WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ | ||
TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html | ||
CI_OS: ${{ runner.os }} | ||
|
||
- name: Upload debug logs | ||
if: always() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
const assert = require("node:assert"); | ||
const { getNextMiniflareVersion } = require("./changeset-version.js"); | ||
import { expect, it } from "vitest"; | ||
// @ts-expect-error This is a JS file | ||
import { getNextMiniflareVersion } from "../../../.github/changeset-version"; | ||
|
||
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you should be able to import js from ts |
||
// prettier-ignore | ||
const miniflareVersionTestCases = [ | ||
|
@@ -14,24 +15,19 @@ const miniflareVersionTestCases = [ | |
["1.20231008.0", "3.20231001.0", /* major */ "4.0.0", "4.20231008.0"], | ||
]; | ||
|
||
for (const [ | ||
workerdVersion, | ||
previousMiniflareVersion, | ||
miniflareVersion, | ||
correctMiniflareVersion, | ||
] of miniflareVersionTestCases) { | ||
const actual = getNextMiniflareVersion( | ||
it.each(miniflareVersionTestCases)( | ||
"changeset version", | ||
( | ||
workerdVersion, | ||
previousMiniflareVersion, | ||
miniflareVersion | ||
); | ||
assert.strictEqual( | ||
actual, | ||
correctMiniflareVersion, | ||
`Expected "${correctMiniflareVersion}" with ${JSON.stringify({ | ||
miniflareVersion, | ||
correctMiniflareVersion | ||
) => { | ||
const actual = getNextMiniflareVersion( | ||
workerdVersion, | ||
previousMiniflareVersion, | ||
miniflareVersion, | ||
})}, got "${actual}"` | ||
); | ||
} | ||
miniflareVersion | ||
); | ||
expect(actual).toEqual(correctMiniflareVersion); | ||
} | ||
); |
There was a problem hiding this comment.
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 alwayscloudflare
, even for forks