Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only upload 3 sets of test results to codecov (possible workaround for hanging builds) #4147

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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' ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to put some comment that old versions don't have coverage. So hopefully the next person, when 3.12 comes out, will know to put 3.11 in this list and put 3.12 on line 62.

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' ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto about comment to help us when bumping this version in the future

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",)