Skip to content

Update test containers strategy arguments - #64

Merged
djthorpe merged 2 commits into
mainfrom
djt/0806/tests
Aug 6, 2026
Merged

Update test containers strategy arguments#64
djthorpe merged 2 commits into
mainfrom
djt/0806/tests

Conversation

@djthorpe

@djthorpe djthorpe commented Aug 6, 2026

Copy link
Copy Markdown
Member

This pull request updates the OptPostgres configuration in pkg/test/opt.go to improve type safety and compatibility with the latest testcontainers-go API. The key change is switching the port parameter in the wait strategy from a string to a network.Port type, and updating the code to use the Port() method accordingly.

Dependency and API compatibility:

  • Added an import for github.com/moby/moby/api/types/network to support the network.Port type.
  • Updated the OptPostgres wait strategy to accept a network.Port type for the port parameter and extract the port string using the Port() method, ensuring compatibility with the updated testcontainers-go API.

Copilot AI lite review requested due to automatic review settings August 6, 2026 09:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.ForSQL URL callback signature to accept network.Port and call port.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.

Comment thread pkg/test/opt.go
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Coverage for this change: 13.0%

@djthorpe
djthorpe merged commit e4f2201 into main Aug 6, 2026
2 checks passed
@djthorpe
djthorpe deleted the djt/0806/tests branch August 6, 2026 10:04
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.

2 participants