Skip to content

✅ test: Add forwarder integration tests#9

Merged
SebastienLaurent-CF merged 1 commit intomainfrom
feat/forwarder-integration-tests
Nov 23, 2025
Merged

✅ test: Add forwarder integration tests#9
SebastienLaurent-CF merged 1 commit intomainfrom
feat/forwarder-integration-tests

Conversation

@SebastienLaurent-CF
Copy link
Copy Markdown
Contributor

Implement 7 comprehensive integration tests for the Forwarder package to verify core port-forwarding logic, retry behavior, and graceful shutdown.

Tests Added

Integration Tests (internal/forwarder/forwarder_test.go)

  1. TestForwarderStartWithValidPod - Happy path: pod located successfully
  2. TestForwarderLocatorError - Retry behavior when locator fails (pod not found)
  3. TestForwarderRetryAttemptIncrement - Verify attempt counter increments on failures
  4. TestForwarderContextCancellation - Graceful shutdown on context cancellation
  5. TestForwarderInfoString - Forwarder info formatting for logs
  6. TestForwarderCalculateBackoff - Exponential backoff calculation with max delay enforcement
  7. TestForwarderConfig - Config getter method verification

Implement 7 comprehensive integration tests for the Forwarder package to verify
core port-forwarding logic, retry behavior, and graceful shutdown.

## Tests Added

**Integration Tests** (internal/forwarder/forwarder_test.go)
1. **TestForwarderStartWithValidPod** - Happy path: pod located successfully
2. **TestForwarderLocatorError** - Retry behavior when locator fails (pod not found)
3. **TestForwarderRetryAttemptIncrement** - Verify attempt counter increments on failures
4. **TestForwarderContextCancellation** - Graceful shutdown on context cancellation
5. **TestForwarderInfoString** - Forwarder info formatting for logs
6. **TestForwarderCalculateBackoff** - Exponential backoff calculation with max delay enforcement
7. **TestForwarderConfig** - Config getter method verification
@SebastienLaurent-CF SebastienLaurent-CF merged commit 0a58895 into main Nov 23, 2025
1 check passed
@SebastienLaurent-CF SebastienLaurent-CF deleted the feat/forwarder-integration-tests branch November 23, 2025 16:30
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