Test code analysis and benchmark fixes

This commit is contained in:
Deda 2024-02-25 22:06:11 +01:00
parent 48ddf00428
commit 6ce0e4402c
3 changed files with 13 additions and 20 deletions

View File

@ -4,14 +4,13 @@ concurrency:
cancel-in-progress: true
on:
# UNCOMMENT THIS BEFORE MERGE
# pull_request:
# paths-ignore:
# - "docs/**"
# - "**/*.md"
# - ".clang-format"
# - "CODEOWNERS"
# - "licenses/*"
pull_request:
paths-ignore:
- "docs/**"
- "**/*.md"
- ".clang-format"
- "CODEOWNERS"
- "licenses/*"
jobs:
community_build:

View File

@ -363,7 +363,7 @@ test_memgraph() {
upload-to-bench-graph)
shift 1
local setup_ve3_env="virtualenv -p python3 ve3 && source ve3/bin/activate && pip install -r requirements.txt"
docker exec -u mg $build_container bash -c "$EXPORT_LICENSE && $EXPORT_ORG_NAME && cd $MGBUILD_ROOT_DIR/tools/bench-graph-client && $setup_ve3_env && ./main.py $@"
docker exec -u mg $build_container bash -c "$EXPORT_LICENSE && $EXPORT_ORG_NAME && cd $MGBUILD_ROOT_DIR/tools/bench-graph-client && $setup_ve3_env "'&& ./main.py $@'
;;
code-analysis)
shift 1
@ -377,7 +377,7 @@ test_memgraph() {
;;
clang-tidy)
shift 1
docker exec -u mg $build_container bash -c "$EXPORT_LICENSE && $EXPORT_ORG_NAME && export THREADS=$threads && $ACTIVATE_TOOLCHAIN && cd $MGBUILD_ROOT_DIR/tests/code_analysis && ./clang_tidy.sh $@"
docker exec -u mg $build_container bash -c "$EXPORT_LICENSE && $EXPORT_ORG_NAME && export THREADS=$threads && $ACTIVATE_TOOLCHAIN && cd $MGBUILD_ROOT_DIR/tests/code_analysis "'&& ./clang_tidy.sh $@'
;;
*)
echo "Error: Unknown test '$1'"

View File

@ -4,26 +4,20 @@ PROJECT_ROOT="$SCRIPT_DIR/../.."
BASE_BRANCH="origin/master"
THREADS=${THREADS:-$(nproc)}
if [[ "$#" -ne 1 ]]; then
echo "Error: This script requires exactly 1 argument '--base-branch string', not $#"
exit 1
fi
while [[ "$#" -gt 0 ]]; do
if [[ "$#" -gt 0 ]]; then
case "$1" in
--base-branch)
BASE_BRANCH=$2
shift 2
;;
*)
echo "Error: Unknown flag '$1'"
shift 2
exit 1
;;
esac
done
fi
cd $PROJECT_ROOT
git diff -U0 $BASE_BRANCH ... -- src | ./tools/github/clang-tidy/clang-tidy-diff.py -p 1 -j $THREADS -path build -regex ".+\.cpp" | tee ./build/clang_tidy_output.txt
git diff -U0 $BASE_BRANCH... -- src | ./tools/github/clang-tidy/clang-tidy-diff.py -p 1 -j $THREADS -path build -regex ".+\.cpp" | tee ./build/clang_tidy_output.txt
# Fail if any warning is reported
! cat ./build/clang_tidy_output.txt | ./tools/github/clang-tidy/grep_error_lines.sh > /dev/null
cd $SCRIPT_DIR