Skip to content

Commit 667eedd

Browse files
committed
Parallelize Orbit regression checks
1 parent 1538c4a commit 667eedd

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎.github/workflows/deploy-production.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
find dist/client -type f -print0 \
7373
| sort -z \
7474
| xargs -0 sha256sum > production-assets.sha256
75+
sha256sum dist/worker-production-live/worker.js >> production-assets.sha256
7576
sha256sum --check production-assets.sha256
7677
7778
- name: Upload verified production assets
@@ -80,6 +81,7 @@ jobs:
8081
name: orbit-production-assets-${{ github.sha }}
8182
path: |
8283
dist/client
84+
dist/worker-production-live/worker.js
8385
production-assets.sha256
8486
if-no-files-found: error
8587
include-hidden-files: true
@@ -172,6 +174,8 @@ jobs:
172174
173175
short_sha="${GITHUB_SHA::12}"
174176
npx wrangler deploy \
177+
dist/worker-production-live/worker.js \
178+
--no-bundle \
175179
--config wrangler.production.live.jsonc \
176180
--secrets-file "$oauth_secrets_file" \
177181
--tag "main-${short_sha}" \

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"staging:slice5:images-cpu": "tsx scripts/orbit-slice5-images-cpu-staging-e2e.ts",
2828
"orbit:import:verify": "tsx scripts/orbit-slice3-manifest.ts",
2929
"orbit:import:local": "tsx scripts/orbit-slice3-import.ts --local --database=orbit-v6-local --config=wrangler.test.jsonc",
30-
"test:d1": "tsx --test --test-concurrency=1 scripts/orbit-d1-tests.ts scripts/orbit-public-page-tests.ts scripts/orbit-slice1-tests.ts scripts/orbit-slice1-worker-tests.ts scripts/orbit-slice3-tests.ts scripts/orbit-slice4-tests.ts scripts/orbit-slice5-tests.ts",
30+
"test:d1": "tsx --test --test-concurrency=3 scripts/orbit-d1-tests.ts scripts/orbit-public-page-tests.ts scripts/orbit-slice1-tests.ts scripts/orbit-slice1-worker-tests.ts scripts/orbit-slice3-tests.ts scripts/orbit-slice4-tests.ts scripts/orbit-slice5-tests.ts",
3131
"v6:check": "npm run test:d1 && npm run check && npm run worker:build",
3232
"preview": "astro preview",
3333
"check": "npm run orbit:validate && astro check",

‎scripts/orbit-browser-tests.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ if (errors.length === 0) {
9999
];
100100

101101
try {
102-
for (const viewport of viewports) {
102+
await Promise.all(viewports.map(async (viewport) => {
103103
const label = `${viewport.width}x${viewport.height}`;
104104
const context = await browser.newContext({ viewport, colorScheme: 'light' });
105105
const page = await context.newPage();
@@ -449,7 +449,7 @@ if (errors.length === 0) {
449449

450450
}
451451
await context.close();
452-
}
452+
}));
453453
} finally {
454454
await browser.close();
455455
await new Promise((resolve, reject) => server.close((error) => error ? reject(error) : resolve()));

‎scripts/orbit-production-config-tests.mjs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ assert(
251251
deployWorkflow.includes('sha256sum --check production-assets.sha256'),
252252
'production asset checksum is not verified before deployment',
253253
);
254+
assert(
255+
deployWorkflow.includes('sha256sum dist/worker-production-live/worker.js >> production-assets.sha256')
256+
&& deployWorkflow.includes('dist/worker-production-live/worker.js \\\n --no-bundle'),
257+
'verified Worker bundle is rebuilt instead of being deployed byte-for-byte',
258+
);
254259
assert(
255260
deployWorkflow.includes("test \"$(git rev-parse HEAD)\" = \"$GITHUB_SHA\""),
256261
'deploy job does not verify the exact candidate commit',

0 commit comments

Comments
 (0)