Skip to content

Commit

Permalink
fix(wrangler): fix failing R2 e2e test (#7203)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmenPopoviciu authored Nov 8, 2024
1 parent e221401 commit 09bf6b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/wrangler/e2e/helpers/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export function normalizeOutput(
removeWorkersDev,
removeWorkerPreviewUrl,
removeUUID,
removeBinding,
normalizeErrorMarkers,
replaceByte,
stripTrailingWhitespace,
Expand Down Expand Up @@ -62,12 +63,19 @@ function removeTimestamp(str: string) {
.replace(/\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d+?Z/g, "TIMESTAMP")
.replace(/\d\d:\d\d:\d\d/g, "TIMESTAMP");
}

function removeUUID(str: string) {
return str.replace(
/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/g,
"00000000-0000-0000-0000-000000000000"
);
}
function removeBinding(str: string) {
return str.replace(
/\w{8}_\w{4}_\w{4}_\w{4}_\w{12}/g,
"00000000_0000_0000_0000_000000000000"
);
}

/**
* Remove the Wrangler version/update check header
Expand Down
6 changes: 5 additions & 1 deletion packages/wrangler/e2e/r2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ describe("r2", () => {

expect(normalize(output.stdout)).toMatchInlineSnapshot(`
"Creating bucket 'tmp-e2e-r2-00000000-0000-0000-0000-000000000000'...
✅ Created bucket 'tmp-e2e-r2-00000000-0000-0000-0000-000000000000' with default storage class of Standard."
✅ Created bucket 'tmp-e2e-r2-00000000-0000-0000-0000-000000000000' with default storage class of Standard.
Configure your Worker to write objects to this bucket:
[[r2_buckets]]
bucket_name = "tmp-e2e-r2-00000000-0000-0000-0000-000000000000"
binding = "tmp_e2e_r2_00000000_0000_0000_0000_000000000000""
`);
});

Expand Down

0 comments on commit 09bf6b8

Please sign in to comment.