Update test containers strategy arguments - #64
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The updated wait.ForSQL callback signature does not match the currently pinned testcontainers-go v0.42.0 API, which is likely to cause a compile-time failure unless dependencies are updated accordingly.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR aims to update the PostgreSQL testcontainer wait strategy in pkg/test/opt.go for improved type safety by switching the wait.ForSQL URL callback’s port argument from string to a typed network.Port and using Port() to extract the numeric port.
Changes:
- Added an import for
github.com/moby/moby/api/types/network. - Updated the
wait.ForSQLURL callback signature to acceptnetwork.Portand callport.Port()when constructing the connection URL.
File summaries
| File | Description |
|---|---|
| pkg/test/opt.go | Updates the SQL wait strategy callback to use a typed port and extracts the port string via Port(). |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
|
Coverage for this change: 13.0% |
This pull request updates the
OptPostgresconfiguration inpkg/test/opt.goto improve type safety and compatibility with the latesttestcontainers-goAPI. The key change is switching theportparameter in the wait strategy from astringto anetwork.Porttype, and updating the code to use thePort()method accordingly.Dependency and API compatibility:
github.com/moby/moby/api/types/networkto support thenetwork.Porttype.OptPostgreswait strategy to accept anetwork.Porttype for theportparameter and extract the port string using thePort()method, ensuring compatibility with the updatedtestcontainers-goAPI.