Skip to content

Include pg tests in root test gate#133

Open
mmkal wants to merge 5 commits into
mainfrom
clawpatch/root-pg-tests
Open

Include pg tests in root test gate#133
mmkal wants to merge 5 commits into
mainfrom
clawpatch/root-pg-tests

Conversation

@mmkal
Copy link
Copy Markdown
Collaborator

@mmkal mmkal commented May 19, 2026

Summary

Makes the root pnpm test gate discover workspace package tests directly instead of maintaining a separate list of root test:* scripts:

"test": "pnpm --recursive --workspace-concurrency=1 test"

That pulls in @sqlfu/pg through its package-level test script and also makes sqlfu-website part of the root test surface. The custom scripts/workspace-package-scripts.test.mjs guard is removed; recursive workspace execution is the guard now.

The review follow-up also makes the newly discovered package tests runnable:

  • sqlfu-website now has a self-contained package test that builds the UI and website before running its dist assertions.
  • the website build script calls test:dist to avoid recursively calling test.
  • the pg shared-role fixture now handles concurrent test-file imports by creating the role directly and ignoring duplicate-role races.

Before / after

Before this PR, root pnpm test skipped @sqlfu/pg entirely.

The first branch version fixed that with several root scripts and a custom script parser. After review, the net behavior is simpler: pnpm test asks every workspace package with a test script to run its own tests.

Clawpatch

Finding fixed: fnd_sig-feat-config-7528cb5b98-913b2_958e290ecc

Shared state directory used locally: /Users/mmkal/src/sqlfu/.clawpatch

Revalidation result: fixed

Validation

Passing:

pnpm exec oxfmt --check package.json website/package.json packages/pg/test/pg-fixture.ts tasks/complete/2026-05-19-clawpatch-root-pg-tests.md
docker compose -f packages/pg/test/docker-compose.yml up -d --wait
CI=1 pnpm --filter @sqlfu/pg test

Local CI=1 pnpm test now runs the website and pg package tests successfully, then stops in the existing sqlfu package failures:

strict-tier entries import no node:* or disallowed bare specifiers
findMiniflareD1Path resolves the sqlite file created by Alchemy dev for a D1 binding

pnpm typecheck also still hits the pg test fixture generate.casing gap that the stacked root-lint PR fixes.

Package size — packed 239.4 kB (no change)

Package size

main this PR Δ
packed 239.4 kB 239.4 kB 0
unpacked 991.8 kB 991.8 kB 0
files 185 185 0

dist/vendor/*.js bundles

main this PR Δ
vendor/sha256.js 4.3 kB 4.3 kB 0
vendor/sql-formatter/*.js 58.3 kB 58.3 kB 0
vendor/sqlfu-sqlite-parser/*.js 17.2 kB 17.2 kB 0
vendor/standard-schema/*.js 2.8 kB 2.8 kB 0
vendor/typesql/*.js 134.6 kB 134.6 kB 0

Measured with npm pack --dry-run --json on sqlfu (0.0.3-7 on main vs 0.0.3-7 on this PR).

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/sqlfu@133

commit: 51e1c7b

Comment thread scripts/workspace-package-scripts.test.mjs Outdated
@mmkal
Copy link
Copy Markdown
Collaborator Author

mmkal commented May 21, 2026

i don't want a bazillion test scripts

just pnpm test

Comment thread package.json Outdated
@mmkal
Copy link
Copy Markdown
Collaborator Author

mmkal commented May 21, 2026

🤖 Addressed the review comments in 51e1c7b. Root pnpm test is now one recursive workspace command, the custom workspace-script guard is gone, website package tests are picked up directly, and the pg shared-role fixture is race-safe under recursive test execution. I also updated the PR body with the current local validation state.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 51e1c7b. Configure here.

Comment thread website/package.json
"astro": "astro",
"test": "node --test test/*.test.mjs"
"test": "pnpm --filter @sqlfu/ui build && pnpm build",
"test:dist": "node --test test/*.test.mjs"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Website test/build scripts one rename from infinite recursion

Low Severity

The website test script calls pnpm build, and build ends with pnpm test:dist. This works today only because test:dist is a separate script from test. Previously, build called pnpm test directly (where test was just node --test ...). Now that test calls build, the separation between test and test:dist is the sole guard against infinite recursion. A future developer reverting test:dist back to test in the build command—a seemingly benign rename given it was literally pnpm test before this PR—would create an infinite loop: testbuildtestbuild → …

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 51e1c7b. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant