Skip to content

test: move real-Postgres suites to e2e/ and drop helper unit tests - #9

Merged
TheGreatAxios merged 2 commits into
cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schemafrom
cl-9236-agent-token-move-drizzle-e2e-to-tests-and-add-wrong-tenant
Sep 27, 2026
Merged

TheGreatAxios merged 2 commits into
cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schemafrom
cl-9236-agent-token-move-drizzle-e2e-to-tests-and-add-wrong-tenant

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The DB suite moves to e2e/agent-token.drizzle.test.ts; the test:e2e script runs ./e2e and tsconfig includes it.
  • src/tokens.test.ts is deleted; bearer-parsing cases (lowercase, whitespace, Basic, bare Bearer) run through the public verifier instead.
  • e2e/upgrade-from-0.1.0.test.ts builds a database with the published 0.1.0 (agent-token-0.1.0 npm alias dev dependency), mints and revokes with it, upgrades in place with this build, and checks old tokens still verify and pass requireAgentToken.
  • Stacked on feat(migrations)!: ship migrations as SQL with Interchange's signature #8.

Verification

  • bun install --frozen-lockfile, bun run typecheck, bun run build: pass
  • DATABASE_URL=... bun run test:e2e against local Postgres: 6 pass, 0 fail

Closes CL-9236

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Self-review: diff matches the linked ticket(s); independent review passes addressed (fixed or waived as noted in the description); typecheck, build and the Postgres-backed suite pass on this branch.

@TheGreatAxios
TheGreatAxios force-pushed the cl-9236-agent-token-move-drizzle-e2e-to-tests-and-add-wrong-tenant branch from f6230e6 to 61f595e Compare September 25, 2026 18:09
@TheGreatAxios
TheGreatAxios force-pushed the cl-9236-agent-token-move-drizzle-e2e-to-tests-and-add-wrong-tenant branch 3 times, most recently from 273f683 to dd7104a Compare September 25, 2026 23:49
@TheGreatAxios
TheGreatAxios force-pushed the cl-9236-agent-token-move-drizzle-e2e-to-tests-and-add-wrong-tenant branch from dd7104a to 4dd9f5b Compare September 25, 2026 23:53
@TheGreatAxios TheGreatAxios changed the title Keep tests in tests/ and drop unit tests of private helpers Move the real-Postgres suites to e2e/ and add a 0.1.0 upgrade e2e Sep 25, 2026
@TheGreatAxios TheGreatAxios changed the title Move the real-Postgres suites to e2e/ and add a 0.1.0 upgrade e2e test: move real-Postgres suites to e2e/ and drop helper unit tests Sep 26, 2026
@TheGreatAxios
TheGreatAxios force-pushed the cl-9236-agent-token-move-drizzle-e2e-to-tests-and-add-wrong-tenant branch 2 times, most recently from ea2d5fc to bbffc61 Compare September 26, 2026 01:37
@TheGreatAxios
TheGreatAxios added this pull request to stack #12 September 26, 2026 01:58
Bearer parsing is covered through the public verifier instead.
Builds a database with the published 0.1.0, then upgrades it in place:
live tokens still verify and pass requireAgentToken, revoked ones stay
revoked, and the migration re-runs cleanly.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9236-agent-token-move-drizzle-e2e-to-tests-and-add-wrong-tenant branch from bbffc61 to 6b33f49 Compare September 27, 2026 01:00
@TheGreatAxios
TheGreatAxios removed this pull request from stack #12 September 27, 2026 01:42
@TheGreatAxios
TheGreatAxios added this pull request to stack #17 September 27, 2026 01:43
@TheGreatAxios
TheGreatAxios merged commit 4a7f090 into main Sep 27, 2026
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