Skip to content

Run tests/test_sample_quests.py serially on macOS CI - #378

Merged
Marc-Alexandre Côté (MarcCote) merged 2 commits into
mainfrom
copilot/fix-github-actions-job
Sep 29, 2026
Merged

Marc-Alexandre Côté (MarcCote) merged 2 commits into
mainfrom
copilot/fix-github-actions-job

Conversation

Copilot AI commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

tests/test_sample_quests.py::test_sample_quests crashes on macOS runners: the script it spawns performs native Graphviz/rendering work, which is unsafe when multiple pytest-xdist workers hit it concurrently. Rather than serializing the whole suite on macOS, only this test is taken out of the parallel run.

.github/workflows/tests.yml

  • Split the single Run tests step into a Linux step (unchanged, -n 16 over the full suite) and a macOS step.
  • macOS runs the suite in parallel with --ignore=tests/test_sample_quests.py and --cov-report= (data collected, no report), then runs that one test serially with --cov-append, emitting the report and enforcing --cov-fail-under=85 on the combined data.
- 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

tests/test_sample_quests.py

  • Spawn sys.executable instead of a bare python, so the subprocess uses the same interpreter as the test process rather than whatever python resolves to on the runner. Assertions unchanged.

Note the ordering: the serial invocation must come last since it owns --cov-append and the threshold check. Runners are ephemeral and no coverage cache is configured, so there is no stale .coverage to append to.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: MarcCote <660004+MarcCote@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job for test_sample_quests Run tests/test_sample_quests.py serially on macOS CI Sep 29, 2026
@MarcCote
Marc-Alexandre Côté (MarcCote) marked this pull request as ready for review September 29, 2026 12:27
@MarcCote
Marc-Alexandre Côté (MarcCote) merged commit 5f7fbff into main Sep 29, 2026
15 checks passed
@MarcCote
Marc-Alexandre Côté (MarcCote) deleted the copilot/fix-github-actions-job branch September 29, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants