Skip to content

/claim #677 #862

Open
DanielMinton wants to merge 1 commit intopermitio:masterfrom
DanielMinton:master
Open

/claim #677 #862
DanielMinton wants to merge 1 commit intopermitio:masterfrom
DanielMinton:master

Conversation

@DanielMinton
Copy link

OPAL_E2E_pytest.py_status.mp4

#677

Implements a full end-to-end testing framework that validates the entire OPAL stack running together in Docker.

This work focuses on confidence, not just coverage. The goal is to prove that the client, server, and OPA start cleanly, communicate correctly, and do not fail silently during startup.

What I did

I added a pytest-based end-to-end test suite using session-scoped fixtures that spin up the real Docker Compose environment once per test run. All tests execute against the same running containers to avoid unnecessary teardown and rebuild cycles.

The tests interact with the system exactly as it runs in practice. Nothing is mocked.

How this is verified

The tests use concrete signals to validate correctness:

  • - Health endpoints are queried to confirm services are up
  • - The Statistics API is called to confirm the client successfully registers with the server, which is the only reliable signal for client-server connectivity
  • - Container logs are parsed and the test suite fails if any ERROR or CRITICAL messages appear during startup or execution
  • - OPA policy delivery is verified end to end

If the system looks healthy but logs contain serious errors, the tests fail.

Test execution

All tests can be run with a single command:

make e2e-test

This command:

  • - Brings up the Docker Compose environment
  • - Runs the full end-to-end test suite
  • - Tears everything down cleanly

The full suite runs in approximately 20 to 25 seconds.

To avoid conflicts with local OPAL setups, the Docker services are mapped to non-standard ports (17002, 17000, 18181).

Test structure

• tests/e2e/conftest.py
Session-scoped pytest fixtures managing Docker lifecycle

• tests/e2e/utils/
Docker manager, HTTP client with retries, and log parsing utilities

• tests/e2e/test_*.py
End-to-end tests for health, statistics, connectivity, and logs

• tests/e2e/docker_compose.yml
Isolated Docker Compose configuration for testing

Why this matters

This covers all acceptance criteria from the issue and provides a fast, repeatable way to verify that the entire stack comes up healthy.

If something breaks during startup, we find out immediately instead of discovering it later in production.

Demo video

A short video demonstrating make e2e-test running locally is attached above. It shows the Docker environment starting, tests executing against live containers, and all checks passing with clean logs.

Notes

Happy to adjust test placement, signals, or structure if there is a preferred pattern for this repository.

Implements comprehensive end-to-end testing framework with:
- Docker-based test environment (Server, Client, OPA, PostgreSQL)
- Health check endpoint validation
- Statistics API verification for client-server connectivity
- Log analysis for errors and critical alerts
- 33 automated tests covering all core functionality

Test execution:
- Single command: make e2e-test
- Tests run in ~22 seconds
- Uses isolated ports (17002, 17000, 18181) to avoid conflicts

Framework structure:
- tests/e2e/conftest.py: pytest fixtures for Docker lifecycle
- tests/e2e/utils/: Docker manager, HTTP client, log parser utilities
- tests/e2e/test_*.py: Test suites for health, stats, connectivity, logs
- tests/e2e/docker_compose.yml: Test environment configuration
@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for opal-docs canceled.

Name Link
🔨 Latest commit cc947d8
🔍 Latest deploy log https://app.netlify.com/projects/opal-docs/deploys/69605ba3d6a87b0008867956

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