Skip to content

feat: add end-to-end test suite#2

Merged
strayer merged 2 commits into
mainfrom
feat/e2e-tests
May 25, 2026
Merged

feat: add end-to-end test suite#2
strayer merged 2 commits into
mainfrom
feat/e2e-tests

Conversation

@strayer
Copy link
Copy Markdown
Owner

@strayer strayer commented May 25, 2026

Summary

  • Add e2e test suite (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 scenarios
  • Use minimal isolated subprocess environment to prevent host env vars from leaking into tests
  • Add GITHUB_META_URL env var override for the GitHub meta endpoint (useful for GitHub Enterprise or integration testing)
  • Add dedicated "E2E" job to CI workflow

Test plan

  • All 12 e2e tests pass locally (go test ./e2e/ -tags e2e -v)
  • Existing unit/integration tests unaffected (go test ./... -cover)
  • go vet clean
  • CI E2E job passes on PR

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_URL env var override in cmd/proxy/main.go to 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 thread e2e/e2e_test.go
Comment thread e2e/e2e_test.go
Comment on lines +141 to +142
cmd.Process.Signal(syscall.SIGTERM)
cmd.Wait()
Comment thread e2e/e2e_test.go
Comment thread e2e/e2e_test.go
Comment thread e2e/e2e_test.go
Comment thread cmd/proxy/main.go Outdated
Comment thread .github/workflows/ci.yaml Outdated
- 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)
@strayer strayer merged commit 6ca9b15 into main May 25, 2026
9 checks passed
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.

2 participants