Skip to content

Commit

Permalink
Fix flaky template tests
Browse files Browse the repository at this point in the history
Tests dry-running the template were sporadically failing. This occurs
when multiple tests (running simultaneously via xdist) attempt to
install the snakebids repo at the same time, as
poetry-dynamic-versioning is not thread safe (since the fs gets
modified). Resolve this by copying over the repo into the docker
container before installation
  • Loading branch information
pvandyken committed Apr 17, 2024
1 parent 88b5217 commit cae8271
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions containers/test-template/test-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ method="$1"
script_name="$2"

cp -r /app/* /work
cp -r /snakebids /src
script="'${script_name}' tests/data tests/result participant -c1 --skip-bids-validation"
case "$method" in
"setuptools" )
Expand Down
4 changes: 2 additions & 2 deletions snakebids/tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def test_template_dry_runs_successfully(
"-v",
f"{tmp_path / app_name}:/app",
"-v",
f"{request.config.rootpath}:/src",
f"{request.config.rootpath}:/snakebids",
"--rm",
f"snakebids/test-template:{platform.python_version()}",
venv,
Expand Down Expand Up @@ -356,7 +356,7 @@ def test_template_docs_build(tmp_path: Path, request: pytest.FixtureRequest):
"-v",
f"{tmp_path / app_name}:/app",
"-v",
f"{request.config.rootpath}:/src",
f"{request.config.rootpath}:/snakebids",
"--rm",
f"snakebids/test-template:{platform.python_version()}",
"docs",
Expand Down

0 comments on commit cae8271

Please sign in to comment.