Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5dce9c769 |
@@ -26,6 +26,9 @@ ENTRYPOINT ["music-mirror"]
|
|||||||
FROM runtime AS test
|
FROM runtime AS test
|
||||||
|
|
||||||
RUN pip install --no-cache-dir pytest
|
RUN pip install --no-cache-dir pytest
|
||||||
|
# sync-to-ipod.sh and its tests need these; the runtime image deliberately does
|
||||||
|
# not carry them, and neither does the base.
|
||||||
|
RUN apk add --no-cache bash rsync findmnt
|
||||||
COPY pytest.ini ./
|
COPY pytest.ini ./
|
||||||
# Host-side tools; not in the runtime image, but the suite covers them.
|
# Host-side tools; not in the runtime image, but the suite covers them.
|
||||||
COPY tools ./tools
|
COPY tools ./tools
|
||||||
|
|||||||
@@ -5,14 +5,22 @@ protecting against emptying the wrong directory -- a mistake that does not
|
|||||||
announce itself.
|
announce itself.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
SCRIPT = Path(__file__).resolve().parent.parent / "tools" / "sync-to-ipod.sh"
|
SCRIPT = Path(__file__).resolve().parent.parent / "tools" / "sync-to-ipod.sh"
|
||||||
|
|
||||||
|
# Skipped rather than failed where the tools are absent: this is a host-side
|
||||||
|
# script, and a machine without rsync is not a machine that would run it.
|
||||||
|
REQUIRED = ("bash", "rsync", "findmnt")
|
||||||
|
pytestmark = pytest.mark.skipif(
|
||||||
|
not all(shutil.which(tool) for tool in REQUIRED),
|
||||||
|
reason=f"needs {', '.join(REQUIRED)} on PATH",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def run(*arguments):
|
def run(*arguments):
|
||||||
return subprocess.run(
|
return subprocess.run(
|
||||||
|
|||||||
Reference in New Issue
Block a user