Skip to content

Commit 4ccfe84

Browse files
authored
CI: Add back coverage check (#18600)
1 parent 23ad3eb commit 4ccfe84

File tree

1,180 files changed

+105155
-96943
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,180 files changed

+105155
-96943
lines changed

.github/workflows/coverage.yml

-81
This file was deleted.

.github/workflows/unit_test.yml

+22-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
# How many concurrent processes running pytest in a single CI job
11+
NUM_WORKERS: 8
12+
# Tests will fail if coverage percentage is below this number
13+
COV_FAIL_UNDER: 50
14+
# Which Python from the matrix will be used to run the coverage check
15+
COV_PYTHON_VERSION: 3.12
16+
917
jobs:
1018
test:
1119
runs-on: ubuntu-latest-unit-tester
@@ -25,10 +33,20 @@ jobs:
2533
enable-cache: true
2634

2735
- name: Run tests
28-
id: packages-to-test
36+
if: ${{ matrix.python-version != env.COV_PYTHON_VERSION }}
37+
shell: bash
38+
run: |
39+
git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
40+
uv run -- python -u scripts/run_ci_tests.py \
41+
--workers ${{ env.NUM_WORKERS }} \
42+
--base-ref=${{ github.event.pull_request.base.ref }}
43+
44+
- name: Run tests with coverage
45+
if: ${{ matrix.python-version == env.COV_PYTHON_VERSION }}
2946
shell: bash
30-
env:
31-
NUM_WORKERS: 8
3247
run: |
3348
git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
34-
uv run -- python -u scripts/run_ci_tests.py --workers ${{ env.NUM_WORKERS }} --base-ref=${{ github.event.pull_request.base.ref }}
49+
uv run -- python -u scripts/run_ci_tests.py \
50+
--workers ${{ env.NUM_WORKERS }} \
51+
--base-ref=${{ github.event.pull_request.base.ref }} \
52+
--cov-fail-under=${{ env.COV_FAIL_UNDER }}

llama-index-core/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dev = [
88
"boto3==1.33.6",
99
"botocore>=1.33.13",
1010
"codespell[toml]>=v2.2.6",
11+
"diff-cover>=9.2.0",
1112
"llama-cloud>=0.0.6",
1213
"mypy==1.11.0",
1314
"openai",

llama-index-core/uv.lock

+72-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

llama-index-integrations/agent/llama-index-agent-coa/pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ build-backend = "hatchling.build"
66
dev = [
77
"black[jupyter]<=23.9.1,>=23.7.0",
88
"codespell[toml]>=v2.2.6",
9+
"diff-cover>=9.2.0",
910
"ipython==8.10.0",
1011
"jupyter>=1.0.0,<2",
1112
"mypy==0.991",
1213
"pre-commit==3.2.0",
1314
"pylint==2.15.10",
1415
"pytest==7.2.1",
16+
"pytest-cov>=6.1.1",
1517
"pytest-mock==3.11.1",
1618
"ruff==0.0.292",
17-
"tree-sitter-languages>=1.8.0,<2",
1819
"types-Deprecated>=0.1.0",
1920
"types-PyYAML>=6.0.12.12,<7",
2021
"types-protobuf>=4.24.0.4,<5",

0 commit comments

Comments
 (0)