Skip to content

CI: Add Proxy integration tests (issue #84)#271

Merged
s2x merged 1 commit into
mainfrom
feat/proxy-integration-tests
May 18, 2026
Merged

CI: Add Proxy integration tests (issue #84)#271
s2x merged 1 commit into
mainfrom
feat/proxy-integration-tests

Conversation

@s2x
Copy link
Copy Markdown
Contributor

@s2x s2x commented May 18, 2026

Summary

Adds comprehensive test coverage for the standalone ESI proxy server (servers/proxy/).

Changes

  • proxy_test.go — 18 Go unit tests covering:

    • Proxy creation with valid/invalid backends
    • Content-Type gating (HTML processed, non-HTML passthrough)
    • ParseOnHeader mode (with/without Edge-control header)
    • Surrogate-Capability header injection (not overwritten if present)
    • Surrogate-Control response header
    • Content-Length recalculation for HTML and non-HTML
    • Error status passthrough (400, 404, 500, 502, 503)
    • Original header preservation
    • Default URL from Host header
    • Config field preservation
    • No Surrogate-Control on non-HTML
    • Backend URL and transport configuration
  • test.sh — 9 E2E tests:

    1. ESI include processing (/returnEsi)
    2. ParseOnHeader bypass (no Edge-control header)
    3. ParseOnHeader active (Edge-control present)
    4. Surrogate-Control response header
    5. Non-HTML passthrough
    6. Max depth recursion limiting
    7. ESI include timeout
    8. HTTP 404 passthrough
    9. Content-Length correctness
  • tests.yaml — New proxy-test CI job (after core tests, before CI gate)

  • tests/server/main.go — Added Content-Type: text/html to ESI-related endpoints so proxy correctly processes HTML responses

Testing

All 18 unit tests and 9 E2E tests pass locally.

Adds comprehensive test coverage for the standalone ESI proxy server:

- 18 Go unit tests covering: proxy creation, content-type gating,
  ParseOnHeader mode, surrogate headers, Content-Length recalculation,
  error passthrough, header preservation, config validation
- 9 E2E tests covering: ESI include processing, ParseOnHeader bypass,
  ParseOnHeader active, surrogate headers, non-HTML passthrough,
  max depth limiting, timeout, error passthrough, Content-Length
- CI job in tests.yaml (proxy-test) running unit + E2E tests
- Fix Content-Type headers on test-server endpoints so proxy
  correctly processes HTML responses

Closes #84
@s2x s2x merged commit b643f91 into main May 18, 2026
5 checks passed
@s2x s2x deleted the feat/proxy-integration-tests branch May 18, 2026 19:18
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