From e8b37be8e31b935a1638f2ad4440d2ef75e21bf7 Mon Sep 17 00:00:00 2001 From: Daniel Saldarriaga Date: Thu, 20 Aug 2026 19:40:01 +0200 Subject: [PATCH] ci: serialize stateful tests --- .github/pull_request_template.md | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 2 +- AGENTS.md | 4 ++-- CONTRIBUTING.md | 6 +++--- README.md | 2 +- package.json | 3 ++- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0cc7e37..9b2cfc6 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -16,7 +16,7 @@ ## Checklist -- [ ] `bun test` passes (new behavior has regression coverage) +- [ ] `bun run test` passes (new behavior has regression coverage) - [ ] `bun run lint` passes - [ ] `bun run typecheck` passes - [ ] `bun run build` passes and `dist/server.js` is committed if server code changed diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bba1e18..a9c87eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: - run: bun install --frozen-lockfile - name: Run tests with coverage run: | - bun test --coverage 2>&1 | tee test-output.log + bun run test:coverage 2>&1 | tee test-output.log - name: Publish coverage summary if: always() run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 86bff0d..aef5f9e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -39,7 +39,7 @@ jobs: - uses: actions/checkout@v6 - uses: oven-sh/setup-bun@v2 - run: bun install --frozen-lockfile - - run: bun test + - run: bun run test publish: name: Publish to npm diff --git a/AGENTS.md b/AGENTS.md index f943038..41dc591 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ Before treating a code change as complete, run the relevant checks. For release- ```bash bun run lint bun run typecheck -bun test +bun run test bun run build bun run pack:dry-run ``` @@ -46,7 +46,7 @@ gh release view v ## End-To-End Plugin Test -To test this plugin end to end, do not stop at unit tests. Run the local gates first: `bun run lint`, `bun run typecheck`, `bun test`, `bun run build`, and `bun run pack:dry-run`. +To test this plugin end to end, do not stop at unit tests. Run the local gates first: `bun run lint`, `bun run typecheck`, `bun run test`, `bun run build`, and `bun run pack:dry-run`. After publishing, verify the exact npm version with `npm view @prevalentware/opencode-goal-plugin version dependencies`. Install that version in an isolated temp OpenCode project with `opencode plugin @prevalentware/opencode-goal-plugin@`, run `opencode debug config` to confirm the package is loaded and the `goal` command is registered, then run a smoke test with an isolated state file, for example: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67a21e7..89d8941 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,8 +19,8 @@ Useful scripts: | Script | What it does | | --- | --- | -| `bun test` | Run the unit test suite | -| `bun test --coverage` | Run tests with a coverage report | +| `bun run test` | Run the unit test suite serially | +| `bun run test:coverage` | Run the serial test suite with a coverage report | | `bun run lint` | ESLint over the repo | | `bun run typecheck` | TypeScript `--noEmit` check | | `bun run build` | Bundle `src/server.ts` into `dist/` | @@ -40,7 +40,7 @@ Useful scripts: 1. Create a topic branch from `main`. 2. Make your change, keeping the existing code style (no semicolons, 130-column lines, strict TypeScript). 3. Add or update tests — behavior changes need regression coverage. -4. Run the local gates: `bun test && bun run lint && bun run typecheck && bun run build`. +4. Run the local gates: `bun run test && bun run lint && bun run typecheck && bun run build`. 5. Commit the rebuilt `dist/server.js` when `src/server.ts` (or its imports) changed — the built file is tracked on purpose. 6. Open a pull request against `main` describing the problem, the approach, and how you verified it. Link the related issue (`Closes #NN`) when one exists. The pull request description must also name the AI model and agent harness used (for example, OpenCode or Claude Code), or explicitly state that the change was made manually. diff --git a/README.md b/README.md index 7c022d3..8c1bed7 100644 --- a/README.md +++ b/README.md @@ -239,7 +239,7 @@ This plugin follows Codex's native goal-mode semantics where OpenCode plugin hoo ```bash bun install -bun test +bun run test bun run lint bun run typecheck bun run build diff --git a/package.json b/package.json index 874b22e..0cc5913 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ "ci:version": "bun scripts/resolve-ci-version.ts", "lint": "eslint .", "pack:dry-run": "npm pack --dry-run", - "test": "bun test", + "test": "bun test --concurrent --max-concurrency 1", + "test:coverage": "bun test --concurrent --max-concurrency 1 --coverage", "typecheck": "tsc --noEmit", "prepublishOnly": "bun run test && bun run build" },