(baseUrl: string)
| 31 | /** Two operations: /ok answers 200, /fail answers 502 — the success and |
| 32 | * expected-upstream-failure outcome classes the telemetry must separate. */ |
| 33 | const upstreamSpec = (baseUrl: string): string => |
| 34 | JSON.stringify({ |
| 35 | openapi: "3.0.3", |
| 36 | info: { title: "Telemetry Upstream", version: "1.0.0" }, |
| 37 | servers: [{ url: baseUrl }], |
| 38 | paths: { |
| 39 | "/ok": { |
| 40 | get: { |
| 41 | operationId: "ok", |
| 42 | summary: "Succeeds", |
| 43 | tags: ["probe"], |
| 44 | responses: { "200": { description: "" } }, |
| 45 | }, |
| 46 | }, |
| 47 | "/fail": { |
| 48 | get: { |
| 49 | operationId: "fail", |
| 50 | summary: "Always 502", |
| 51 | tags: ["probe"], |
| 52 | responses: { "200": { description: "" } }, |
| 53 | }, |
| 54 | }, |
| 55 | }, |
| 56 | }); |
| 57 | |
| 58 | /** A real upstream on 127.0.0.1: /ok → 200 JSON, anything else → 502 JSON. */ |
| 59 | const serveUpstream = Effect.acquireRelease( |
no outgoing calls
no test coverage detected