Skip to content

test: integration — full session lifecycle with CreateIngress/DeleteIngress for camera role - #145

Open
courtnaejames1 wants to merge 3 commits into
mainfrom
test/140-full-createSession-lifecycle
Open

test: integration — full session lifecycle with CreateIngress/DeleteIngress for camera role#145
courtnaejames1 wants to merge 3 commits into
mainfrom
test/140-full-createSession-lifecycle

Conversation

@courtnaejames1

@courtnaejames1 courtnaejames1 commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds an end-to-end integration test covering the complete production session lifecycle through the signaling server's gRPC API.

What was added

A new TestLifecycle_FullSessionFlow test in backend/internal/signaling/grpc_integration_test.go that exercises the full flow a real production would follow:

  1. CreateSession — director creates a session and receives a valid room code
  2. JoinSession (director) — joins with role "director", asserts a JWT token and LiveKit URL are returned
  3. JoinSession (camera) — camera join, asserting a WHIP URL and stream key returned, with CreateIngress called against LiveKit for each
  4. CloseSession — director closes the session, triggering DeleteIngress cleanup for all stored ingress IDs
  5. Post-close assertions — both director and camera JoinSession calls return FailedPrecondition, confirming the session cannot be rejoined

What this covers that unit tests don't

The existing unit tests in grpc_test.go verify ingress behaviour with mocks in isolation. This test runs against the real LiveKit and Ingress services in the dev stack, proving the full control plane flow works end-to-end — room code generation, Redis state, LiveKit ingress lifecycle, and session status transitions all in one pass.

How to run

cd backend
go test -race -count=1 -tags=integration -run TestLifecycle_FullSessionFlow ./internal/signaling/

Closes #140

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.

Integration test: full CreateSession → JoinSession → CloseSession lifecycle

1 participant