feat: add end-to-end test suite#2
Merged
Merged
Conversation
Build and run the actual binary as a subprocess against mock GitHub meta and doco-cd servers. Tests cover the full pipeline including config loading from env vars, secret file support, HMAC forwarding, signal handling, and rejection scenarios. Uses a minimal isolated environment for subprocesses to prevent host env vars from leaking into tests. Also adds GITHUB_META_URL env var override (useful for GitHub Enterprise or integration testing) and a dedicated E2E CI job.
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end test harness that exercises the compiled proxy binary against mock GitHub meta + doco-cd servers, and wires it into CI. Also introduces a runtime override for the GitHub meta endpoint to support GitHub Enterprise/integration testing.
Changes:
- Add
e2e/e2e_test.go(build-tagged) test suite that builds/runs the real binary as a subprocess and verifies forwarding/rejection/shutdown behaviors. - Add
GITHUB_META_URLenv var override incmd/proxy/main.goto configure the GitHub meta endpoint at runtime. - Add a dedicated E2E job to
.github/workflows/ci.yaml.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
e2e/e2e_test.go |
New build-tagged E2E tests running the compiled proxy against mock servers. |
cmd/proxy/main.go |
Adds GITHUB_META_URL override (fallback to default GitHub meta URL). |
.github/workflows/ci.yaml |
Adds an “E2E” CI job to run the new suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+141
to
+142
| cmd.Process.Signal(syscall.SIGTERM) | ||
| cmd.Wait() |
- Add 5s timeout to HTTP client in sendWebhook to prevent hung tests - TrimSpace on GITHUB_META_URL env var to handle trailing newlines - Add e2e test verifying meta URL whitespace trimming works - Remove explicit -timeout 60s from CI job (default 10m is sufficient)
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
e2e/e2e_test.go) that builds the binary and runs it as a subprocess against mock servers, testing the full pipeline including config loading, secret file support, HMAC forwarding, signal-based shutdown, and rejection scenariosGITHUB_META_URLenv var override for the GitHub meta endpoint (useful for GitHub Enterprise or integration testing)Test plan
go test ./e2e/ -tags e2e -v)go test ./... -cover)go vetclean