mirror of
https://github.com/qdrant/qdrant.git
synced 2026-08-05 17:40:55 -05:00
* 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
24 lines
1.1 KiB
Bash
Executable File
24 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Usage: tools/integration-test-coverage.sh
|
|
#
|
|
# If using locally, occasionally run `cargo llvm-cov clean` to avoid bloating `target/llvm-cov-target` dir with .profraw files
|
|
|
|
|
|
# Check if target/llvm-cov-target/debug/qdrant exists, if not build it:
|
|
if [ ! -f target/llvm-cov-target/debug/qdrant ]; then
|
|
echo "Building qdrant with LLVM coverage instrumentation..."
|
|
RUSTFLAGS="-C instrument-coverage" cargo build --features "service_debug data-consistency-check" --locked --target-dir target/llvm-cov-target
|
|
else
|
|
echo "INFO: target/llvm-cov-target/debug/qdrant already exists, skipping build step."
|
|
fi
|
|
|
|
export COVERAGE=1
|
|
|
|
poetry -C tests run ./tests/integration-tests.sh # generates qdrant-openapi-*.profraw files
|
|
poetry -C tests run ./tests/integration-tests.sh distributed # generates qdrant-openapi-*.profraw files
|
|
poetry -C tests run pytest tests/consensus_tests --durations=10 # generates qdrant-consensus-tests-*.profraw files
|
|
|
|
# Merges all the .profraw files into a single .profdata file and generates the lcov report
|
|
cargo llvm-cov report --lcov --output-path integration-test-coverage.lcov
|