Skip to content

Extract container management from conftest.py to _container.py#307

Merged
chrisguidry merged 3 commits intomainfrom
docker-pull-retry
Jan 26, 2026
Merged

Extract container management from conftest.py to _container.py#307
chrisguidry merged 3 commits intomainfrom
docker-pull-retry

Conversation

@chrisguidry
Copy link
Owner

Summary

Moves ~180 lines of Docker container management code (Redis container lifecycle, cluster setup, ACL configuration, port allocation) into a dedicated tests/_container.py module. This gets conftest.py under the 500-line loq limit and makes the container infrastructure easier to find and maintain.

Also adds retry logic with exponential backoff for transient Docker image pull failures via run_container_with_retry().

🤖 Generated with Claude Code

Moves ~180 lines of Docker container management code (Redis container
lifecycle, cluster setup, ACL configuration, port allocation) into a
dedicated module. This gets conftest.py under the 500-line loq limit
and makes the container infrastructure easier to find and maintain.

Also adds retry logic with exponential backoff for transient Docker
image pull failures via `run_container_with_retry()`.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@github-actions
Copy link

github-actions bot commented Jan 26, 2026

📚 Documentation has been built for this PR!

You can download the documentation directly here:
https://github.com/chrisguidry/docket/actions/runs/21362890165/artifacts/5258615956

@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2026

Codecov Report

❌ Patch coverage is 27.20588% with 99 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.64%. Comparing base (9ef6b5a) to head (10c9ab8).

Files with missing lines Patch % Lines
tests/_container.py 27.20% 98 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #307      +/-   ##
==========================================
- Coverage   99.64%   98.64%   -1.00%     
==========================================
  Files          98       99       +1     
  Lines        9767     9903     +136     
  Branches      468      483      +15     
==========================================
+ Hits         9732     9769      +37     
- Misses         20      118      +98     
- Partials       15       16       +1     
Flag Coverage Δ
python-3.10 98.64% <27.20%> (-1.00%) ⬇️
python-3.11 97.37% <27.20%> (-0.98%) ⬇️
python-3.12 98.64% <27.20%> (-1.00%) ⬇️
python-3.13 98.64% <27.20%> (-1.00%) ⬇️
python-3.14 98.63% <27.20%> (-1.00%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tests/_container.py 27.20% <27.20%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

chrisguidry and others added 2 commits January 26, 2026 10:15
Uses ParamSpec to forward the wrapped function's signature, so
`with_image_retry(client.containers.run)(...)` keeps full typing.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Container management code has conditional branches for cluster/standalone
that vary by Redis config, same as conftest.py and _key_leak_checker.py.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@chrisguidry chrisguidry merged commit 98ca355 into main Jan 26, 2026
40 checks passed
@chrisguidry chrisguidry deleted the docker-pull-retry branch January 26, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants