diff --git a/.github/workflows/herding_cats_explorer_tests.yml b/.github/workflows/herding_cats_explorer_tests.yml index 3767e47..bf41a63 100644 --- a/.github/workflows/herding_cats_explorer_tests.yml +++ b/.github/workflows/herding_cats_explorer_tests.yml @@ -1,11 +1,13 @@ name: HerdingCats Unit Tests - on: push: branches: - main paths: - "tests/**" + pull_request: + branches: + - main jobs: test: @@ -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 }} diff --git a/tests/open_data_soft/test_ods_session_creation.py b/tests/open_data_soft/test_ods_session_creation.py index 20fb552..f2b865d 100644 --- a/tests/open_data_soft/test_ods_session_creation.py +++ b/tests/open_data_soft/test_ods_session_creation.py @@ -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):