From b02fdb8264daf81da421a5df271f755812f5a487 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 26 Apr 2026 23:51:51 +0100 Subject: [PATCH] test(qa): drop brittle telegram workflow assertions --- AGENTS.md | 1 + test/scripts/npm-telegram-live.test.ts | 34 -------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index f7d14637bf3..86b149399f1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -117,6 +117,7 @@ Telegraph style. Root rules only. Read scoped `AGENTS.md` before subtree work. ## Tests - Vitest. Colocated `*.test.ts`; e2e `*.e2e.test.ts`; example models `sonnet-4.6`, `gpt-5.4`. +- Avoid brittle tests that grep workflow/docs strings for operator policy. Prefer executable behavior, parsed config/schema checks, or live run proof; put release/CI policy reminders in AGENTS/docs instead. - Clean timers/env/globals/mocks/sockets/temp dirs/module state; `--isolate=false` safe. - Hot tests: avoid per-test `vi.resetModules()` + heavy imports. Measure with `pnpm test:perf:imports ` / `pnpm test:perf:hotspots --limit N`. - Seam depth: pure helper/contract unit tests; one integration smoke per boundary. diff --git a/test/scripts/npm-telegram-live.test.ts b/test/scripts/npm-telegram-live.test.ts index b721a2f6d08..a5912fb7abc 100644 --- a/test/scripts/npm-telegram-live.test.ts +++ b/test/scripts/npm-telegram-live.test.ts @@ -6,7 +6,6 @@ import { __testing } from "../../scripts/e2e/npm-telegram-live-runner.ts"; const TEST_DIR = path.dirname(fileURLToPath(import.meta.url)); const DOCKER_SCRIPT_PATH = path.resolve(TEST_DIR, "../../scripts/e2e/npm-telegram-live-docker.sh"); -const WORKFLOW_PATH = path.resolve(TEST_DIR, "../../.github/workflows/npm-telegram-beta-e2e.yml"); describe("npm Telegram live Docker E2E", () => { it("supports npm-specific Convex credential aliases", () => { @@ -41,39 +40,6 @@ describe("npm Telegram live Docker E2E", () => { expect(script).toContain('credential_role="ci"'); }); - it("does not require release manager environment approval for the manual npm beta workflow", () => { - const workflow = readFileSync(WORKFLOW_PATH, "utf8"); - - expect(workflow).not.toContain("approve_release_manager:"); - expect(workflow).not.toContain("Approve npm Telegram beta E2E"); - expect(workflow).not.toContain("environment: npm-release"); - expect(workflow).not.toContain("needs: approve_release_manager"); - expect(workflow).toContain("environment: qa-live-shared"); - expect(workflow).not.toContain("Require main workflow ref"); - expect(workflow).not.toContain("refs/heads/main"); - expect(workflow).not.toContain('new Set(["admin", "write"])'); - expect(workflow).not.toContain("data.role_name"); - expect(workflow).not.toContain("github.rest.teams.listMembersInOrg"); - expect(workflow).not.toContain("getMembershipForUserInOrg"); - }); - - it("builds and reuses a local Docker E2E image", () => { - const workflow = readFileSync(WORKFLOW_PATH, "utf8"); - - expect(workflow).not.toContain("prepare_docker_e2e_image:"); - expect(workflow).toContain("run_npm_telegram_beta_e2e:"); - expect(workflow).not.toContain("needs: approve_release_manager"); - expect(workflow).toContain("useblacksmith/setup-docker-builder"); - expect(workflow).toContain("useblacksmith/build-push-action"); - expect(workflow).toContain("tags: openclaw-docker-e2e:local"); - expect(workflow).toContain("load: true"); - expect(workflow).toContain("push: false"); - expect(workflow).not.toContain("cache-from: type=gha"); - expect(workflow).not.toContain("cache-to: type=gha"); - expect(workflow).toContain('OPENCLAW_SKIP_DOCKER_BUILD: "1"'); - expect(workflow).toContain("OPENCLAW_DOCKER_E2E_IMAGE: openclaw-docker-e2e:local"); - }); - it("lets npm-specific credential aliases override shared QA env", () => { expect( __testing.resolveCredentialSource({