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

add codecov #42

Merged
merged 6 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: pip3 install hatch

- name: "Run Tests"
run: hatch run dev-env:pytest tests
run: hatch run dev-env:unit

- name: "Get current date"
if: always()
Expand All @@ -66,10 +66,9 @@ jobs:
CURRENT_DATE=$(date +'%Y-%m-%dT%H_%M_%S') # no colons allowed for artifacts
echo "date=$CURRENT_DATE" >> $GITHUB_OUTPUT

# TODO: what setup is needed here?
# - name: Upload Unit Test Coverage to Codecov
# if: ${{ matrix.python-version == '3.11' }}
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# flags: unit
- name: Upload Unit Test Coverage to Codecov
if: ${{ matrix.python-version == '3.11' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
13 changes: 13 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ignore:
- ".github"
- ".changes"
coverage:
status:
project:
default:
target: auto
threshold: 0.1% # Reduce noise by ignoring rounding errors in coverage drops
patch:
default:
target: auto
threshold: 80%
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ exclude = [
packages = ["dbt_common"]

[tool.hatch.envs.dev-env.scripts]
all = ["pre-commit run --all-files"]
unit = "- python -m pytest --cov --cov-report=xml {args:tests/unit}"

[tool.hatch.envs.dev-env]
description = "Env for running development commands like pytest / pre-commit"
dependencies = [
"pytest~=7.3",
"pytest-xdist~=3.2",
"pytest-cov",
emmyoop marked this conversation as resolved.
Show resolved Hide resolved
emmyoop marked this conversation as resolved.
Show resolved Hide resolved
"httpx~=0.24",
"hypothesis~=6.87",
"pre-commit~=3.2",
Expand Down