Skip to content

Assorted fixes, mostly in integration tests, to handle 5/24/2024 server-side changes. #222

Assorted fixes, mostly in integration tests, to handle 5/24/2024 server-side changes.

Assorted fixes, mostly in integration tests, to handle 5/24/2024 server-side changes. #222

Workflow file for this run

# Run a matrix of tests across different platforms and python versions.
# This is run on each pull request so we get a complete picture of any
# platform-specific issues not caught earlier.
#
# See also:
# unit-test.yml: run on a single platform every time a branch is pushed
# coverage-report.yml: runs on merge to main to generate coverage reports
# Based on https://github.com/marketplace/actions/install-poetry-action#running-on-windows
name: test-matrix
on: pull_request
jobs:
# List the tests
list-tests:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.test-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: test-matrix
run: echo "matrix=$(find tests -name "*.py" | sed -e s/^tests\\/// | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
test-matrix:
needs: list-tests
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
test: ${{ fromJson(needs.list-tests.outputs.matrix) }}
fail-fast: false
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-pip-wheels
uses: actions/cache@v4
with:
path: ~/.cache
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
- name: Log version
run: |
source $VENV
python -c "import censusdis; print(f'censusdis version: {censusdis.version}')"
- name: Run tests
run: |
source $VENV
pytest
- name: Archive test artifacts
if: ${{ hashFiles('tests/_test_artifacts') != '' }}
uses: actions/upload-artifact@v4
with:
name: test_artifacts-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.test }}
path: tests/_test_artifacts
retention-days: 7