mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-20 01:11:18 +00:00
test: remove duplicate and theatrical tests (#2912)
Remove 8 tests that checked constant equality (DEFAULT_DROPLET_SIZE, DEFAULT_DO_REGION, DEFAULT_MACHINE_TYPE, DEFAULT_ZONE, DEFAULT_SERVER_TYPE, DEFAULT_LOCATION) across digitalocean/gcp/hetzner cov files — these tests just hardcode the same string twice and break if the default is changed for a valid reason. Also remove 2 sleep() tests from ssh-cov.test.ts: sleep() is a trivial setTimeout wrapper with no logic, and the timing test added 50ms of real wall time per run. Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
This commit is contained in:
parent
0e17461fcd
commit
69a0d476a0
4 changed files with 2 additions and 51 deletions
|
|
@ -34,17 +34,6 @@ describe("digitalocean/getConnectionInfo", () => {
|
|||
});
|
||||
});
|
||||
|
||||
// ─── Constants ───────────────────────────────────────────────────────────────
|
||||
|
||||
describe("digitalocean/constants", () => {
|
||||
it("DEFAULT_DROPLET_SIZE is s-2vcpu-2gb", () => {
|
||||
expect(DEFAULT_DROPLET_SIZE).toBe("s-2vcpu-2gb");
|
||||
});
|
||||
it("DEFAULT_DO_REGION is nyc3", () => {
|
||||
expect(DEFAULT_DO_REGION).toBe("nyc3");
|
||||
});
|
||||
});
|
||||
|
||||
// ─── promptDropletSize ───────────────────────────────────────────────────────
|
||||
|
||||
describe("digitalocean/promptDropletSize", () => {
|
||||
|
|
|
|||
|
|
@ -82,17 +82,6 @@ describe("gcp/getConnectionInfo", () => {
|
|||
});
|
||||
});
|
||||
|
||||
// ─── Constants ───────────────────────────────────────────────────────────────
|
||||
|
||||
describe("gcp/constants", () => {
|
||||
it("DEFAULT_MACHINE_TYPE is e2-medium", () => {
|
||||
expect(DEFAULT_MACHINE_TYPE).toBe("e2-medium");
|
||||
});
|
||||
it("DEFAULT_ZONE is us-central1-a", () => {
|
||||
expect(DEFAULT_ZONE).toBe("us-central1-a");
|
||||
});
|
||||
});
|
||||
|
||||
// ─── promptMachineType ───────────────────────────────────────────────────────
|
||||
|
||||
describe("gcp/promptMachineType", () => {
|
||||
|
|
|
|||
|
|
@ -40,17 +40,6 @@ describe("hetzner/getConnectionInfo", () => {
|
|||
});
|
||||
});
|
||||
|
||||
// ─── Constants ───────────────────────────────────────────────────────────────
|
||||
|
||||
describe("hetzner/constants", () => {
|
||||
it("DEFAULT_SERVER_TYPE is cx23", () => {
|
||||
expect(DEFAULT_SERVER_TYPE).toBe("cx23");
|
||||
});
|
||||
it("DEFAULT_LOCATION is nbg1", () => {
|
||||
expect(DEFAULT_LOCATION).toBe("nbg1");
|
||||
});
|
||||
});
|
||||
|
||||
// ─── promptServerType ────────────────────────────────────────────────────────
|
||||
|
||||
describe("hetzner/promptServerType", () => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* ssh-cov.test.ts — Coverage tests for shared/ssh.ts
|
||||
*
|
||||
* Covers: spawnInteractive, sleep, startSshTunnel,
|
||||
* Covers: spawnInteractive, startSshTunnel,
|
||||
* waitForSsh, SSH_BASE_OPTS, SSH_INTERACTIVE_OPTS
|
||||
*/
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ import * as net from "node:net";
|
|||
// Suppress stderr during tests — restored in afterAll to avoid contamination
|
||||
let stderrSpy: ReturnType<typeof spyOn>;
|
||||
|
||||
const { spawnInteractive, sleep, startSshTunnel, waitForSsh, SSH_BASE_OPTS, SSH_INTERACTIVE_OPTS } = await import(
|
||||
const { spawnInteractive, startSshTunnel, waitForSsh, SSH_BASE_OPTS, SSH_INTERACTIVE_OPTS } = await import(
|
||||
"../shared/ssh.js"
|
||||
);
|
||||
|
||||
|
|
@ -134,22 +134,6 @@ describe("spawnInteractive", () => {
|
|||
});
|
||||
});
|
||||
|
||||
// ── sleep ──────────────────────────────────────────────────────────────
|
||||
|
||||
describe("sleep", () => {
|
||||
it("resolves after the specified delay", async () => {
|
||||
const start = Date.now();
|
||||
await sleep(50);
|
||||
const elapsed = Date.now() - start;
|
||||
expect(elapsed).toBeGreaterThanOrEqual(40);
|
||||
});
|
||||
|
||||
it("resolves with undefined", async () => {
|
||||
const result = await sleep(1);
|
||||
expect(result).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
// ── startSshTunnel ─────────────────────────────────────────────────────
|
||||
|
||||
describe("startSshTunnel", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue