Skip to content

Fix find_command test on Windows. #1799

Fix find_command test on Windows.

Fix find_command test on Windows. #1799

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: ci
on:
push:
branches: [ "*" ]
schedule:
# Every day at 2:02.
- cron: '2 2 * * *'
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 20 # stop runaway job after 20 minutes
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, ubuntu-20.04, macos-12, macos-11, windows-2022 ]
python-version: [ '3.9', '3.10', '3.11', '3.12-dev']
env:
SHELLOUS_DEBUG: 1
BUILD_NAME: build (${{ matrix.os }},${{ matrix.python-version }})
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Install dependencies
run: |
pip3 install -U setuptools wheel
pip3 install -r ./ci/requirements-dev.txt
- name: Lint
if: matrix.python-version != '3.12-dev'
run: |
ruff check --exit-zero .
pylint -v --fail-under 9.5 shellous
# Run pylint on tests directory with some checks disabled.
pylint --disable=C0116,C0103,R0903,W0212,C0302,C0415 --fail-under 9.1 tests
pyright || echo "Failed."
- name: Run Tests
run: |
if ! pytest -vv -s --durations=20 --log-cli-level=DEBUG | ./ci/annotate.awk -v step=Run_Tests; then
echo "::warning title=Run Tests Warning::Re-running failed tests in $BUILD_NAME"
pytest -vv -s --durations=20 --log-cli-level=DEBUG --last-failed
fi
- name: Run Code Coverage (Linux and MacOS)
if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-12') && matrix.python-version != '3.12-dev'
run: |
# Run coverage.
coverage run --source shellous -m pytest
# Re-run with coverage for shellous/watcher.py
SHELLOUS_CHILDWATCHER_TYPE=default coverage run --source shellous -m pytest
# Re-run with coverage for shellous/watcher.py and ThreadStrategy.
SHELLOUS_CHILDWATCHER_TYPE=default SHELLOUS_THREADSTRATEGY=1 coverage run --source shellous -m pytest
env:
SHELLOUS_CODE_COVERAGE: 1
- name: Upload Code Coverage
if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-12') && matrix.python-version != '3.12-dev'
uses: codecov/codecov-action@v3
with:
verbose: true
- name: Run Tests with uvloop (Linux and MacOS)
if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-12') && matrix.python-version != '3.12-dev'
run: |
pip3 install uvloop
# Ignore ResourceWarning with uvloop for now (TODO).
if ! pytest -vv -s --log-cli-level=DEBUG -W ignore::ResourceWarning; then
echo "::warning title=uvloop Warning::Re-running failed tests in $BUILD_NAME"
pytest -vv -s --log-cli-level=DEBUG -W ignore::ResourceWarning --last-failed
fi
env:
SHELLOUS_LOOP_TYPE: "uvloop"
- name: Run Tests with eager task factory
if: matrix.python-version == '3.12-dev'
run: |
if ! pytest -vv -s --durations=20 --log-cli-level=DEBUG | ./ci/annotate.awk -v step=Run_Tests; then
echo "::warning title=Run Tests Warning::Re-running failed tests in $BUILD_NAME"
pytest -vv -s --durations=20 --log-cli-level=DEBUG --last-failed
fi
env:
SHELLOUS_LOOP_TYPE: "eager_task_factory"
- name: Run Tests with PidfdWatcher (Linux)
if: matrix.os == 'ubuntu-22.04'
run: |
if ! pytest -vv -s --log-cli-level=DEBUG; then
echo "::warning title=PidfdChildWatcher Warning::Re-running failed tests in $BUILD_NAME"
pytest -vv -s --log-cli-level=DEBUG --last-failed
fi
env:
SHELLOUS_CHILDWATCHER_TYPE: "pidfd"
- name: Run Tests with SafeChildWatcher (Linux and MacOS)
if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-12') && matrix.python-version != '3.12-dev'
run: |
if ! pytest -vv -s --log-cli-level=DEBUG; then
echo "::warning title=SafeChildWatcher Warning::Re-running failed tests in $BUILD_NAME"
pytest -vv -s --log-cli-level=DEBUG --last-failed
fi
env:
SHELLOUS_CHILDWATCHER_TYPE: "safe"
- name: Run Tests with DefaultChildWatcher (Linux and MacOS)
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-12'
run: |
if ! pytest -vv -s --log-cli-level=DEBUG | ./ci/annotate.awk -v step=DefaultChildWatcher; then
echo "::warning title=DefaultChildWatcher Warning::Re-running failed tests in $BUILD_NAME"
pytest -vv -s --log-cli-level=DEBUG --last-failed
fi
env:
SHELLOUS_CHILDWATCHER_TYPE: "default"
- name: Verify Types
if: matrix.python-version != '3.12-dev'
run: |
PYTHONPATH=. pyright --verifytypes shellous || echo "::warning title=Pyright Warning::Verify types failed"
build-alpine:
runs-on: ubuntu-latest
timeout-minutes: 20 # stop runaway job after 20 minutes
strategy:
fail-fast: false
matrix:
image-tag: ['python:3.10-alpine', 'python:3.11-alpine']
container:
image: ${{ matrix.image-tag }}
env:
SHELLOUS_DEBUG: 1
BUILD_NAME: build (${{ matrix.image-tag }})
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |
apk add --update gcc musl-dev python3-dev
pip3 install -r ./ci/requirements-dev.txt
- name: Run Tests
run: |
cat /etc/alpine-release; uname -a
if ! pytest -v -s --log-cli-level=DEBUG; then
echo "::warning title=Run Tests Warning::Re-running failed tests in $BUILD_NAME"
pytest -v -s --log-cli-level=DEBUG --last-failed
fi
- name: Run Tests with DefaultChildWatcher
run: |
if ! pytest -v -s --log-cli-level=DEBUG; then
echo "::warning title=DefaultChildWatcher Warning::Re-running failed tests in $BUILD_NAME"
pytest -v -s --log-cli-level=DEBUG --last-failed
fi
env:
SHELLOUS_CHILDWATCHER_TYPE: "default"
build-pypy:
runs-on: ubuntu-latest
timeout-minutes: 20 # stop runaway job after 20 minutes
strategy:
fail-fast: false
matrix:
pypy-version: [ 'pypy-3.9', 'pypy-3.10']
env:
SHELLOUS_DEBUG: 1
BUILD_NAME: build (${{ matrix.pypy-version }})
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pypy-version }}
- name: Install dependencies
run: |
pip3 install -U setuptools wheel
pip3 install -r ./ci/requirements-dev.txt
- name: Run Tests
run: |
pytest -vv -s --durations=20 --log-cli-level=DEBUG -W ignore::pytest.PytestUnraisableExceptionWarning
- name: Run Tests with DefaultChildWatcher
run: |
pytest -vv -s --log-cli-level=DEBUG -W ignore::pytest.PytestUnraisableExceptionWarning
env:
SHELLOUS_CHILDWATCHER_TYPE: "default"