diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b1fb23a..d8bd3a6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,8 @@ jobs: - name: Run tests with pytest run: | - pytest --cov=bad_path --cov-report=xml --cov-report=term + # Generate multiple formats: xml for Codecov, lcov for Coveralls, term for local viewing + pytest --cov=bad_path --cov-report=xml --cov-report=term --cov-report=lcov - name: Upload coverage to Codecov uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v4.6.0 @@ -41,3 +42,29 @@ jobs: with: file: ./coverage.xml fail_ci_if_error: false + + - name: Upload coverage to Codacy + uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1.3.0 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: ./coverage.xml + flag-name: ${{ matrix.os }}-py${{ matrix.python-version }} + continue-on-error: true + + - name: Upload coverage to Coveralls (parallel) + uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + file: ./coverage.lcov + flag-name: ${{ matrix.os }}-py${{ matrix.python-version }} + parallel: true + + coveralls-finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/.gitignore b/.gitignore index b7faf40..91085e3 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ htmlcov/ .cache nosetests.xml coverage.xml +coverage.lcov *.cover *.py.cover .hypothesis/ diff --git a/CODE_REVIEW.md b/CODE_REVIEW.md index 41c7996..2bb98b4 100644 --- a/CODE_REVIEW.md +++ b/CODE_REVIEW.md @@ -96,12 +96,11 @@ No high-priority issues found. - **Severity**: Low - **Areas with missing coverage**: - - Windows-specific path checker (not tested on Linux CI) - - Darwin-specific path checker (not fully tested on Linux CI) - Some error handling paths in BasePathChecker -- **Current**: 73% coverage +- **Current**: 73% coverage (merged from all platforms via Coveralls and Codacy) - **Target**: 85%+ coverage -- **Recommendation**: Add more unit tests for platform-specific code paths +- **Recommendation**: Add more unit tests for error handling code paths +- **Note**: Platform-specific code (Windows, Darwin) is now properly tracked via multi-platform coverage merging with Coveralls and Codacy --- @@ -135,7 +134,7 @@ No high-priority issues found. ### Current State - **Total Tests**: 90 (83 passed, 7 skipped on Linux) -- **Coverage**: 73% +- **Coverage**: 73% (merged from all platforms via Coveralls and Codacy) - **Platforms**: Linux (primary), Windows (CI), macOS (CI) ### Coverage by Module @@ -143,13 +142,13 @@ No high-priority issues found. - `bad_path/__init__.py`: 100% - `bad_path/checker.py`: 75% (198/198 statements, 50 missed) - `bad_path/platforms/posix.py`: 100% -- `bad_path/platforms/darwin.py`: 0% (tested on macOS CI only) -- `bad_path/platforms/windows.py`: 0% (tested on Windows CI only) +- `bad_path/platforms/darwin.py`: Coverage tracked on macOS CI +- `bad_path/platforms/windows.py`: Coverage tracked on Windows CI + +**Note**: With Coveralls and Codacy integration, platform-specific code coverage is now properly tracked and merged from all CI platforms (Linux, Windows, macOS). ### Missing Test Coverage -- Windows reserved name checking (lines 640-662) -- Darwin path loading (lines 672-686) - Error handling for path resolution failures - Edge cases with very long paths - Unicode path handling @@ -239,13 +238,13 @@ No high-priority issues found. ### CI/CD Strengths - Comprehensive test matrix +- Multi-platform coverage reporting via Coveralls and Codacy - Automated documentation deployment - Automated package publishing - Proper use of GitHub Actions v4/v5 ### CI/CD Recommendations -- Add code coverage reporting to PR comments - Add security scanning (e.g., Bandit, Safety) - Consider adding dependency update automation (Dependabot) - Add CHANGELOG generation automation diff --git a/README.md b/README.md index f9589a4..0a76b08 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # bad_path [![Tests](https://github.com/stonerlab/bad_path/actions/workflows/tests.yml/badge.svg)](https://github.com/stonerlab/bad_path/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/github/stonerlab/bad_path/badge.svg?branch=main)](https://coveralls.io/github/stonerlab/bad_path?branch=main) +[![Codacy coverage](https://app.codacy.com/project/badge/Coverage/68df7b8d1d044f17887b7d0df56b4aef)](https://app.codacy.com/gh/stonerlab/bad_path/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage) [![Documentation](https://github.com/stonerlab/bad_path/actions/workflows/docs.yml/badge.svg)](https://stonerlab.github.io/bad_path/) [![PyPI version](https://badge.fury.io/py/bad-path.svg)](https://badge.fury.io/py/bad-path) [![Anaconda Version](https://anaconda.org/phygbu/bad_path/badges/version.svg)](https://anaconda.org/phygbu/bad_path/badges/version.svg) diff --git a/pyproject.toml b/pyproject.toml index 095a0d8..03579e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ dependencies = [] dev = [ "pytest>=7.0", "pytest-cov>=4.0", + "coveralls>=3.0", "sphinx>=7.0", "sphinx-better-theme>=0.1.5", "ruff>=0.1.0",