Skip to content

Commit

Permalink
Remove codecov package and use Github action to upload coverage instead
Browse files Browse the repository at this point in the history
Also, fix some failing tests and don't stop tests on first failure.
  • Loading branch information
ccordoba12 committed Apr 15, 2023
1 parent 12450ee commit f2315ce
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 19 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/linux-pip-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ jobs:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUNNER_OS: 'ubuntu'
USE_CONDA: 'false'
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['2.7', '3.7', '3.8', '3.9']
PYTHON_VERSION: ['2.7', '3.8', '3.9', '3.10']
timeout-minutes: 20
steps:
- name: Checkout branch
Expand Down Expand Up @@ -59,6 +60,7 @@ jobs:
xvfb-run --auto-servernum pytest spyder_kernels --color=yes --cov=spyder_kernels -x -vv || \
xvfb-run --auto-servernum pytest spyder_kernels --color=yes --cov=spyder_kernels -x -vv
- name: Upload coverage to Codecov
if: matrix.PYTHON_VERSION == '3.8'
shell: bash -l {0}
run: codecov -t 02fa9892-fa7f-4cf8-ac3c-d54143ddc933
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
verbose: true
7 changes: 4 additions & 3 deletions .github/workflows/linux-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
xvfb-run --auto-servernum pytest spyder_kernels --color=yes --cov=spyder_kernels -x -vv || \
xvfb-run --auto-servernum pytest spyder_kernels --color=yes --cov=spyder_kernels -x -vv
- name: Upload coverage to Codecov
if: matrix.PYTHON_VERSION == '3.8'
shell: bash -l {0}
run: codecov -t 02fa9892-fa7f-4cf8-ac3c-d54143ddc933
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
verbose: true
12 changes: 9 additions & 3 deletions .github/workflows/macos-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUNNER_OS: 'macos'
USE_CONDA: 'true'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -57,6 +58,11 @@ jobs:
- name: Run tests
shell: bash -l {0}
run: |
pytest spyder_kernels --color=yes --cov=spyder_kernels -x -vv || \
pytest spyder_kernels --color=yes --cov=spyder_kernels -x -vv || \
pytest spyder_kernels --color=yes --cov=spyder_kernels -x -vv
pytest spyder_kernels --color=yes --cov=spyder_kernels -vv || \
pytest spyder_kernels --color=yes --cov=spyder_kernels -vv || \
pytest spyder_kernels --color=yes --cov=spyder_kernels -vv
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
verbose: true
12 changes: 9 additions & 3 deletions .github/workflows/windows-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUNNER_OS: 'windows'
USE_CONDA: 'true'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -57,6 +58,11 @@ jobs:
- name: Run tests
shell: bash -l {0}
run: |
pytest spyder_kernels --color=yes --cov=spyder_kernels -x -vv || \
pytest spyder_kernels --color=yes --cov=spyder_kernels -x -vv || \
pytest spyder_kernels --cov=spyder_kernels -x -vv
pytest spyder_kernels --color=yes --cov=spyder_kernels -vv || \
pytest spyder_kernels --color=yes --cov=spyder_kernels -vv || \
pytest spyder_kernels --cov=spyder_kernels -vv
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
verbose: true
1 change: 0 additions & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
codecov
cython
dask
flaky
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def get_version(module='spyder_kernels'):
]

TEST_REQUIREMENTS = [
'codecov',
'cython',
'dask[distributed]',
'flaky',
Expand Down
8 changes: 5 additions & 3 deletions spyder_kernels/console/tests/test_console_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,13 @@ def myFunc(i):


@flaky(max_runs=3)
@pytest.mark.skipif(
not PY3, reason="Only meant for Python 3")
@pytest.mark.skipif(not PY3, reason="Only meant for Python 3")
@pytest.mark.skipif(
sys.platform == 'darwin' and sys.version_info[:2] == (3, 8),
reason="Fails on Mac with Python 3.8")
@pytest.mark.skipif(
os.environ.get('USE_CONDA') != 'true',
reason="Doesn't work with pip packages")
def test_dask_multiprocessing(tmpdir):
"""
Test that dask multiprocessing works on Python 3.
Expand Down Expand Up @@ -1107,7 +1109,7 @@ def test_locals_globals_in_pdb(kernel):
not sys.platform.startswith('linux'),
reason="Doesn't work reliably on Windows and Mac")
@pytest.mark.skipif(
not bool(os.environ.get('USE_CONDA')),
os.environ.get('USE_CONDA') != 'true',
reason="Doesn't work with pip packages")
@pytest.mark.skipif(
sys.version_info[:2] < (3, 8),
Expand Down
2 changes: 1 addition & 1 deletion spyder_kernels/utils/tests/test_nsview.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def test_get_type_string():
assert get_type_string(series) == 'Series'

index = pd.Index([1, 2, 3])
assert get_type_string(index) == 'Int64Index'
assert get_type_string(index) in ['Int64Index', 'Index']

# PIL images
img = PIL.Image.new('RGB', (256,256))
Expand Down

0 comments on commit f2315ce

Please sign in to comment.