-
Notifications
You must be signed in to change notification settings - Fork 11
Automatic replacement of stale containers #35
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #35 +/- ##
==========================================
+ Coverage 91.28% 92.88% +1.59%
==========================================
Files 18 18
Lines 459 534 +75
==========================================
+ Hits 419 496 +77
+ Misses 40 38 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
…ools didn't create
|
@alexanderpetrenz Wanted to give you a heads up about this in case it causes any problems for your workflow. I need to do some "real" testing with it but I think i'll be merging it soon if that goes well. |
|
Manual integration tests: venv with this branch installed. Dockerfile: FROM alpine:3.13
RUN apk --no-cache add python3
RUN mkdir /html
WORKDIR /html
EXPOSE 8000
CMD ["python3", "-m", "http.server"]
COPY index.html /html/index.htmlindex.html - really doesn't matter. Just junk that you can edit. test_project.py from pytest_docker_tools import build, container
myimage = build(
path='.',
)
mycontainer = container(
image='{myimage.id}',
name='mycontainer',
labels={'mylabel': 'test2'}
)
myothercontainer = container(
image='{myimage.id}',
name='myothercontainer',
labels={'mylabel': '{mycontainer.id}'}
)
def test_1(myothercontainer):
assert myothercontainer.name == 'myothercontainer'This creates 2 containers. Then ran various changes and ran
|
|
|
Pretty pleased with how this is working. Test authors still have to be careful to not rely on state in the environment from previous test runs, but its now pretty safe and automatic if you have a fixture change. I'm probably going to merge + release this after lunch. While not a breaking change code wise this does change the behaviour of reusable containers enough that i think it warrants another major version bump. |
|
This is a great improvement! In fact I still wasn't able to hand over the whole reusable containers feature to colleagues, as they requested it month ago. It's great to see all this improvements so quickly. Thanks a lot for your work! |
Implementation of #34
This will automatically replace stale reusable containers. For example: