pandas-ai
pandas-ai copied to clipboard
Test coverage report
🚀 The feature
Test coverage report using coverage.py
to assure safety to users and devs.
Motivation, pitch
Discussed on discord with @gventuri
Alternatives
No response
Additional context
You can assign me for this task
Awesome, go for it @Lorenzobattistela 🚀
@gventuri I'm using cover.py
library to generate a nice HTML report about coverage. Test coverage badges are in general installed as GH actions and it is needed to configure env variables.
I'll need to update the CI, and I want to share it with you before (because .yml changes could mess up other workflow runs):
Something like this:
name: pandas_ai_ci
on:
push:
branches: [main]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pip install poetry==1.4.2
- name: Install dependencies
run: poetry install
- name: Lint with pylint
run: poetry run pylint pandasai examples
- name: Test with pytest and coverage
run: poetry run pytest --cov=pandasai --cov-report=xml --cov-report=html
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
with:
files: coverage.xml
For this to work, pandasAI would need to have an account on codecov and a token. I'm not aware about pricing, I think it is free for OS projects. I know it is also possible to display the badge with codecov. What do you think?
Coverage report only (without badges or images, just the cli) can be easily achieved installing coverage.py and running coverage run -m pytest
@Lorenzobattistela, will you move forward with this implementation?
@HenriqueAJNB sounds like a great idea. I'll create the account on codecov
shortly and setup the keys. I've also seen it's free for open source projects!
Sure! I'm a little bit overwhelmed today, but tomorrow I'll handle it.
@Lorenzobattistela any news about it? Can I help you somehow?