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

Add support for workdir and env var in exec command #7816

Merged
merged 3 commits into from
Nov 29, 2023
Merged

Conversation

eddumelendez
Copy link
Member

Currently, only user and command can be used with execInContainer.
This commit introduces ExecConfig, which allows to set workdir and
env vars when running an exec process.

execInContainerWithUser is deprecated in favor of execInContainer(ExecConfig)

Currently, only `user` and `command` can be used with `execInContainer`.
This commit introduces `ExecConfig`, which allows to set workdir and
env vars when running an exec process.

`execInContainerWithUser` is deprecated in favor of `execInContainer(ExecConfig)`
@eddumelendez eddumelendez requested a review from a team as a code owner November 15, 2023 22:05
@eddumelendez eddumelendez added this to the next milestone Nov 15, 2023
@eddumelendez eddumelendez removed this from the 1.19.3 milestone Nov 21, 2023
@eddumelendez eddumelendez added this to the next milestone Nov 29, 2023
@eddumelendez eddumelendez merged commit 212cf54 into main Nov 29, 2023
89 checks passed
@eddumelendez eddumelendez deleted the execconfig branch November 29, 2023 21:57
@perlun
Copy link
Contributor

perlun commented Dec 4, 2023

Thanks for this @eddumelendez, appreciated. 🙏 I was about to fix a PR for this myself, since I just added support for these specific things (working dir and environment variables) in a custom method in my test class, but then I was puzzled when ExecInContainerTest seemed to contain support for this already... only to realize you added it last week. 😂

image

Looking forward to see this being released as part of vNext. 👍 🎉

@perlun
Copy link
Contributor

perlun commented Dec 4, 2023

Could perhaps be worth adding to https://java.testcontainers.org/features/commands/ also, along with the new version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants