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

file based registry fixtures #6893

Merged
merged 37 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5f3d629
wip
RamIdeas Oct 4, 2024
ab85085
make get-platform-proxy unstable_dev serial not parallel
RamIdeas Oct 4, 2024
3bd1393
repeats: 10
RamIdeas Oct 4, 2024
aee5542
back to original retries: 2 + no repeats
RamIdeas Oct 4, 2024
d881116
re-skip external-durable-object-app fixutre test
RamIdeas Oct 4, 2024
21e5c82
Expand registry e2e tests
penalosa Oct 4, 2024
8433f1e
remove flaky fixtures
penalosa Oct 4, 2024
71ebe38
log stack
penalosa Oct 9, 2024
396c185
Further moves to e2e
penalosa Oct 9, 2024
c8fe691
run less
penalosa Oct 9, 2024
3e4bab9
change test
penalosa Oct 9, 2024
6c30f97
only propogate errors if build not aborted
penalosa Oct 9, 2024
dafc7b2
more logging
penalosa Oct 9, 2024
9f5c3b3
add label
penalosa Oct 9, 2024
f4f3620
split up more
penalosa Oct 9, 2024
45591c2
add more connection logging
penalosa Oct 9, 2024
5da7347
more robust matching
penalosa Oct 9, 2024
caba0b2
remove ordering requirements
penalosa Oct 9, 2024
61df041
first time pass?
penalosa Oct 9, 2024
1e88cf7
skip more windows
penalosa Oct 9, 2024
90a22c0
debug log stack
penalosa Oct 9, 2024
7a452d2
more tests
penalosa Oct 10, 2024
c1541e2
snapshots
penalosa Oct 10, 2024
6b5860a
snapshots
penalosa Oct 10, 2024
19ee28d
optional tee
penalosa Oct 10, 2024
70eadc2
fix bundle controller race condition
penalosa Oct 10, 2024
47de140
tee opt-in
penalosa Oct 10, 2024
d1fd7bc
more fixes
penalosa Oct 10, 2024
8b2ecd3
no only
penalosa Oct 10, 2024
57fd9f6
increase timeout
penalosa Oct 10, 2024
388a424
readUntil -> waitFor
penalosa Oct 10, 2024
a75526f
more logging
penalosa Oct 10, 2024
1dea6af
increase timeout
penalosa Oct 10, 2024
6daac0c
no more teeing
penalosa Oct 10, 2024
754b2f1
Apply suggestions from code review
penalosa Oct 14, 2024
5973742
Update packages/wrangler/src/config/index.ts
penalosa Oct 14, 2024
66b0916
fix formatting
penalosa Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 34 additions & 51 deletions fixtures/entrypoints-rpc-tests/tests/entrypoints.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function waitFor<T>(callback: Parameters<typeof vi.waitFor<T>>[0]) {

const test = baseTest.extend<{
tmpPath: string;
isolatedDevRegistryPort: number;
isolatedDevRegistryPath: string;
dev: StartDevSession;
}>({
// Fixture for creating a temporary directory
Expand All @@ -53,17 +53,14 @@ const test = baseTest.extend<{
await fs.rm(tmpPath, { recursive: true, maxRetries: 10 });
},
// Fixture for starting an isolated dev registry server on a random port
async isolatedDevRegistryPort({}, use) {
// Start a standalone dev registry server for each test
const result = await unstable_startWorkerRegistryServer(0);
const address = result.server.address();
assert(typeof address === "object" && address !== null);
await use(address.port);
await result.terminator.terminate();
async isolatedDevRegistryPath({}, use) {
const tmpPath = await fs.realpath(await fs.mkdtemp(tmpPathBase));
await use(tmpPath);
await fs.rm(tmpPath, { recursive: true, maxRetries: 10 });
},
// Fixture for starting a worker in a temporary directory, using the test's
// isolated dev registry
async dev({ tmpPath, isolatedDevRegistryPort }, use) {
async dev({ tmpPath, isolatedDevRegistryPath }, use) {
const workerTmpPathBase = path.join(tmpPath, "worker-");
const cleanups: (() => Promise<unknown>)[] = [];

Expand All @@ -77,13 +74,13 @@ const test = baseTest.extend<{
workerPath,
pagesPublicPath,
["--port=0", "--inspector-port=0", ...(flags ?? [])],
{ WRANGLER_WORKER_REGISTRY_PORT: String(isolatedDevRegistryPort) }
{ WRANGLER_REGISTRY_PATH: String(isolatedDevRegistryPath) }
);
} else {
session = await runWranglerDev(
workerPath,
["--port=0", "--inspector-port=0", ...(flags ?? [])],
{ WRANGLER_WORKER_REGISTRY_PORT: String(isolatedDevRegistryPort) }
{ WRANGLER_REGISTRY_PATH: String(isolatedDevRegistryPath) }
);
}

Expand Down Expand Up @@ -664,7 +661,7 @@ test("should support binding to Durable Object in same worker with explicit scri

test("should throw if binding to named entrypoint exported by version of wrangler without entrypoints support", async ({
dev,
isolatedDevRegistryPort,
isolatedDevRegistryPath,
}) => {
// Start entry worker first, so the server starts with a stubbed service not
// found binding
Expand Down Expand Up @@ -692,26 +689,19 @@ test("should throw if binding to named entrypoint exported by version of wrangle
'[wrangler] Couldn\'t find `wrangler dev` session for service "bound" to proxy to'
);

// Simulate starting up the bound worker with an old version of Wrangler
response = await fetch(
`http://127.0.0.1:${isolatedDevRegistryPort}/workers/bound`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
protocol: "http",
mode: "local",
port: 0,
host: "localhost",
durableObjects: [],
durableObjectsHost: "localhost",
durableObjectsPort: 0,
// Intentionally omitting `entrypointAddresses`
}),
}
await writeFile(
path.join(isolatedDevRegistryPath, "bound"),
JSON.stringify({
protocol: "http",
mode: "local",
port: 0,
host: "localhost",
durableObjects: [],
durableObjectsHost: "localhost",
durableObjectsPort: 0,
// Intentionally omitting `entrypointAddresses`
})
);
expect(response.status).toBe(200);
expect(await response.text()).toBe("null");

// Wait for error to be thrown
await waitFor(() => {
Expand Down Expand Up @@ -828,7 +818,7 @@ test("should support binding to wrangler session listening on HTTPS", async ({

test("should throw if binding to version of wrangler without entrypoints support over HTTPS", async ({
dev,
isolatedDevRegistryPort,
isolatedDevRegistryPath,
}) => {
// Start entry worker first, so the server starts with a stubbed service not
// found binding
Expand All @@ -854,26 +844,19 @@ test("should throw if binding to version of wrangler without entrypoints support
'[wrangler] Couldn\'t find `wrangler dev` session for service "bound" to proxy to'
);

// Simulate starting up the bound worker using HTTPS with an old version of Wrangler
response = await fetch(
`http://127.0.0.1:${isolatedDevRegistryPort}/workers/bound`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
protocol: "https",
mode: "local",
port: 0,
host: "localhost",
durableObjects: [],
durableObjectsHost: "localhost",
durableObjectsPort: 0,
// Intentionally omitting `entrypointAddresses`
}),
}
await writeFile(
path.join(isolatedDevRegistryPath, "bound"),
JSON.stringify({
protocol: "https",
mode: "local",
port: 0,
host: "localhost",
durableObjects: [],
durableObjectsHost: "localhost",
durableObjectsPort: 0,
// Intentionally omitting `entrypointAddresses`
})
);
expect(response.status).toBe(200);
expect(await response.text()).toBe("null");

// Wait for error to be thrown
await waitFor(() => {
Expand Down
21 changes: 0 additions & 21 deletions fixtures/external-durable-objects-app/a/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions fixtures/external-durable-objects-app/a/wrangler.toml

This file was deleted.

8 changes: 0 additions & 8 deletions fixtures/external-durable-objects-app/b/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions fixtures/external-durable-objects-app/b/wrangler.toml

This file was deleted.

8 changes: 0 additions & 8 deletions fixtures/external-durable-objects-app/c/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions fixtures/external-durable-objects-app/c/wrangler.toml

This file was deleted.

8 changes: 0 additions & 8 deletions fixtures/external-durable-objects-app/d/functions/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions fixtures/external-durable-objects-app/d/package.json

This file was deleted.

1 change: 0 additions & 1 deletion fixtures/external-durable-objects-app/d/public/index.html

This file was deleted.

21 changes: 0 additions & 21 deletions fixtures/external-durable-objects-app/package.json

This file was deleted.

91 changes: 0 additions & 91 deletions fixtures/external-durable-objects-app/tests/index.test.ts

This file was deleted.

8 changes: 0 additions & 8 deletions fixtures/external-durable-objects-app/tests/tsconfig.json

This file was deleted.

10 changes: 0 additions & 10 deletions fixtures/external-durable-objects-app/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions fixtures/external-durable-objects-app/vitest.config.mts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading