Skip to content

Commit

Permalink
Add test coverage and remove MacOS integration tests (#1562)
Browse files Browse the repository at this point in the history
* Add code coverage to unit tests

Signed-off-by: Willem Pienaar <[email protected]>

* Add coverage to PRs

Signed-off-by: Willem Pienaar <[email protected]>
  • Loading branch information
woop authored May 15, 2021
1 parent 77a7975 commit 1436a02
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ jobs:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
os: [ ubuntu-latest, macOS-latest ]
os: [ ubuntu-latest ]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
Expand All @@ -31,4 +34,12 @@ jobs:
- name: Install dependencies
run: make install-python-ci-dependencies
- name: Test python
run: FEAST_TELEMETRY=False pytest --verbose --color=yes sdk/python/tests --integration
run: FEAST_TELEMETRY=False pytest --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests --integration
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
flags: integrationtests
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true
15 changes: 13 additions & 2 deletions .github/workflows/pr_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
os: [ ubuntu-latest, macOS-latest ]
os: [ ubuntu-latest ]
services:
redis:
image: redis
Expand All @@ -26,6 +26,9 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -50,7 +53,15 @@ jobs:
- name: Install dependencies
run: make install-python-ci-dependencies
- name: Test python
run: FEAST_TELEMETRY=False pytest --verbose --color=yes sdk/python/tests --integration
run: FEAST_TELEMETRY=False pytest --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests --integration
env:
REDIS_TYPE: REDIS
REDIS_CONNECTION_STRING: redis:6379,db=0
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
flags: integrationtests
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true
11 changes: 11 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
os: [ ubuntu-latest, macOS-latest]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
Expand All @@ -20,6 +23,14 @@ jobs:
run: make install-python-ci-dependencies
- name: Test Python
run: make test-python
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true

unit-test-go:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ install-python:
python -m pip install -e sdk/python -U --use-deprecated=legacy-resolver

test-python:
FEAST_TELEMETRY=False pytest --verbose --color=yes sdk/python/tests
FEAST_TELEMETRY=False pytest --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests

format-python:
# Sort
Expand Down
1 change: 1 addition & 0 deletions sdk/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"gcsfs",
"urllib3>=1.25.4",
"pytest==6.0.0",
"pytest-cov",
"pytest-lazy-fixture==0.6.3",
"pytest-timeout==1.4.2",
"pytest-ordering==0.6.*",
Expand Down

0 comments on commit 1436a02

Please sign in to comment.