Skip to content

Commit

Permalink
fix version preview url snapshot (#6833)
Browse files Browse the repository at this point in the history
  • Loading branch information
RamIdeas authored Sep 26, 2024
1 parent b098256 commit 2384560
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/wrangler/e2e/helpers/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function normalizeOutput(
removeStandardPricingWarning,
npmStripTimings,
removeWorkersDev,
removeWorkerPreviewUrl,
removeUUID,
normalizeErrorMarkers,
replaceByte,
Expand Down Expand Up @@ -43,6 +44,12 @@ function stripDevTimings(stdout: string): string {
return stdout.replace(/\(\dms\)/g, "(TIMINGS)");
}

function removeWorkerPreviewUrl(str: string) {
return str.replace(
/https:\/\/(?<sha>[a-f\d]+)-(?<workerName>.+)-(?<uuid>\w{8}-\w{4}-\w{4}-\w{4}-\w{12})\..+?\.workers\.dev/g,
"https://$2-PREVIEW-URL.SUBDOMAIN.workers.dev"
);
}
function removeWorkersDev(str: string) {
return str.replace(
/https:\/\/(.+?)\..+?\.workers\.dev/g,
Expand Down
3 changes: 3 additions & 0 deletions packages/wrangler/e2e/versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ describe("versions deploy", { timeout: TIMEOUT }, () => {
Worker Startup Time: (TIMINGS)
Uploaded tmp-e2e-worker-00000000-0000-0000-0000-000000000000 (TIMINGS)
Worker Version ID: 00000000-0000-0000-0000-000000000000
Version Preview URL: https://tmp-e2e-worker-PREVIEW-URL.SUBDOMAIN.workers.dev
To deploy this version to production traffic use the command wrangler versions deploy
Changes to non-versioned settings (config properties 'logpush' or 'tail_consumers') take effect after your next deployment using the command wrangler versions deploy
Changes to triggers (routes, custom domains, cron schedules, etc) must be applied with the command wrangler triggers deploy"
Expand Down Expand Up @@ -178,6 +179,7 @@ describe("versions deploy", { timeout: TIMEOUT }, () => {
Worker Startup Time: (TIMINGS)
Uploaded tmp-e2e-worker-00000000-0000-0000-0000-000000000000 (TIMINGS)
Worker Version ID: 00000000-0000-0000-0000-000000000000
Version Preview URL: https://tmp-e2e-worker-PREVIEW-URL.SUBDOMAIN.workers.dev
To deploy this version to production traffic use the command wrangler versions deploy
Changes to non-versioned settings (config properties 'logpush' or 'tail_consumers') take effect after your next deployment using the command wrangler versions deploy
Changes to triggers (routes, custom domains, cron schedules, etc) must be applied with the command wrangler triggers deploy"
Expand Down Expand Up @@ -623,6 +625,7 @@ describe("versions deploy", { timeout: TIMEOUT }, () => {
Worker Startup Time: (TIMINGS)
Uploaded tmp-e2e-worker-00000000-0000-0000-0000-000000000000 (TIMINGS)
Worker Version ID: 00000000-0000-0000-0000-000000000000
Version Preview URL: https://tmp-e2e-worker-PREVIEW-URL.SUBDOMAIN.workers.dev
To deploy this version to production traffic use the command wrangler versions deploy
Changes to non-versioned settings (config properties 'logpush' or 'tail_consumers') take effect after your next deployment using the command wrangler versions deploy
Changes to triggers (routes, custom domains, cron schedules, etc) must be applied with the command wrangler triggers deploy"
Expand Down

0 comments on commit 2384560

Please sign in to comment.