From 0367850a392ee3776248138551560625adaa1520 Mon Sep 17 00:00:00 2001 From: Eli Date: Wed, 25 Dec 2024 11:40:33 -0600 Subject: [PATCH] Update coverage settings. --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++------ README.md | 14 +++----------- pyproject.toml | 4 ++++ 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96b3664..8841d32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 0 # Fetch all history for coverage tracking + fetch-depth: 0 - name: Install uv uses: astral-sh/setup-uv@v4 @@ -44,18 +44,42 @@ jobs: run: | uv sync --all-extras --group test - - name: Run tests with coverage + - name: Create report directories run: | - uv run pytest --config-file pyproject.toml + mkdir -p tests/.reports - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + - name: Run tests with coverage + run: | + uv run pytest \ + -vv \ + --tb=short \ + --durations=5 \ + --cov=src/splitme_ai \ + --cov-branch \ + --cov-fail-under=0 \ + --cov-report=term-missing:skip-covered \ + --cov-report=json:tests/.reports/coverage.json \ + --asyncio-mode=auto \ + --numprocesses=auto + + - name: Verify coverage report + run: | + ls -la tests/.reports/coverage.json + echo "Coverage report size: $(stat -f%z tests/.reports/coverage.json)" + echo "Coverage report content preview:" + head -n 20 tests/.reports/coverage.json + continue-on-error: true + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml + files: tests/.reports/coverage.json flags: unittests-${{ matrix.python-version }} name: Python ${{ matrix.python-version }} fail_ci_if_error: true + directory: tests/.reports + verbose: true build: name: Build Package diff --git a/README.md b/README.md index 065435e..1c0f81a 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ splitme-ai \ --split.settings.o examples/output-h2 ``` -__Example 2:__ Split on heading level 2 and generate an [mkdocs-yml] configuration file: +__Example 2:__ Split on heading level 2 and generate an [mkdocs.yml] configuration file: ```sh splitme-ai \ @@ -161,17 +161,9 @@ Contributions are welcome! For bug reports, feature requests, or questions, plea Copyright © 2024 [splitme-ai][splitme-ai].
Released under the [MIT][mit-license] license. - - -
- - Return to Top + Return to Top
@@ -194,4 +186,4 @@ Released under the [MIT][mit-license] license. [pipx]: https://pipx.pypa.io/stable/ [uv]: https://docs.astral.sh/uv/ [mkdocs]: https://www.mkdocs.org/ -[mkdocs-yml]: https://www.mkdocs.org/user-guide/configuration/ \ No newline at end of file +[mkdocs.yml]: https://www.mkdocs.org/user-guide/configuration/ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 3ac4ca3..2c007b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -143,6 +143,10 @@ omit = [ ] source = ["splitme_ai"] +[tool.coverage.json] +output = "tests/.reports/coverage.json" +pretty_print = true + [tool.pyright] typeCheckingMode = "strict" reportMissingTypeStubs = false