Skip to content

Commit

Permalink
Only upload 3 sets of test results to codecov (possible workaround fo…
Browse files Browse the repository at this point in the history
…r hanging builds) (#4147)
  • Loading branch information
barrywhart committed Dec 9, 2022
1 parent 71d6cdb commit 42db36b
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/codecov.yml
Expand Up @@ -10,7 +10,7 @@ codecov:
disable_default_path_fixes: no # yamllint disable-line rule:truthy
require_ci_to_pass: yes # yamllint disable-line rule:truthy
notify:
after_n_builds: 10
after_n_builds: 3
wait_for_ci: yes # yamllint disable-line rule:truthy

coverage:
Expand Down
65 changes: 59 additions & 6 deletions .github/workflows/ci-tests.yml
Expand Up @@ -41,7 +41,27 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
# We don't enforce coverage on older Python versions.
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
name: Python ${{ matrix.python-version }} tests
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install tox
- name: Run the tests
run: |
tox -e py -- -n 2 test
python-version-tests-cov:
runs-on: ubuntu-latest
strategy:
matrix:
# We enforce coverage on this, the latest Python version.
python-version: [ '3.11' ]
name: Python ${{ matrix.python-version }} tests
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -120,7 +140,44 @@ jobs:
- 5432:5432
strategy:
matrix:
dbt-version: [ 'dbt020', 'dbt021', 'dbt100', 'dbt130' ]
# We don't enforce coverage on older dbt versions.
dbt-version: [ 'dbt020', 'dbt021', 'dbt100' ]
name: DBT Plugin ${{ matrix.dbt-version }} tests
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
pip install tox
- name: Run the tests
run: |
tox -e ${{ matrix.dbt-version }} -- plugins/sqlfluff-templater-dbt
dbt-tests-cov:
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
strategy:
matrix:
# We enforce coverage on this, the latest dbt version.
dbt-version: [ 'dbt130' ]
name: DBT Plugin ${{ matrix.dbt-version }} tests
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -202,10 +259,6 @@ jobs:
# None of these test need temp dir set
run: |
python -m tox -e dbt100-winpy -- plugins/sqlfluff-templater-dbt
- name: Upload Coverage Report
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
pip-test-pull-request:
# Test that using pip install works as we've missed
# some dependencies in the past - see #1842
Expand Down
2 changes: 1 addition & 1 deletion src/sqlfluff/__init__.py
Expand Up @@ -8,7 +8,7 @@
# Import metadata (using importlib_metadata backport for python versions <3.8)
if sys.version_info >= (3, 8):
from importlib import metadata
else:
else: # pragma: no cover
import importlib_metadata as metadata

__all__ = (
Expand Down
2 changes: 1 addition & 1 deletion src/sqlfluff/core/cached_property.py
Expand Up @@ -3,7 +3,7 @@

if sys.version_info >= (3, 8):
from functools import cached_property
else:
else: # pragma: no cover
from backports.cached_property import cached_property

__all__ = ("cached_property",)

0 comments on commit 42db36b

Please sign in to comment.