-
-
Notifications
You must be signed in to change notification settings - Fork 586
chore(mysql): use Run function #3416
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(mysql): use Run function #3416
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 MySQL module to build container options via functional customizers and use testcontainers.Run. Adds runtime credential validation, updates error text, and inspects the running container to derive and set MySQL credentials/database fields. Adjusts a test assertion to check for substring rather than exact error string. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant MySQL as MySQL.Run
participant TC as testcontainers.Run
participant C as Container
participant Inspect as Container Inspect
Caller->>MySQL: Run(ctx, image, opts...)
MySQL->>MySQL: Build moduleOpts (ports, env, wait)
MySQL->>MySQL: Attach validateCreds (CustomizeRequestOption)
MySQL->>TC: Run(ctx, image, moduleOpts...)
alt run failure
TC-->>MySQL: error ("run mysql ...")
MySQL-->>Caller: error
else run success
TC-->>MySQL: Container handle
MySQL->>Inspect: Inspect / Env
Inspect-->>MySQL: MYSQL_USER/PASSWORD/DATABASE
MySQL->>MySQL: Update MySQLContainer fields
MySQL-->>Caller: MySQLContainer
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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)
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 |
What does this PR do?
Use the Run function in mysql module
Why is it important?
Migrate modules to the new API, improving consistency and leveraging the latest testcontainers functionality.
Related issues