Description
Agri-Vision has a comprehensive test suite (12 test files, 89%+ code coverage) that can run in under 2 seconds. However, there is no CI/CD pipeline configured to automatically run these tests when changes are pushed or pull requests are opened. This means:
- Contributors can accidentally merge code that breaks existing tests
- Maintainers must manually clone and test PRs before merging
- There is no visible status check on PRs indicating pass/fail
- Code quality regressions go undetected until someone runs tests locally
Steps to Reproduce
- Open any pull request on the repository
- Observe there are no CI checks, status badges, or automated test runs
- Merge a PR with broken tests — the broken code enters the main branch undetected
Expected Behavior
- CI Pipeline: A GitHub Actions workflow (
.github/workflows/tests.yml) triggers on push and pull_request to the main branch
- Job Steps:
- Checkout the code
- Set up Python 3.10
- Install dependencies from
requirements.txt
- Run
python -m pytest with coverage
- Upload coverage report as an artifact
- Badge: Add a test status badge to the
README.md showing pass/fail
Implementation Hints
File (.github/workflows/tests.yml):
name: Run Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests with coverage
run: python -m pytest --cov=app --cov-report=xml --cov-report=html
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/
README.md badge:
[](https://github.com/neeru24/Agri-Vision/actions/workflows/tests.yml)
Affected Files
.github/workflows/tests.yml (new)
README.md (add status badge)
Labels
type:devops, level:beginner, type:testing
Description
Agri-Vision has a comprehensive test suite (12 test files, 89%+ code coverage) that can run in under 2 seconds. However, there is no CI/CD pipeline configured to automatically run these tests when changes are pushed or pull requests are opened. This means:
Steps to Reproduce
Expected Behavior
.github/workflows/tests.yml) triggers onpushandpull_requestto themainbranchrequirements.txtpython -m pytestwith coverageREADME.mdshowing pass/failImplementation Hints
File (
.github/workflows/tests.yml):README.md badge:
Affected Files
.github/workflows/tests.yml(new)README.md(add status badge)Labels
type:devops,level:beginner,type:testing