Add Codecov coverage tracking for backend tests#12
Open
devin-ai-integration[bot] wants to merge 2 commits intodevelopfrom
Open
Add Codecov coverage tracking for backend tests#12devin-ai-integration[bot] wants to merge 2 commits intodevelopfrom
devin-ai-integration[bot] wants to merge 2 commits intodevelopfrom
Conversation
- Modify backend.yml to run pytest with coverage flags (--cov=xfd_api) - Generate coverage.xml report and copy from Docker container - Add codecov-action@v4 step to upload coverage to Codecov - Add Codecov badge to README.md Co-Authored-By: Jake Cosme <jake@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Add pytest-cov==6.0.0 to backend/requirements.txt for coverage support - Restore makemigrations call before pytest to match original Makefile behavior Co-Authored-By: Jake Cosme <jake@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Codecov integration to track backend test coverage trends over time. This PR modifies the GitHub Actions backend workflow to generate coverage reports during pytest runs and upload them to Codecov, plus adds a coverage badge to the README.
Changes:
.github/workflows/backend.ymlto run pytest with--cov=xfd_apiflags and generate XML coverage reportscodecov/codecov-action@v4step to upload coverage dataREADME.mdpytest-cov==6.0.0tobackend/requirements.txtfor coverage supportmakemigrationscall before pytest to match original Makefile behaviorUpdates since last revision
pytest-cov==6.0.0tobackend/requirements.txtto fix CI failure (pytest was not recognizing--covflags)python manage.py makemigrationsstep before pytest to preserve original test setup behavior from the MakefileReview & Testing Checklist for Human
CODECOV_TOKENsecret to GitHub repository settings after connecting the repo to Codecov at codecov.iocoverage.xmlat/app/coverage.xmlinside the containerfrontendCI job is failing due to pre-existingnpm auditvulnerabilities (glob, js-yaml) unrelated to this PRTest Plan
CODECOV_TOKENin GitHub repository secretsNotes
fail_ci_if_error: falseis set so CI won't fail if Codecov upload has issues (e.g., token not configured yet)backendto distinguish from potential future frontend coveragepytest-cov==6.0.0was added to requirements.txt since the backend Docker image did not have it installedLink to Devin run: https://app.devin.ai/sessions/694417ee8a9d47a6bac32021eebf0751
Requested by: Jake Cosme (@jakexcosme)