diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 19c054db..627b6087 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,6 +33,15 @@ jobs: run: | python -m pip install --upgrade pip pip install -e .[dev] - - name: Run tests + - name: Run tests (Linux) + if: startsWith(matrix.os, 'ubuntu') run: | pytest -n 16 -sv --cov=textworld --cov-report=term-missing --cov-fail-under=85 tests/ textworld/ + + # On MacOS, tests/test_sample_quests.py crashes when run concurrently with + # pytest-xdist (native rendering/Graphviz), so it is run serially instead. + - name: Run tests (MacOS) + if: startsWith(matrix.os, 'macos') + run: | + pytest -n 16 -sv --cov=textworld --cov-report= --ignore=tests/test_sample_quests.py tests/ textworld/ + pytest -sv --cov=textworld --cov-append --cov-report=term-missing --cov-fail-under=85 tests/test_sample_quests.py diff --git a/tests/test_sample_quests.py b/tests/test_sample_quests.py index 41ec782b..1a2001e6 100644 --- a/tests/test_sample_quests.py +++ b/tests/test_sample_quests.py @@ -2,6 +2,7 @@ # Licensed under the MIT license. import os +import sys from os.path import join as pjoin from subprocess import check_output @@ -17,7 +18,7 @@ def test_sample_quests(): check_output(command).decode() script = pjoin(SCRIPTS_PATH, "sample_quests.py") - command = ["python", script, "--nb-quests", "10", "--quest-length", "10", + command = [sys.executable, script, "--nb-quests", "10", "--quest-length", "10", "--quest-breadth", "5", "--output", tmpdir, game_file] stdout = check_output(command).decode() assert len(stdout) > 0