Skip to content

Commit

Permalink
test(tests): added codecoverage percentage checks [2024-11-27]
Browse files Browse the repository at this point in the history
  • Loading branch information
CHRISCARLON committed Nov 27, 2024
1 parent c1bc3b0 commit 3494ab3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/herding_cats_explorer_tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: HerdingCats Unit Tests

on:
push:
branches:
- main
paths:
- "tests/**"
pull_request:
branches:
- main

jobs:
test:
Expand All @@ -18,15 +20,32 @@ jobs:
with:
python-version: "3.11"

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Configure Poetry
run: |
poetry config virtualenvs.create false
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest requests loguru pandas polars duckdb==1.0.0 boto3 pyarrow
poetry install --no-interaction
- name: Create pytest.ini
run: |
echo "[pytest]" > pytest.ini
echo "pythonpath = ." >> pytest.ini
- name: Run tests
run: pytest tests/
- name: Run tests with coverage
run: |
poetry run pytest tests/ --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion tests/open_data_soft/test_ods_session_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_cat_session_creation(domain):
session.base_url == f"https://{domain}"
), "OpenDataSoftCatSession should have the correct base URL"
except Exception as e:
pytest.fail(f"Failed to create OpenDataSoftCatSession: {str(e)}")
pytest.fail(f"Failed to create OpenDataSoftCatSession!: {str(e)}")


def test_cat_session_start(domain):
Expand Down

0 comments on commit 3494ab3

Please sign in to comment.