Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19b5c750b7 |
@@ -26,9 +26,6 @@ ENTRYPOINT ["music-mirror"]
|
||||
FROM runtime AS test
|
||||
|
||||
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 ./
|
||||
# Host-side tools; not in the runtime image, but the suite covers them.
|
||||
COPY tools ./tools
|
||||
|
||||
@@ -5,22 +5,14 @@ protecting against emptying the wrong directory -- a mistake that does not
|
||||
announce itself.
|
||||
"""
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
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):
|
||||
return subprocess.run(
|
||||
|
||||
Reference in New Issue
Block a user