Skip to content

test(integration): OpenAPI endpoint tests (port legacy 22) - #732

Merged
kriszyp merged 2 commits into
mainfrom
claude/api-tests-open-api
May 22, 2026
Merged

test(integration): OpenAPI endpoint tests (port legacy 22)#732
kriszyp merged 2 commits into
mainfrom
claude/api-tests-open-api

Conversation

@kriszyp

@kriszyp kriszyp commented May 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Ports apiTests/tests/22_openApi.mjs to the new self-contained framework
  • Installs a minimal openApiApp component with a TableName table and a Greeting table via installAppComponent
  • Verifies GET /openapi returns a valid OpenAPI 3.x document with the expected title, paths, schemas, and security schemes

Test plan

  • CI passes on node shards (linux + macOS)
  • Suite is skipped on Windows (depends on restart_service http_workers)
  • Single test verifies: title, /TableName/ and /TableName/{id} paths, /Greeting/ path, schemas.TableName, schemas.Greeting, securitySchemes.basicAuth, securitySchemes.bearerAuth

🤖 Generated with Claude Code

— Claude

Self-contained suite that installs a minimal component (TableName table +
Greeting table), then verifies GET /openapi returns the expected title,
paths, schemas, and security schemes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kriszyp
kriszyp requested a review from Ethan-Arrowood May 22, 2026 13:01
@claude

claude Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found.

Codex and Gemini review flagged that using a second @table for Greeting
would not exercise the JS Resource → OpenAPI code path, allowing a
regression in resource-class discovery to go undetected.

Replace the Greeting @table with a minimal Resource class exported from
resources.js (matching the legacy test's coverage), and enable
jsResource in config.yaml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kriszyp
kriszyp requested a review from dawsontoth May 22, 2026 14:49
@kriszyp
kriszyp merged commit 0e34b64 into main May 22, 2026
37 checks passed
@kriszyp
kriszyp deleted the claude/api-tests-open-api branch May 22, 2026 19:27
kriszyp added a commit that referenced this pull request Jul 28, 2026
Moves the pin from ^2.3.0 to ~2.4.1 and the lockfile from 2.3.0 to 2.4.1.

2.4.1 is the 2.4-line backport of the cross-column-family transactional read
fix (rocksdb-js #717, backported in #732). TransactionHandle::get honored the
caller's dbHandleOverride on its synchronous block-cache-tier attempt but
dropped it in the async worker, falling back to the transaction's own column
family. All tables in a Harper database share one read transaction, so every
table after the first in a request was read through a foreign column family:
reads that hit the block cache were correct, reads that missed it silently
returned not-found. The failure was therefore intermittent and scaled with
cache residency — worst right after a restart, healing as traffic warmed the
cache. Where two tables share a key format a read could also hit in the
foreign column family and return another table's row.

Related: #1881.

Tilde, not caret, is deliberate. ^2.4.1 resolves to 2.5.0 at install time,
which would pull in the dedicated per-database commit thread, the
fd-limit-derived max_open_files default, and the VerificationTable epoch
rekey — none of which belong in a patch. ~2.4.1 holds 5.1.x on the 2.4 line.
main stays on ^2.5.0 for 5.2.

The lockfile moves with the pin because the lockfile is what ships: the
original exposure was ^2.3.0 with a 2.3.0 lockfile, which let the 5.1.22
image build against whatever npm resolved that day (2.4.0, with the bug).
kriszyp added a commit that referenced this pull request Jul 28, 2026
Moves the pin from ^2.3.0 to ~2.4.1 and the lockfile from 2.3.0 to 2.4.1.

2.4.1 is the 2.4-line backport of the cross-column-family transactional read
fix (rocksdb-js #717, backported in #732). TransactionHandle::get honored the
caller's dbHandleOverride on its synchronous block-cache-tier attempt but
dropped it in the async worker, falling back to the transaction's own column
family. All tables in a Harper database share one read transaction, so every
table after the first in a request was read through a foreign column family:
reads that hit the block cache were correct, reads that missed it silently
returned not-found. The failure was therefore intermittent and scaled with
cache residency — worst right after a restart, healing as traffic warmed the
cache. Where two tables share a key format a read could also hit in the
foreign column family and return another table's row.

Related: #1881.

Tilde, not caret, is deliberate. ^2.4.1 resolves to 2.5.0 at install time,
which would pull in the dedicated per-database commit thread, the
fd-limit-derived max_open_files default, and the VerificationTable epoch
rekey — none of which belong in a patch. ~2.4.1 holds 5.1.x on the 2.4 line.
main stays on ^2.5.0 for 5.2.

The lockfile moves with the pin because the lockfile is what ships: the
original exposure was ^2.3.0 with a 2.3.0 lockfile, which let the 5.1.22
image build against whatever npm resolved that day (2.4.0, with the bug).
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.

2 participants