Files
qdrant/.github/workflows/coverage.yml
Kumar Shivendu c8a960604a Introduce coverage reports for integration tests (#6414)
* Introduce coverage reports for integration tests

* Install cargo-llvm-cov

* Use multiline script

* Explicityl setup COVERAGE env var

* fix integration tests and log generated data

* fix ls path

* upload lcov file to GH artifacts

* integration profraw dynamic filename

* Fix llvm profile filename template

* Use interrupt instead of kill and merge consensus test results into same file

* Drop upload artifact stage

* install llvm-cov

* upload as artifact and export coverage files

* try simplifying workflow

* Migrate coverage generation to existing dedicated gh workflow

* trigger on coverage related branches

* Build only if qdrant binary with cov doesnt exist

* Use valid yaml

* include mode in profraw filename

* split coverage workflow into parallel jobs

* add poetry version to env

* log poetry version to install

* clean up integration test workflow

* Simplify comments
2025-04-25 16:42:41 +05:30

110 lines
3.8 KiB
YAML

name: Coverage Report - dev
on:
workflow_dispatch: # Trigger from UI for selected branch
schedule:
- cron: "0 0 * * *" # Every day at midnight UTC
env:
POETRY_VERSION: 1.8.5
jobs:
unit-coverage:
runs-on: ubuntu-latest
steps:
- name: Install minimal stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: actions/checkout@v4
with:
# If scheduled by cron, run for dev branch, Otherwise specified branch (for workflow dispatch & push)
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref_name }}
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Install llvm-cov
run: cargo install cargo-llvm-cov && sudo apt install -y lcov
- name: Run unit tests with coverage
run: RUN_PER_PACKAGE=true tools/unit-test-coverage.sh
- name: Upload unit test coverage artifact
uses: actions/upload-artifact@v4
with:
name: unit-test-coverage
path: unit-test-coverage.lcov
retention-days: 1
integration-coverage:
runs-on: ubuntu-latest
steps:
- name: Install minimal stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: actions/checkout@v4
with:
# If scheduled by cron, run for dev branch, Otherwise specified branch (for workflow dispatch & push)
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref_name }}
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Install llvm-cov
run: cargo install cargo-llvm-cov && sudo apt install -y lcov
- name: Install dependencies
run: sudo apt-get install clang
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
echo "Installing Poetry $POETRY_VERSION"
curl -sSL https://install.python-poetry.org | python3 - --version "$POETRY_VERSION"
poetry -C tests check --lock
poetry -C tests install --no-root
- name: Run integration tests with coverage
run: tools/integration-test-coverage.sh
- name: Upload integration test coverage artifact
uses: actions/upload-artifact@v4
with:
name: integration-test-coverage
path: integration-test-coverage.lcov
retention-days: 1
merge-and-upload:
needs: [unit-coverage, integration-coverage]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref_name }}
- name: Install lcov
run: sudo apt install -y lcov
- name: Download unit test coverage
uses: actions/download-artifact@v4
with:
name: unit-test-coverage
- name: Download integration test coverage
uses: actions/download-artifact@v4
with:
name: integration-test-coverage
- name: Merge coverage reports
run: lcov -a unit-test-coverage.lcov -a integration-test-coverage.lcov -o merged.lcov
- name: Upload coverage data to Codecov
uses: codecov/codecov-action@v5
with:
files: merged.lcov
override_branch: ${{ github.event_name == 'schedule' && 'dev' || github.ref_name }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true