Skip to content

Commit 1436a02

Browse files
authored
Add test coverage and remove MacOS integration tests (#1562)
* Add code coverage to unit tests Signed-off-by: Willem Pienaar <[email protected]> * Add coverage to PRs Signed-off-by: Willem Pienaar <[email protected]>
1 parent 77a7975 commit 1436a02

File tree

5 files changed

+39
-5
lines changed

5 files changed

+39
-5
lines changed

.github/workflows/integration_tests.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
python-version: [ 3.7, 3.8, 3.9 ]
15-
os: [ ubuntu-latest, macOS-latest ]
15+
os: [ ubuntu-latest ]
16+
env:
17+
OS: ${{ matrix.os }}
18+
PYTHON: ${{ matrix.python-version }}
1619
steps:
1720
- uses: actions/checkout@v2
1821
- name: Setup Python
@@ -31,4 +34,12 @@ jobs:
3134
- name: Install dependencies
3235
run: make install-python-ci-dependencies
3336
- name: Test python
34-
run: FEAST_TELEMETRY=False pytest --verbose --color=yes sdk/python/tests --integration
37+
run: FEAST_TELEMETRY=False pytest --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests --integration
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v1
40+
with:
41+
files: ./coverage.xml
42+
flags: integrationtests
43+
env_vars: OS,PYTHON
44+
fail_ci_if_error: true
45+
verbose: true

.github/workflows/pr_integration_tests.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
python-version: [ 3.7, 3.8, 3.9 ]
20-
os: [ ubuntu-latest, macOS-latest ]
20+
os: [ ubuntu-latest ]
2121
services:
2222
redis:
2323
image: redis
@@ -26,6 +26,9 @@ jobs:
2626
--health-interval 10s
2727
--health-timeout 5s
2828
--health-retries 5
29+
env:
30+
OS: ${{ matrix.os }}
31+
PYTHON: ${{ matrix.python-version }}
2932
steps:
3033
- uses: actions/checkout@v2
3134
with:
@@ -50,7 +53,15 @@ jobs:
5053
- name: Install dependencies
5154
run: make install-python-ci-dependencies
5255
- name: Test python
53-
run: FEAST_TELEMETRY=False pytest --verbose --color=yes sdk/python/tests --integration
56+
run: FEAST_TELEMETRY=False pytest --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests --integration
5457
env:
5558
REDIS_TYPE: REDIS
5659
REDIS_CONNECTION_STRING: redis:6379,db=0
60+
- name: Upload coverage to Codecov
61+
uses: codecov/codecov-action@v1
62+
with:
63+
files: ./coverage.xml
64+
flags: integrationtests
65+
env_vars: OS,PYTHON
66+
fail_ci_if_error: true
67+
verbose: true

.github/workflows/unit_tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
matrix:
1010
python-version: [ 3.7, 3.8, 3.9 ]
1111
os: [ ubuntu-latest, macOS-latest]
12+
env:
13+
OS: ${{ matrix.os }}
14+
PYTHON: ${{ matrix.python-version }}
1215
steps:
1316
- uses: actions/checkout@v2
1417
- name: Setup Python
@@ -20,6 +23,14 @@ jobs:
2023
run: make install-python-ci-dependencies
2124
- name: Test Python
2225
run: make test-python
26+
- name: Upload coverage to Codecov
27+
uses: codecov/codecov-action@v1
28+
with:
29+
files: ./coverage.xml
30+
flags: unittests
31+
env_vars: OS,PYTHON
32+
fail_ci_if_error: true
33+
verbose: true
2334

2435
unit-test-go:
2536
runs-on: ubuntu-latest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ install-python:
5353
python -m pip install -e sdk/python -U --use-deprecated=legacy-resolver
5454

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

5858
format-python:
5959
# Sort

sdk/python/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"gcsfs",
8282
"urllib3>=1.25.4",
8383
"pytest==6.0.0",
84+
"pytest-cov",
8485
"pytest-lazy-fixture==0.6.3",
8586
"pytest-timeout==1.4.2",
8687
"pytest-ordering==0.6.*",

0 commit comments

Comments
 (0)