diff --git a/containers/test-template/Dockerfile b/containers/test-template/Dockerfile index 52372877..b5099456 100644 --- a/containers/test-template/Dockerfile +++ b/containers/test-template/Dockerfile @@ -2,8 +2,9 @@ ARG PYTHON_VERSION=3.11 FROM python:${PYTHON_VERSION}-slim # Install and uninstall snakebids to cache it and it's dependences -RUN apt-get update && apt-get install -y gcc && \ +RUN apt-get update && apt-get install -y gcc git && \ rm -rf /var/lib/apt/lists/* && \ + git config --global --add safe.directory /src && \ python -m pip install pipx && \ pipx install poetry && \ pipx install hatch && \ diff --git a/containers/test-template/test-template.sh b/containers/test-template/test-template.sh index 14d44733..f2b2a84c 100755 --- a/containers/test-template/test-template.sh +++ b/containers/test-template/test-template.sh @@ -11,6 +11,9 @@ case "$method" in "setuptools" ) python -m venv .venv .venv/bin/python -m pip install . + if [ -d /src ]; then + .venv/bin/python -m pip install /src + fi PATH=".venv/bin:$PATH" eval "$script" ;; "poetry" ) diff --git a/snakebids/tests/test_template.py b/snakebids/tests/test_template.py index 6bdea58c..33f7bc13 100644 --- a/snakebids/tests/test_template.py +++ b/snakebids/tests/test_template.py @@ -306,7 +306,9 @@ def test_template_dry_runs_successfully(tmp_path: Path, build: BuildBackend, ven assert "All set" in cmd.stdout.decode() -def test_template_dry_runs_with_current_repository(tmp_path: Path): +def test_template_dry_runs_with_current_repository( + tmp_path: Path, request: pytest.FixtureRequest +): app_name = "snakebids_app" data = get_empty_data(app_name, "setuptools") @@ -316,16 +318,18 @@ def test_template_dry_runs_with_current_repository(tmp_path: Path): data=data, unsafe=True, ) - app_path = tmp_path / app_name cmd = sp.run( [ - sys.executable, - app_path / app_name / "run.py", - app_path / "tests/data", - app_path / "tests/results", - "participant", - "-c1", - "--skip-bids-validation", + "docker", + "run", + "-v", + f"{tmp_path / app_name}:/app", + "-v", + f"{request.config.rootpath}:/src", + "--rm", + f"snakebids/test-template:{platform.python_version()}", + "setuptools", + app_name, ], capture_output=True, check=False,