Skip to content

Integration & round-trip contract suite - #9

Merged
ziflex merged 2 commits into
mainfrom
chore/integration-tests
Sep 5, 2026
Merged

Integration & round-trip contract suite#9
ziflex merged 2 commits into
mainfrom
chore/integration-tests

Conversation

@ziflex

@ziflex ziflex commented Sep 5, 2026

Copy link
Copy Markdown
Member

No description provided.

… for runtime allocation, debug, session, and transport logic.
Copilot AI lite review requested due to automatic review settings September 5, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are primarily a well-scoped test-suite consolidation plus a small correctness fix for typed-nil debug errors, with no unreviewed production-risky behavior changes identified.

Pull request overview

This PR introduces a dedicated end-to-end “Universal API integration contracts” suite under test/integration/ to validate the public wire/client ↔ protobuf/gRPC ↔ wire/server boundary using an in-memory bufconn transport and hosted API spies, consolidating prior server-package adapter/transport contract coverage into a single external-consumer harness.

Changes:

  • Added a reusable integration harness (spies, recorder, coordination, and fault injection) plus comprehensive contract tests for runtime/plan/session/debugger behavior, lifecycle, cancellation, allocation/release failures, and connection loss.
  • Moved/removed legacy server/*runtime_adapter*_test.go integration-style tests in favor of the new test/integration suite, and updated docs to point to the new contract coverage.
  • Fixed debug-event translation to avoid populating debugger.Event.Error with a typed-nil (so successful stopped events keep Event.Error == nil).
File summaries
File Description
test/integration/README.md Documents the new end-to-end contract suite, harness capabilities, and how to run it.
test/integration/session_test.go Adds session overlap/cancellation/reuse and completion-vs-cancel race coverage.
test/integration/runtime_test.go Adds runtime/session output and options round-trip tests plus Runtime.Close ownership semantics.
test/integration/release_test.go Adds contract tests for known release/close failure behavior and sibling preservation.
test/integration/plan_test.go Adds compile/params/options semantics tests and plan/session durability assertions.
test/integration/lifecycle_test.go Adds recursive close and concurrency independence tests (sessions/plans/descendants).
test/integration/errors_test.go Adds sanitization and failure/diagnostics classification contract coverage.
test/integration/debugger_test.go Adds debugger command/inspect/breakpoints/value/evaluate round-trip coverage.
test/integration/connection_test.go Adds handshake unavailable, connection-loss reclamation, and watch termination coverage.
test/integration/cancellation_test.go Adds cancellation propagation and cancellation-vs-allocation contract coverage.
test/integration/allocation_test.go Ports lost-allocation and cleanup escalation tests to the new harness/fault model.
test/integration/allocation_race_test.go Ports allocation cancellation timing and close-once semantics tests to the new harness.
test/integration/allocation_fixture_test.go Introduces shared fixture utilities for allocation-oriented integration tests.
test/integration/harness/harness.go Implements the core harness: server+bufconn setup, runtime creation, cleanup, expected-error handling.
test/integration/harness/runtime.go Adds a hosted api.Runtime spy with option capture and compile/run recording.
test/integration/harness/plan.go Adds a hosted api.Plan spy with session/debug-session creation and recording.
test/integration/harness/session.go Adds a hosted api.Session spy with run/close recording and call indexing.
test/integration/harness/debugger.go Adds a hosted debugger.Session spy with command/inspect/evaluate/breakpoint recording.
test/integration/harness/recorder.go Adds lifecycle/call recorder with snapshots, wait-based assertions, and close-settlement checks.
test/integration/harness/options.go Adds session/compile option capture plus portable-value deep cloning for snapshots.
test/integration/harness/failure.go Adds RPC fault injection (lost/malformed replies, response failures, watch termination) over real RPCs.
test/integration/harness/coordination.go Adds Block/Await utilities for bounded, observable coordination without sleeps/polling.
client/remote_debug_event.go Prevents typed-nil assignment to debugger.Event.Error on stopped events.
README.md Points readers to the new integration contract suite and how to run it.
AGENTS.md Updates the testing-layer guidance to reference the new public round-trip integration suite.
server/runtime_optimization_presence_test.go Adjusts optimization-presence coverage naming/scope to align with reorganized integration testing.
server/runtime_release_failure_test.go (deleted) Legacy server-package integration contract replaced by test/integration/release_test.go.
server/runtime_allocation_fixture_test.go (deleted) Replaced by test/integration/allocation_fixture_test.go + harness.
server/runtime_adapter_transport_test.go (deleted) Replaced by test/integration/connection_test.go + harness.
server/runtime_adapter_session_test.go (deleted) Replaced by test/integration/plan_test.go/session_test.go + harness.
server/runtime_adapter_session_fake_test.go Removes now-unneeded helper used by deleted legacy server adapter tests.
server/runtime_adapter_run_test.go (deleted) Replaced by test/integration/runtime_test.go + harness.
server/runtime_adapter_options_fake_test.go Removes now-unneeded helper used by deleted legacy server adapter tests.
server/runtime_adapter_debugger_fake_test.go (deleted) Replaced by test/integration/debugger_test.go + harness.
server/runtime_adapter_debug_test.go (deleted) Replaced by test/integration/debugger_test.go + harness.
server/runtime_adapter_allocation_test.go (deleted) Replaced by test/integration/allocation_race_test.go + harness.
Review details
  • Files reviewed: 36/36 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…onnectionLoss` utility function, update error handling logic, and introduce new test suite for validating connection loss scenarios.
@ziflex
ziflex merged commit e2eac36 into main Sep 5, 2026
11 checks passed
@ziflex
ziflex deleted the chore/integration-tests branch September 5, 2026 18:27
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