Add integration tests for control plane (workerd runtime)#73
Merged
ColeMurray merged 3 commits intomainfrom Feb 7, 2026
Merged
Add integration tests for control plane (workerd runtime)#73ColeMurray merged 3 commits intomainfrom
ColeMurray merged 3 commits intomainfrom
Conversation
) Adds 14 integration tests that run inside the real workerd runtime via @cloudflare/vitest-pool-workers, validating Worker boot, routing, HMAC auth, D1 database operations, and Durable Objects with SQLite storage. Tests run offline with no cloud credentials — miniflare provides local D1 (SQLite), KV, and DO implementations. isolatedStorage is disabled due to workers-sdk#11031 (SQLite WAL files break the storage snapshot assertions). D1 isolation is achieved via beforeEach cleanup instead.
Terraform Validation Results
Pushed by: @ColeMurray, Action: |
Contributor
Greptile OverviewGreptile Summary
|
Terraform Validation Results
Pushed by: @ColeMurray, Action: |
Cleans all D1 tables (sessions, repo_metadata, repo_secrets) in beforeEach instead of just sessions, preventing potential cross-test state leaks as the test suite grows.
Terraform Validation Results
Pushed by: @ColeMurray, Action: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workerdruntime via@cloudflare/vitest-pool-workersTest coverage
worker-fetch.test.tsauth.test.tsd1-session-index.test.tsdurable-object.test.tsNotable decisions
isolatedStorage: false: Required because SQLite-backed DOs create.sqlite-shm/.sqlite-walfiles that break the framework's storage snapshot assertions (workers-sdk#11031, still open, we're on the latest version 0.12.10). D1 isolation is achieved viabeforeEachcleanup instead.singleWorker: true: Simpler for Phase 1, sufficient for 14 tests running in ~800ms.warmSandbox()throws in tests:handleInitfiresctx.waitUntil(warmSandbox())which fails withoutMODAL_API_SECRET/MODAL_WORKSPACE. This is expected — it's fire-and-forget viawaitUntiland doesn't affect the 200 response.Files
New (10 files):
wrangler.jsonc— test-only wrangler config (DO bindings, D1, KV)vitest.integration.config.ts— workerd pool config with D1 migrationstest/integration/— setup, types, tsconfig, 4 test filesDockerfile.test— optional container for CI-matching local runsModified (3 files):
package.json—test:integrationscript,@cloudflare/vitest-pool-workersdevDepci.yml—libc++1install + integration test steppackage-lock.json— lockfileTest plan
npm test -w @open-inspect/control-plane— 279 unit tests passnpm run test:integration -w @open-inspect/control-plane— 14 integration tests pass