Skip to content

Commit e1ab69d

Browse files
committed
Remove remaining echo-route coverage from isolation/e2e suites (CL-7381)
1 parent aa5ded4 commit e1ab69d

4 files changed

Lines changed: 15 additions & 73 deletions

File tree

‎apps/hub/test/composition.test.ts‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Exercises the hub's own wiring: platform routes answering at boot,
2-
// the echo extension mounted inside the native tenant middleware, and
2+
// an extension route mounted inside the native tenant middleware, and
33
// same-origin static serving. Platform behavior behind the mounted
44
// routes belongs to its own packages and is not re-proven here. Booting
55
// the hub runs package migrations, so a reachable DATABASE_URL is
@@ -122,23 +122,22 @@ describeIfDb("shutdown", () => {
122122
});
123123

124124
describeIfDb("extension mounting", () => {
125-
test("echo mounts inside the native tenant middleware", async () => {
125+
test("chat mounts inside the native tenant middleware", async () => {
126126
const hub = await bootHub();
127127

128-
// Anonymous request to the echo route: the platform's tenant
128+
// Anonymous request to an extension route: the platform's tenant
129129
// middleware answers 401 before the extension's handler runs.
130-
const gated = await hub.app.request("/api/tenants/some-tenant/echo", {
131-
method: "POST",
132-
body: "hello",
133-
});
130+
const gated = await hub.app.request(
131+
"/api/tenants/some-tenant/chat/workbenches",
132+
);
134133
expect(gated.status).toBe(401);
135134
expect(await gated.json()).toEqual({
136135
error: { code: "unauthorized", message: "Authentication required" },
137136
});
138137

139138
// The route exists only under the tenant scope; outside it the
140139
// path falls through to the interface shell.
141-
const outside = await hub.app.request("/echo");
140+
const outside = await hub.app.request("/chat/workbenches");
142141
expect(await outside.text()).toBe("<html>shell</html>");
143142
});
144143

‎scripts/e2e/walking-skeleton.test.ts‎

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// as spawned processes, and a real Postgres named by DATABASE_URL.
44
//
55
// The path proven, hop by hop: database setup → hub boot → sidecar
6-
// dial-in → sign-up → tenant creation → the echo extension route inside
7-
// that tenant → workflow-asset publication over the platform's git
8-
// smart-HTTP surface → the native workflow deploy → the deployment
9-
// answering at its mail address (trigger accepted for delivery).
6+
// dial-in → sign-up → tenant creation → workflow-asset publication over
7+
// the platform's git smart-HTTP surface → the native workflow deploy →
8+
// the deployment answering at its mail address (trigger accepted for
9+
// delivery).
1010
//
1111
// The gate this suite holds is deployment-addressable: the trigger mail
1212
// is minted and accepted (HTTP 202) at the deployment's address. Full
@@ -148,29 +148,6 @@ describe.skipIf(databaseUrl === undefined)("walking skeleton", () => {
148148
return stringField(res.data, "id", "create tenant");
149149
});
150150

151-
// Hop: echo extension route. The one extension the hub mounts,
152-
// reached inside the platform's native tenant middleware: an
153-
// anonymous request is refused, a member's body comes back
154-
// verbatim.
155-
await hop("echo extension route", async () => {
156-
const anonymous = await api(
157-
hub.baseUrl,
158-
"POST",
159-
`/api/tenants/${tenantId}/echo`,
160-
{ probe: true },
161-
);
162-
expectStatus("echo without a session", anonymous, 401);
163-
164-
const body = `hello from the walking skeleton ${crypto.randomUUID()}`;
165-
const res = await fetch(`${hub.baseUrl}/api/tenants/${tenantId}/echo`, {
166-
method: "POST",
167-
headers: { cookie: user.cookies.join("; ") },
168-
body,
169-
});
170-
expect(res.status).toBe(200);
171-
expect(await res.text()).toBe(body);
172-
});
173-
174151
// Hop: workflow asset. The echo workflow definition, built by its
175152
// own package, published as a workflow asset whose source tree
176153
// arrives over the platform's git smart-HTTP surface — the only

‎test/isolation/isolation.test.ts‎

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// gate working rather than dead routes.
88
//
99
// To extend coverage to a new extension, see the registry note in
10-
// surfaces.ts and the echo describe block below.
10+
// surfaces.ts and the "chat workbench move" describe block below for
11+
// the pattern of an extension-specific assertion.
1112

1213
import { afterAll, describe, expect, test } from "bun:test";
1314
import {
@@ -198,35 +199,8 @@ if (!databaseUrl) {
198199

199200
// Extension-specific block — the pattern every future extension
200201
// copies: the generic sweep above already covers its surface entry;
201-
// this block asserts the behavior only that extension has.
202-
describe("echo extension", () => {
203-
test("echoes for a member of the tenant it is mounted under", async () => {
204-
const response = await app.request(
205-
`/api/tenants/${tenantA.tenantId}/echo`,
206-
{
207-
method: "POST",
208-
headers: { cookie: tenantA.cookie, "content-type": "text/plain" },
209-
body: "hello from tenant a",
210-
},
211-
);
212-
expect(response.status).toBe(200);
213-
expect(await response.text()).toBe("hello from tenant a");
214-
});
215-
216-
test("refuses a foreign principal before the handler runs", async () => {
217-
const response = await app.request(
218-
`/api/tenants/${tenantB.tenantId}/echo`,
219-
{
220-
method: "POST",
221-
headers: { cookie: tenantA.cookie, "content-type": "text/plain" },
222-
body: "should never be echoed",
223-
},
224-
);
225-
await expectRefusal(response, 403, "forbidden", tenantB.markers);
226-
// The refusal must come from the platform's tenant gate, not the
227-
// extension: the body is the error envelope, never the echo.
228-
});
229-
});
202+
// a block like this asserts the behavior only that extension has (the
203+
// echo demo agent that used to live here was deleted in CL-7381).
230204

231205
describe("chat workbench move", () => {
232206
/** The `tenancy` annotation `GET .../chat/workbenches` carries for one

‎test/isolation/surfaces.ts‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ export const tenantSurfaces: TenantSurface[] = [
8181
memberStatus: 404,
8282
},
8383
// Extension surfaces. One entry per extension route the hub mounts.
84-
{
85-
name: "echo extension",
86-
method: "POST",
87-
path: (t) => `/api/tenants/${t}/echo`,
88-
body: "isolation-ping",
89-
contentType: "text/plain",
90-
memberStatus: 200,
91-
},
9284
{
9385
// Every workbench is now minted as a child tenant of the bench that
9486
// creates it (see packages/chat/src/workbench-tenancy.ts); this

0 commit comments

Comments
 (0)