Skip to content

Commit

Permalink
Add matrix config for pytest action (#284)
Browse files Browse the repository at this point in the history
* Add matrix config for pytest action
* Fix flags for pip install
* Add TODO about windows failure
* Only run tests on 3.7 and 3.11
* Exclude integration tests from coverage

b/279747505
  • Loading branch information
oxve authored May 9, 2023
1 parent 2e334e8 commit 49eb1f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ source=.
omit=
# Exclude test files from coverage report
*_test.py
cobalt/black_box_tests/tests/*
cobalt/media_integration_tests/*

# Exclude scripts in third_party/
third_party/*
12 changes: 9 additions & 3 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@ permissions: {}

jobs:
python-test:
runs-on: ubuntu-latest
strategy:
matrix:
# TODO(b/281098312): pytest fails on windows-latest
os: [ubuntu-latest]
python-version: ['3.7', '3.11']
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: ${{ matrix.python-version }}
- name: Install Pip Packages
run: pip install -r ${GITHUB_WORKSPACE}/docker/pytest/requirements.txt
run: pip install --require-hashes --no-deps -r ${{ github.workspace }}/docker/pytest/requirements.txt
- name: Run Tests
run: coverage run -m pytest
- name: Coverage Report
Expand Down

0 comments on commit 49eb1f2

Please sign in to comment.