Skip to content

[DO NOT MERGE] Debug coverage issue #1252

[DO NOT MERGE] Debug coverage issue

[DO NOT MERGE] Debug coverage issue #1252

Workflow file for this run

name: CI (poetry)
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
tests_tasks:
name: "Tasks, Python ${{ matrix.python-version }}"
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- run: pipx install poetry==1.8.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: poetry install --with dev --without docs --no-interaction -E fractal-tasks
- name: Test tasks with pytest
env:
COVERAGE_FILE: coverage-data-tasks-${{ matrix.python-version }}
run: poetry run coverage run --debug=config,trace,pathmap -m pytest tests/dev/test_create_schema_for_single_task.py::test_create_schema_for_single_task_usage_1 -s >>file.txt 2>&1
- run: cat file.txt
- run: grep cellpose file.txt
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-tasks-${{ matrix.python-version }}
path: coverage-data-tasks-${{ matrix.python-version }}*
coverage:
name: Coverage
runs-on: ubuntu-22.04
needs: [tests_tasks]
steps:
- uses: actions/checkout@v4
- run: pipx install poetry==1.8.2
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: poetry install --with dev
- name: Download data
uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true
- name: Combine coverage
# Combines all the downloaded coverage artifacts in a single `.coverage` file,
# which will then be used by `py-cov-action/python-coverage-comment-action`.
# We added this step to replace the variable `MERGE_COVERAGE_FILES: true`
# in the next step, which had started to raise errors
# (https://github.com/fractal-analytics-platform/fractal-server/pull/1725).
run: poetry run coverage combine --debug=config,trace,pathmap coverage-data-*
- name: Add coverage comment to Pull Requests
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
MINIMUM_GREEN: 90
MINIMUM_ORANGE: 60
ANNOTATE_MISSING_LINES: true
ANNOTATION_TYPE: notice