diff options
author | Jeremy Bettis <jbettis@google.com> | 2021-12-01 12:16:29 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-12-01 23:08:41 +0000 |
commit | 9e6cf67e91c7432aef9609b2a9778125b07146b1 (patch) | |
tree | ef9128d83c10b75a9a54d86656151ebfb87ab3ed /.gitlab-ci.yml | |
parent | 5d6dfc1e5f91583c7e26d27073a6401224fe32c5 (diff) | |
download | chrome-ec-9e6cf67e91c7432aef9609b2a9778125b07146b1.tar.gz |
zephyr: Change order of coverage merges
Change `zmake configure --coverage --build` to only build the
all.libraries target (instead of failing as it does now), and generate
an lcov file.
Change `zmake coverage` to skip non-test projects. It hasn't actually
been useful to have a coverage report that includes all projects.
Change .gitlab-ci.yml commands from
build tests & boards coverage, merge, remove zephyr dirs, remove
non-board files, generate report
to build tests, merge, remove zephyr dirs, build board coverage, remove
zephyr dirs, merge with tests, remove non-board files, generate report.
This should increase coverage numbers, because we won't include #ifdefs
that both the board and tests don't use, but other boards do use. This
does not fix the problem of a test having an #ifdef that the board
doesn't have, but those should be smaller, and easier to fix.
Before: https://gitlab.com/zephyr-ec/ec/-/pipelines/420506965/builds
After: https://gitlab.com/zephyr-ec/ec/-/pipelines/420547936/builds
BRANCH=None
BUG=b:207689703
TEST=Pushed to gitlab coverage branch
Change-Id: Ifad0d098e5db9ef0ee55b760aaa7a8da9d006387
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310533
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Tristan Honscheid <honscheid@google.com>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6fe0eda1b1..e1956e46e2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -89,16 +89,37 @@ seed_cache: # Users of this template must set: # $PROJECT to the project to build. E.g., "lazor" +# Builds the project with coverage enabled, removes the non-ec files. +# Then merges with the tests, excludes all files not used by this project, +# and generates a report. .coverage_template: &coverage_template stage: test needs: ["merged_coverage", "zephyr_coverage"] script: - - grep "SF:" "build/zcoverage/${PROJECT}.info" | sort -u | sed -e 's|^SF:||' | xargs lcov -o build/no_zephyr_${PROJECT}.info -e build/merged_no_zephyr.info - - /usr/bin/genhtml -q -o build/no_zephyr_${PROJECT}_rpt -t "${PROJECT} coverage w/o zephyr" -p ${EC_DIR} -s build/no_zephyr_${PROJECT}.info + - zmake --zephyr-base "${ZEPHYR_BASE}" + --modules-dir "${MODULES_DIR}" -l DEBUG configure -b --coverage + -B "${BUILD_DIR}/${PROJECT}" -t ${TOOLCHAIN:-zephyr} + "${PROJECT}" + - lcov -o "${BUILD_DIR}/${PROJECT}/merged.info" + -a "${BUILD_DIR}/${PROJECT}/lcov.info" -a build/merged.info + - lcov -o "${BUILD_DIR}/${PROJECT}/no_zephyr.info" + -r "${BUILD_DIR}/${PROJECT}/lcov.info" "${ZEPHYR_BASE}/**" + "${MODULES_DIR}/*" "zephyr/drivers/*" '/usr/include/x86_64-linux-gnu/*' + - lcov -o "${BUILD_DIR}/${PROJECT}/merged_no_zephyr.info" + -r "${BUILD_DIR}/${PROJECT}/merged.info" "${ZEPHYR_BASE}/**" + "${MODULES_DIR}/*" "zephyr/drivers/*" '/usr/include/x86_64-linux-gnu/*' + - grep "SF:" "${BUILD_DIR}/${PROJECT}/no_zephyr.info" | sort -u | + sed -e 's|^SF:||' | xargs lcov + -o "${BUILD_DIR}/${PROJECT}/filtered_no_zephyr.info" + -e "${BUILD_DIR}/${PROJECT}/merged_no_zephyr.info" + - /usr/bin/genhtml -q -o "${BUILD_DIR}/${PROJECT}/filtered_no_zephyr_rpt" + -t "${PROJECT} coverage w/o zephyr" + -p ${EC_DIR} + -s "${BUILD_DIR}/${PROJECT}/filtered_no_zephyr.info" artifacts: paths: - - build/*.info - - build/*_rpt + - build/${PROJECT}/*.info + - build/${PROJECT}/*_rpt expire_in: 1 week coverage: '/lines\.*: \d+\.\d+%/' |