Skip to content

Add Integartion Tests#26

Merged
ajit-zer07 merged 1 commit intomainfrom
add-integration-tests
Apr 4, 2026
Merged

Add Integartion Tests#26
ajit-zer07 merged 1 commit intomainfrom
add-integration-tests

Conversation

@ajit-zer07
Copy link
Copy Markdown
Contributor

Summary

  • Add a separate integration_tests/ Rust crate with 55 gRPC integration tests across 3 tiers (protocol, Rig agent tools, real LLM E2E)
  • Add WatchSignals streaming RPC for ambient Signal broadcast
  • Add comprehensive test and runtime documentation

What this PR does

Integration test suite (integration_tests/)

A standalone Rust crate that tests the runtime through the real gRPC boundary. It is not part of the main Cargo build — cargo build --release ignores it entirely.

Tier 1 — Protocol (47 tests): Scripted gRPC tests covering all 6 modes (decision, proposal, task, handoff, quorum, multi-round), plus:

  • Error paths (invalid version, empty mode, unauthorized sender, oversized payload)
  • Mode-specific reject paths (non-initiator commit, premature commitment, wrong phase)
  • RFC cross-cutting features (signals, version binding, dedup invariants, cancel auth, discovery, TTL)

Tier 2 — Rig Agent Tools (5 tests): Each MACP operation implemented as a Rig Tool trait, validated through ToolSet::call() — the same interface an
LLM agent uses.

Tier 3 — E2E with Real LLM (3 tests, #[ignore]): Real OpenAI GPT-4o-mini agents coordinating through the runtime:

  • Decision with signals: orchestrator (code) proposes → 3 specialist LLMs evaluate in parallel → signals on ambient plane → orchestrator commits
  • Decision: simplified version without signals
  • Task delegation: planner (code) creates task → worker (LLM) completes → planner commits

WatchSignals RPC

New server-streaming RPC that broadcasts ambient Signal envelopes to all subscribers. Signals are non-binding messages on the ambient plane (per RFC-MACP-0001 §5.1) — they
correlate with sessions via SignalPayload.correlation_session_id but never enter session history.

Changes: proto/macp/v1/core.proto, src/runtime.rs (signal broadcast channel), src/server.rs (WatchSignals handler)

Documentation

  • New docs/testing.md — comprehensive integration test guide
  • Updated README.md — added Testing section
  • Rewritten CLAUDE.md — added architecture diagram, mode authority table, gRPC surface table, env vars table, signal/dedup rules, integration test section
  • Updated docs/protocol.md — added WatchSignals to RPC list

Test plan

  • cargo fmt --all -- --check passes
  • cargo clippy --all-targets -- -D warnings passes
  • cargo build succeeds
  • cargo test --all-targets passes (unit + Rust integration tests)
  • cd integration_tests && MACP_TEST_BINARY=../target/debug/macp-runtime cargo test --test tier1 -- --test-threads=1 — 47 protocol tests pass
  • cd integration_tests && MACP_TEST_BINARY=../target/debug/macp-runtime cargo test --test tier2 -- --test-threads=1 — 5 Rig tool tests pass
  • cd integration_tests && OPENAI_API_KEY=... MACP_TEST_BINARY=../target/debug/macp-runtime cargo test --test tier3 -- --ignored --test-threads=1 — 3 E2E tests pass
    with real OpenAI
  • cargo build --release produces only macp-runtime binary (no test artifacts)

@ajit-zer07 ajit-zer07 merged commit 36a6fb7 into main Apr 4, 2026
10 of 11 checks passed
@ajit-zer07 ajit-zer07 deleted the add-integration-tests branch April 4, 2026 01:28
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