mirror of
https://github.com/lobaro/restic-backup-docker.git
synced 2026-11-13 15:45:22 +00:00
test: remove anonymous volumes with short-lived test containers
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a74b210615
commit
8ff93f4709
3 files changed
+29
-8
No files matched your search
+7
-4
@@ -12,7 +12,7 @@ from pathlib import Path
|
||||
|
||||
import docker
|
||||
import pytest
|
||||
from helpers import Container, remove_quietly, start_container
|
||||
from helpers import Container, remove_quietly, run_once, start_container
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
IMAGE = os.environ.get("IMAGE", "restic-backup-docker:test")
|
||||
@@ -108,10 +108,13 @@ def _cleanup_leftovers(docker_client: docker.DockerClient) -> Iterator[None]:
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def detected_features(docker_client: docker.DockerClient, image: str) -> set[str]:
|
||||
out = docker_client.containers.run(
|
||||
image, entrypoint=["sh", "-c", FEATURE_PROBE], remove=True, labels={"rbd-test-run": RUN_ID}
|
||||
out = run_once(
|
||||
docker_client,
|
||||
image,
|
||||
entrypoint=["sh", "-c", FEATURE_PROBE],
|
||||
labels={"rbd-test-run": RUN_ID},
|
||||
)
|
||||
return set(out.decode().split())
|
||||
return set(out.split())
|
||||
|
||||
|
||||
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
|
||||
|
||||
Reference in new issue
Block a user