Skip to content

Commit 0a56bb6

Browse files
committed
[CI] Issue: HPCINFRA-3898 coverity agressiveness and exclude files
Due to PR #312 currently the cov.sh script does not calculate the number of errors from the scan correctly (the cov-format-errors command fails), this is due to --exclude-files flag being unique (cant use it twice). Combine both exclude-files flags to one regex Add -o pipefail so the task will fail if cov-format fails (failiure was masked by the pipe commands) Change --aggressiveness-level to medium Signed-off-by: NirWolfer <[email protected]>
1 parent 1ccffc5 commit 0a56bb6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

contrib/jenkins_tests/cov.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ eval "cov-manage-emit --config ${cov_dir}/coverity_config.xml --dir ${cov_build}
4040
sleep 1
4141

4242
eval "cov-analyze --config ${cov_dir}/coverity_config.xml \
43-
--all --aggressiveness-level low \
43+
--all --aggressiveness-level medium \
4444
--enable-fnptr --fnptr-models --paths 20000 \
4545
--disable-parse-warnings \
4646
--dir ${cov_build}"
4747
rc=$(($rc+$?))
4848

49+
echo "rc: $rc"
50+
4951
if [[ "${do_coverity_snapshot}" == true ]]; then
5052
cov-commit-defects --ssl --on-new-cert trust \
5153
--url https://coverity.mellanox.com:8443 \
@@ -56,17 +58,19 @@ if [[ "${do_coverity_snapshot}" == true ]]; then
5658
rc=$(($rc+$?))
5759
fi
5860

59-
set -eE
61+
set -eEo pipefail
6062

6163
# Excluded files for the local report generated by command "cov-format-errors":
6264
# * /usr/include/.*$ (all standard library issues can't be fixed)
6365
# * ${WORKSPACE}/third_party/.* (third party code)
6466

6567
# shellcheck disable=SC2001
66-
nerrors=$(cov-format-errors --exclude-files '/usr/include/.*$' --exclude-files '${WORKSPACE}/third_party/.*$' \
68+
nerrors=$(cov-format-errors --exclude-files "(/usr/include/.*$ | ${WORKSPACE}/third_party/.*$)" \
6769
--dir $cov_build --html-output "$cov_build/output/errors" | awk '/Processing [0-9]+ errors?/ { print $2 }')
6870
rc=$((rc + nerrors))
6971

72+
echo "nerrors: $nerrors"
73+
7074
index_html=$(cd $cov_build && find . -name index.html | cut -c 3-)
7175
cov_file="$cov_build/${index_html}"
7276

0 commit comments

Comments
 (0)