Skip to content

Build option for DockerCompose - #168

Merged
yakimka merged 12 commits into
testcontainers:masterfrom
aloosley:compose-build-option
Apr 2, 2022
Merged

Build option for DockerCompose#168
yakimka merged 12 commits into
testcontainers:masterfrom
aloosley:compose-build-option

Conversation

@aloosley

Copy link
Copy Markdown
Contributor

There are some usecases where it is useful to force building to occur when using docker-compose (the equivalent to docker-compose up --build).

In this PR, a boolean parameter is added to allow for this, similar to the pull boolean parameter that already exists to force image pulling.

@yakimka

Copy link
Copy Markdown
Contributor

@aloosley, hello. Can you update this PR?

Comment threadtestcontainers/compose.py Outdated
@aloosley

Copy link
Copy Markdown
ContributorAuthor

Hi both, thanks for checking in on this PR! First glance, the needed change looks small. I'll do this (and try to write a better test) in the next day when I get to a computer.

@codecov-commenter

codecov-commenter commented Apr 1, 2022

Copy link
Copy Markdown

Codecov Report

Merging #168 (ff507e1) into master (9100aaf) will increase coverage by 0.00%.
The diff coverage is 90.00%.

@@ Coverage Diff @@## master #168 +/- ##
=======================================
Coverage 85.07% 85.08% =======================================
Files 24 24 Lines 630 637 +7 Branches 59 61 +2 =======================================
+ Hits 536 542 +6 
Misses 75 75 - Partials 19 20 +1 
Impacted FilesCoverage Δ
testcontainers/compose.py98.24% <90.00%> (-1.76%)⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9100aaf...ff507e1. Read the comment docs.

@aloosley

Copy link
Copy Markdown
ContributorAuthor

Alright @yakimka, I cleaned up the PR a bit. Testing build=True would have been a bit complicated, so rather than add something complicated to this PR, I opted for the simple test option of simply making sure the arg --build actually gets used when docker-compose is called. I hope this solution is ok.

Comment threadtestcontainers/compose.py Outdated
Comment threadtests/test_docker_compose.py Outdated
Comment threadtests/test_docker_compose.py Outdated
Comment threadtests/test_docker_compose.py
@aloosley

Copy link
Copy Markdown
ContributorAuthor

🥳 Thanks @yakimka, any other steps needed here?

@yakimka

Copy link
Copy Markdown
Contributor

@aloosley thank you =)

@yakimka
yakimka merged commit 1f0ca14 into testcontainers:masterApr 2, 2022
Sign up for freeto 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.

4 participants

@aloosley@yakimka@codecov-commenter@tillahoffmann