Skip to content

refactor(test): Migrate E2E tests to testcontainers-go#84

Merged
nfebe merged 4 commits intomainfrom
refactor/e2e-testcontainers
Mar 18, 2026
Merged

refactor(test): Migrate E2E tests to testcontainers-go#84
nfebe merged 4 commits intomainfrom
refactor/e2e-testcontainers

Conversation

@nfebe
Copy link
Contributor

@nfebe nfebe commented Mar 18, 2026

Replace manual docker compose shell commands with testcontainers-go compose module for programmatic container lifecycle management.

Key improvements:

  • Automatic cleanup via t.Cleanup() even on test failure
  • Built-in wait strategies replace manual health polling loops
  • Tests are self-contained Go tests, no Makefile orchestration needed
  • Removed boilerplate setup/teardown functions

Replace manual docker compose shell commands with testcontainers-go
compose module for programmatic container lifecycle management.

Key improvements:
- Automatic cleanup via t.Cleanup() even on test failure
- Built-in wait strategies replace manual health polling loops
- Tests are self-contained Go tests, no Makefile orchestration needed
- Removed boilerplate setup/teardown functions

Signed-off-by: nfebe <fenn25.fn@gmail.com>
@sourceant
Copy link

sourceant bot commented Mar 18, 2026

Code Review Summary

This PR refactors the E2E testing suite to use testcontainers-go for programmatic container management, replacing brittle Makefile/Shell orchestration. It also bumps the project to Go 1.25.

🚀 Key Improvements

  • प्रोग्रामेटिक container lifecycle management via testcontainers-go.
  • Automatic cleanup using t.Cleanup().
  • Consistent Go 1.25 environment across CI and local Dockerfiles.

💡 Minor Suggestions

  • Standardize .golangci.yml schema.
  • Fix linter installation path in Makefile.

Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

Extract shared startComposeEnv() helper using testcontainers-go
to eliminate duplicated compose setup across security and lua
tests. Use t.Context() instead of context.Background() in test
functions.

Bump Go version from 1.24 to 1.25 across Dockerfiles, CI
workflow, and go.mod to satisfy testcontainers-go v0.41.0
minimum requirement.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

@nfebe nfebe force-pushed the refactor/e2e-testcontainers branch from 55a2749 to 873669c Compare March 18, 2026 09:24
Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

@nfebe nfebe force-pushed the refactor/e2e-testcontainers branch from 873669c to 11caff0 Compare March 18, 2026 09:38
Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

golangci-lint v1 is built with Go 1.24 and cannot lint code
targeting Go 1.25. Upgrade CI action to v7 with golangci-lint
v2, update Makefile install path, and add .golangci.yml to
disable errcheck and ST/QF staticcheck rules that are newly
enabled in v2 defaults.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
@nfebe nfebe force-pushed the refactor/e2e-testcontainers branch from 11caff0 to 19c56ee Compare March 18, 2026 09:43
Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

…ners API

Use testcontainers.GenericNetwork to create the proxy Docker network
instead of shelling out via exec.Command. Cleanup functions now log
errors instead of discarding them with _ =.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

@nfebe nfebe merged commit 1aec9fa into main Mar 18, 2026
5 checks passed
@nfebe nfebe deleted the refactor/e2e-testcontainers branch March 18, 2026 10: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