-
-
Notifications
You must be signed in to change notification settings - Fork 584
chore(redis): use Run function #3429
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(redis): use Run function #3429
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary by CodeRabbit
WalkthroughRefactors Redis module to use testcontainers' functional-options flow: config-file handling now applies WithFiles/WithCmd, and Run builds a moduleOpts slice (including TLS cert generation, files, cmd args, and wait strategy) passed to testcontainers.Run, then assigns the returned container. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant RedisRun as Redis.Run
participant TC as testcontainers.Run
participant Container
Caller->>RedisRun: Run(ctx, image, opts...)
RedisRun->>RedisRun: Build moduleOpts via Option callbacks
alt TLS enabled
RedisRun->>RedisRun: Generate certs, add WithFiles, WithCmd, wait on TLS port
end
RedisRun->>TC: Run(ctx, image, moduleOpts...)
TC-->>RedisRun: container / error
alt success
RedisRun->>Container: assign to RedisContainer.Container
RedisRun-->>Caller: return RedisContainer, tlsConfig
else error
RedisRun-->>Caller: return error ("run redis: %w")
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)modules/redis/redis.go (2)
⏰ 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). (2)
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 |
- Move wait.ForListeningPort to base moduleOpts instead of conditional TLS block - Port 6379 is always listening (regular or TLS traffic) so wait should be unconditional - Removed duplicate wait strategy that was only added for TLS case 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
What does this PR do?
Use the Run function in redis
Why is it important?
Migrate modules to the new API, improving consistency and leveraging the latest testcontainers functionality.
Related issues
🤖 Generated with Claude Code