-
-
Notifications
You must be signed in to change notification settings - Fork 586
chore(k6|localstack|kafka|mariadb): use Run function #3414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(k6|localstack|kafka|mariadb): use Run function #3414
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Summary by CodeRabbit
WalkthroughRefactors multiple modules to use testcontainers' functional option-based Run flow instead of in-place GenericContainerRequest mutation; adds image/version/credential validations, centralized post-start hooks, docker-host configuration, a deprecated LocalStack request alias, and test updates to match new signatures. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Module as Module.Run
participant TC as testcontainers.Run
participant Docker as Docker Engine
participant Container as Container
Caller->>Module: Run(ctx, image, opts...)
Module->>Module: Build moduleOpts (WithEnv/Files/Cmd/Mounts/Wait/Validate...)
Module->>TC: Run(ctx, image, moduleOpts...)
TC->>Docker: Create & Start container (apply lifecycle hooks)
Docker-->>TC: Started
TC-->>Module: Container handle
Module->>Container: Inspect (env/network)
Container-->>Module: Details
Module-->>Caller: Module-specific wrapper (populated from Inspect)
sequenceDiagram
autonumber
actor Caller
participant KafkaModule as kafka.Run
participant TC as testcontainers.Run
participant Hook as PostStart Hook
participant Container as Container
Caller->>KafkaModule: Run(ctx, img, opts...)
KafkaModule->>KafkaModule: validateKRaftVersion(img)
KafkaModule->>KafkaModule: Add configureControllerQuorumVoters() option + lifecycle hooks
KafkaModule->>TC: Run(ctx, img, moduleOpts...)
TC-->>KafkaModule: Container handle
KafkaModule->>Hook: Execute PostStart Hook
Hook->>Container: Copy starter script & wait for readiness
KafkaModule->>Container: Inspect (CLUSTER_ID)
Container-->>KafkaModule: CLUSTER_ID
KafkaModule-->>Caller: KafkaContainer
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)modules/kafka/kafka.go (4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
modules/kafka/kafka.go(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
modules/kafka/kafka.go (4)
options.go (7)
ContainerCustomizer(22-24)WithExposedPorts(454-459)WithEnv(75-85)WithEntrypoint(438-443)WithCmd(462-467)WithLifecycleHooks(489-494)CustomizeRequestOption(28-28)lifecycle.go (2)
ContainerLifecycleHooks(43-55)ContainerHook(38-38)modules/mariadb/mariadb.go (1)
Run(122-177)generic.go (1)
GenericContainerRequest(21-27)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: test (1.24.x, modules/localstack) / test: modules/localstack/1.24.x
- GitHub Check: test (1.24.x, modules/k3s) / test: modules/k3s/1.24.x
- GitHub Check: Analyze (go)
What does this PR do?
Use the Run function in k6, localstack, kafka, and mariadb modules
Why is it important?
Migrate modules to the new API, improving consistency and leveraging the latest testcontainers functionality.
Related issues