Skip to content
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

feat: WithEnv customize request option #2260

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

stevenh
Copy link
Collaborator

@stevenh stevenh commented Feb 21, 2024

What does this PR do?

Add WithEnv which set additional environment variables on a request so that callers can customise a request.

Why is it important?

This can be used to easily add environment variables to a container created using one of the standard module e.g. postgres.

How to test this PR

go test -run=^TestWithEnv$

@stevenh stevenh requested a review from a team as a code owner February 21, 2024 23:00
Copy link

netlify bot commented Feb 21, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 1198de4
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/65d73bf4ff82620008642e01
😎 Deploy Preview https://deploy-preview-2260--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@stevenh stevenh marked this pull request as draft February 21, 2024 23:24
@stevenh stevenh force-pushed the feat/with-env branch 2 times, most recently from e3b0ffa to 56884a9 Compare February 21, 2024 23:28
@stevenh stevenh marked this pull request as ready for review February 21, 2024 23:42
@stevenh
Copy link
Collaborator Author

stevenh commented Feb 21, 2024

The one failing test here looks like a temporary infrastructure issue, not related to the PR, recommend forcing it to rerun.

Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

Thanks for this! Added a few comments, but in general LGTM.

Also, could you look up the existing modules and check if we can apply this option to them? 🙏

options.go Outdated Show resolved Hide resolved
docker.go Outdated Show resolved Hide resolved
docker.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
@stevenh
Copy link
Collaborator Author

stevenh commented Feb 22, 2024

Should be good now @mdelapenya

mdelapenya
mdelapenya previously approved these changes Feb 22, 2024
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for this contribution, I appreciate very much your work here! 🙇

I'll merge this one once the comment in the docs is addressed.

Add WithEnv which set additional environment variables on a request
so that callers can customise a request.

This can be used to easily add environment variables to a container
created using one of the standard module e.g. postgres.
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdelapenya mdelapenya merged commit 105f485 into testcontainers:main Feb 22, 2024
91 checks passed
@stevenh stevenh deleted the feat/with-env branch February 22, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants