Skip to content

feat(cwd): add cwd:PATH op to set working dir for a whole call (#339) #447

feat(cwd): add cwd:PATH op to set working dir for a whole call (#339)

feat(cwd): add cwd:PATH op to set working dir for a whole call (#339) #447

Workflow file for this run

name: tests
on:
push:
branches: [master]
pull_request:
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install test deps
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov pytest-xdist pytest-timeout
- name: Install supertool (pip entry point — cross-platform, no symlink)
run: pip install -e .
- name: Stage ./supertool sibling (tests subprocess to repo-root path)
# tests/test_xml.py invokes `Path(__file__).parent.parent / "supertool"`
# via Popen — needs both the file present AND the exec bit set.
# `ln -sf` is POSIX-only; copy+chmod via Python works on all three OSes
# (chmod is a no-op on Windows; Popen there resolves via shebang).
run: |
python -c "import shutil; shutil.copyfile('supertool.py', 'supertool')"
python -c "import os, stat; os.chmod('supertool', os.stat('supertool').st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)"
- name: Run tests (full suite — slow tests included)
# Override pyproject addopts default of `-m 'not slow'` so CI exercises
# the slow MCP-fallback and batch-stress paths the dev inner loop skips.
# bash shell forced so `|| true` works on Windows (PowerShell default
# exits on pytest's non-zero status, skipping the junit-xml parser).
# The Python step parses junit-xml and re-emits `FAILED <id>` lines for
# the test summary — survives the GH 64KB log truncation that would
# otherwise eat the pytest summary block.
shell: bash
run: pytest -m '' --tb=no --no-cov --junit-xml=junit.xml -q
- name: Show FAILED test IDs (always runs)
if: always()
shell: bash
run: |
python -c "import xml.etree.ElementTree as ET, sys; t=ET.parse('junit.xml'); [print('FAILED', tc.attrib['classname']+'.'+tc.attrib['name']) for tc in t.getroot().iter('testcase') if any(c.tag in ('failure','error') for c in tc)]" || echo "(no junit.xml — pytest crashed before generating it)"