Skip to content

test(driver-mongodb): skip suite when in-memory MongoDB binary is unavailable#1442

Merged
os-zhuang merged 1 commit into
mainfrom
claude/fix-mongodb-test-skip-when-unavailable
Jun 1, 2026
Merged

test(driver-mongodb): skip suite when in-memory MongoDB binary is unavailable#1442
os-zhuang merged 1 commit into
mainfrom
claude/fix-mongodb-test-skip-when-unavailable

Conversation

@os-zhuang
Copy link
Copy Markdown
Contributor

Problem

The monorepo Test Core job runs pnpm turbo run test, which includes @objectstack/driver-mongodb. That package's mongodb-driver.test.ts uses mongodb-memory-server, which downloads a real MongoDB binary from fastdl.mongodb.org on first use. When that download is blocked (sandboxed / offline CI runners, transient network), the suite fails hard — turning Test Core red on unrelated PRs and forcing empty-commit re-triggers (seen on #1436 and #1440).

Fix

Attempt to start the in-memory server once at collection time and describe.skipIf the suite when startup fails, so it skips cleanly instead of failing. A throwing beforeAll would fail every test rather than skip it, which is why the startup moves to a top-level guard. When the binary is available (normal CI), the suite runs exactly as before.

Test-only change; no runtime/published code is touched.

Verification (offline sandbox, where the binary can't download)

Test Files  2 passed | 1 skipped (3)
     Tests  38 passed | 37 skipped (75)

driver-mongodb test now exits 0 (previously: hard failure on the download error).

https://claude.ai/code/session_01Tv6F1Ub6bhCedrx3r8sZM4


Generated by Claude Code

…ary is unavailable

mongodb-memory-server downloads a real MongoDB binary from fastdl.mongodb.org on
first use. In sandboxed / offline CI that download can fail, which made the whole
monorepo `Test Core` job (pnpm turbo run test) red on unrelated PRs.

Start the in-memory server once at collection time and `describe.skipIf` the
suite when startup fails, so it skips cleanly instead of failing every test (a
throwing beforeAll fails rather than skips). When the binary is available
(normal CI), the suite runs exactly as before.

Verified offline: the suite now skips and `driver-mongodb` test exits 0
(2 files passed | 1 skipped; 38 passed | 37 skipped).

https://claude.ai/code/session_01Tv6F1Ub6bhCedrx3r8sZM4
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 1, 2026 5:02am

Request Review

@os-zhuang os-zhuang marked this pull request as ready for review June 1, 2026 05:10
@os-zhuang os-zhuang merged commit 14e5fb9 into main Jun 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants