Skip to content

Commit

Permalink
Add CI job to run in pytest mode on each OS
Browse files Browse the repository at this point in the history
This commit adds a new CI job that runs stestr's unit test suite in
pytest mode instead of using stestr's built in subunit runner (based on
stdlib unittest).
  • Loading branch information
mtreinish committed Nov 11, 2023
1 parent d1c802c commit 831d80d
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,42 @@ jobs:
- name: Install and run tests macOS
run: |
tox -epy --notest
.tox/py/bin/pip install gnureadline subunit2sql
.tox/py/bin/pip install gnureadline
tox -epy
if: runner.os == 'macOS'
pytest:
name: test-pytest-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["macOS-latest", "ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-tests-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-tests-
${{ runner.os }}-${{ matrix.python-version }}-pip-
${{ runner.os }}-${{ matrix.python-version }}
- name: Install Deps
run: python -m pip install -U 'tox<4' setuptools virtualenv wheel
- name: Install and Run Tests
run: tox -e py -- --pytest
if: runner.os != 'macOS'
- name: Install and run tests macOS
run: |
tox -epy --notest
.tox/py/bin/pip install gnureadline
tox -epy -- --pytest
if: runner.os == 'macOS'

lint:
name: pep8
runs-on: ubuntu-latest
Expand Down

0 comments on commit 831d80d

Please sign in to comment.