Skip to content

Add Phase 2 integration tests for SessionDO internal endpoints#75

Merged
ColeMurray merged 2 commits intomainfrom
integration-tests-phase-2
Feb 7, 2026
Merged

Add Phase 2 integration tests for SessionDO internal endpoints#75
ColeMurray merged 2 commits intomainfrom
integration-tests-phase-2

Conversation

@ColeMurray
Copy link
Owner

Summary

  • Expand control-plane integration test coverage from 14 → 45 tests (31 new) by exercising all SessionDO internal HTTP endpoints through the real workerd runtime
  • Add shared test helpers (initSession, queryDO, seedEvents, seedMessage) to reduce boilerplate across test files
  • Add dummy MODAL_API_SECRET and MODAL_WORKSPACE miniflare bindings to unblock lifecycle manager initialization during tests

New Test Files

File Tests Coverage
prompt-enqueue.test.ts 6 Message creation, participant auto-creation, user_message events, attachments, callback context
sandbox-events.test.ts 7 Token/tool_call storage, heartbeat (no event row), execution_complete (success/failure), git_sync, event ordering
ws-token-participants.test.ts 7 WS token generation, new participant creation, token hash storage, validation, participant CRUD
events-messages-list.test.ts 5 Default pagination, limit, cursor pagination, type filtering, message listing
session-lifecycle.test.ts 6 State with sandbox, custom model, archive/unarchive, non-participant rejection, sandbox token verification

Test plan

  • All 45 integration tests pass (npm run test:integration -w @open-inspect/control-plane)
  • All 325 unit tests pass (npm test -w @open-inspect/control-plane)
  • CI already runs integration tests (step exists in .github/workflows/ci.yml)

Expand integration test coverage from 14 to 45 tests by exercising
the SessionDO's internal HTTP endpoints through the real workerd
runtime: prompt enqueueing, sandbox event processing, WS token
generation, participant management, event/message listing with
pagination, session archive/unarchive, and sandbox token verification.

Add dummy MODAL_API_SECRET and MODAL_WORKSPACE bindings to unblock
lifecycle manager initialization during tests.
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Terraform Validation Results

Step Status
Format ⚠️
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@greptile-apps
Copy link

greptile-apps bot commented Feb 7, 2026

Greptile Overview

Greptile Summary

Expands integration test coverage for SessionDO internal endpoints by adding 31 new tests across 5 test files, bringing total coverage from 14 to 45 tests. The new tests systematically verify all internal HTTP endpoints (/internal/prompt, /internal/sandbox-event, /internal/ws-token, /internal/participants, /internal/events, /internal/messages, /internal/state, /internal/archive, /internal/unarchive, /internal/verify-sandbox-token) through the real workerd runtime.

Key improvements:

  • Introduces shared test helpers (initSession, queryDO, seedEvents, seedMessage) in helpers.ts to reduce boilerplate and improve maintainability
  • Adds dummy MODAL_API_SECRET and MODAL_WORKSPACE bindings to vitest.integration.config.ts to unblock lifecycle manager initialization during tests
  • Tests cover message creation, participant management, sandbox events, WebSocket tokens, event/message pagination, session lifecycle, and authentication

Minor issue found:

  • SQL queries in tests use string interpolation (${messageId}) instead of parameterized queries with ? placeholders, which is inconsistent with the production code pattern used in repository.ts

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Update queryDO helper to accept bind params and replace all
template-literal SQL with ? placeholders to match production patterns.
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Terraform Validation Results

Step Status
Format ⚠️
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@ColeMurray ColeMurray merged commit 520a14a into main Feb 7, 2026
10 checks passed
@ColeMurray ColeMurray deleted the integration-tests-phase-2 branch February 7, 2026 08:25
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