Skip to content

Commit

Permalink
update coverage configuration (#316)
Browse files Browse the repository at this point in the history
Signed-off-by: wxy407827 <wxy407827@antgroup.com>
  • Loading branch information
wxyucs authored Jan 13, 2025
1 parent 178681c commit e23c784
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
31 changes: 30 additions & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,37 @@ coverage:
if_ci_failed: error

comment:
layout: "header, diff, files, footer"
layout: "header, diff, flags, components, footer"
behavior: default
require_changes: false
branches:
- main

component_management:
default_rules:
statuses:
- type: project
target: auto
branches:
- "!main"
individual_components: # in alphabetical
- component_id: module_common
name: common
paths:
- src/*
- component_id: module_datacell
name: datacell
paths:
- src/data_cell/**
- src/io/**
- src/quantization/**
- component_id: module_index
name: index
paths:
- src/index/**
- src/algorithm/**
- extern/diskann/**
- component_id: module_simd
name: simd
paths:
- src/simd/**
File renamed without changes.
12 changes: 5 additions & 7 deletions scripts/collect_cpp_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -x

SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$( cd "${SCRIPTS_DIR}/../" && pwd )"
PARENT_DIR="$( cd "${ROOT_DIR}/../" && pwd )"

COVERAGE_DIR="${ROOT_DIR}/coverage"
if [ -d "${COVERAGE_DIR}" ]; then
Expand All @@ -14,25 +13,24 @@ else
mkdir -p "${COVERAGE_DIR}"
fi

pushd "${PARENT_DIR}"
lcov --rc branch_coverage=1 \
--rc geninfo_unexecuted_blocks=1 \
--parallel 8 \
--directory vsag \
--directory . \
--capture \
--substitute "s#${PARENT_DIR}/##g" \
--substitute "s#${ROOT_DIR}/##g" \
--ignore-errors mismatch,mismatch \
--ignore-errors count,count \
--output-file ${COVERAGE_DIR}/coverage.info
lcov --remove ${COVERAGE_DIR}/coverage.info \
'/usr/*' \
'vsag/build/*' \
'vsag/tests/*' \
'build/*' \
'tests/*' \
'*/expected.hpp' \
--ignore-errors inconsistent,inconsistent \
--output-file ${COVERAGE_DIR}/coverage.info
lcov --list ${COVERAGE_DIR}/coverage.info \
--ignore-errors inconsistent,inconsistent
popd

pushd "${COVERAGE_DIR}"
coverages=$(ls coverage.info)
Expand Down

0 comments on commit e23c784

Please sign in to comment.