Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Allow for multiple env-files #616
Allow for multiple env-files #616
Changes from all commits
de15161
ba64d51
4eb19ed
ccdfb22
04935ec
f78c67a
ad47a50
bc41e2c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are good, keep them :) I'd also like a test which actually runs the docker compose command and checks that the env files are loaded correctly. For example with
docker.compose.config()
. If for example, you made a typo in--env-file
in the unit test and the main implementation, your tests can't currently detect it. Running the true command in test would detect such an error.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some more tests now that actually run the command by using the equivalent of
docker compose run
. Some temporary env-files are made, and the containers are then inspected to verify that the actual environment variables set in the container are as expected. Pretty verbose, and I am sure it can be done simpler, but let me know if this is what you wanted :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than running the containers, using https://gabrieldemarmiesse.github.io/python-on-whales/sub-commands/compose/#python_on_whales.components.compose.cli_wrapper.ComposeCLI.config would have made the test simpler no? just switch
docker.compose.run
fordocker.compose.config()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, yeah that is a lot simpler. Updated now :)