Add E2E Testing with Docker Compose - #2
Merged
Merged
Conversation
Documents the approach for end-to-end testing using Docker Compose with: - Real Vault integration for validation - Mock Linode API for fast, isolated tests - Core test scenarios (create, rotate, dry-run, daemon) - Go tests with build tags for separation from unit tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Prevents worktree contents from being tracked in git. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive end-to-end testing infrastructure for the latr token rotation system using Docker Compose. It adds a mock Linode API server for isolated testing and creates four e2e tests that validate complete workflows with real Vault integration.
Key changes:
- Mock Linode API HTTP server with in-memory state management
- Docker Compose setup with Vault and mock services
- Four e2e tests covering token creation, rotation, dry-run, and daemon modes
- Enhanced Linode client to support custom API URLs via environment variable
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/mock-linode/main.go | Implements HTTP server mocking Linode API v4 endpoints with in-memory token storage |
| test/e2e/mock-linode/Dockerfile | Container definition for mock API server |
| test/e2e/e2e_test.go | E2E test suite with TestMain orchestration and four workflow tests |
| test/e2e/docker-compose.yml | Service definitions for Vault and mock Linode with health checks |
| test/e2e/testdata/*.yaml | Configuration files for each test scenario |
| internal/linode/client.go | Added LINODE_API_URL environment variable support |
| docs/plans/2025-11-16-e2e-testing-design.md | Design documentation for e2e testing approach |
| README.md | Updated testing instructions and marked integration tests complete |
| Makefile | Added test, test-e2e, and test-all targets |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Infrastructure
Mock Linode API Server (
test/e2e/mock-linode/)Docker Compose Configuration (
test/e2e/docker-compose.yml)Linode Client Enhancement (
internal/linode/client.go)LINODE_API_URLenvironment variable supportTests
All tests validate complete workflows with real Vault and mock Linode API:
Build & Documentation
test,test-e2e, andtest-alltargetsTest Results
All tests pass successfully with proper cleanup of Docker resources.
Test Plan
make test-allruns successfully🤖 Generated with Claude Code