Skip to content

Commit a2d9c19

Browse files
authored
Merge pull request #2227 from bitshares/release
Merge release branch into master branch
2 parents da3e2c9 + 4bc70a4 commit a2d9c19

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

programs/build_helpers/scan_with_sonar_step_1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ programs/build_helpers/buildstep -s 3500
55
ccache -s
66
programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt"
77
programs/build_helpers/buildstep cmake 5 "cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage -DBoost_USE_STATIC_LIBS=OFF -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON ."
8-
programs/build_helpers/buildstep make.programs 1800 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node cli_wallet js_operation_serializer get_dev_key network_mapper"
8+
programs/build_helpers/buildstep make.programs 1800 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node cli_wallet js_operation_serializer get_dev_key network_mapper app_test chain_test cli_test"
99
set -o pipefail
1010
programs/build_helpers/buildstep prepare.sonar 20 "find libraries/[acdenptuw]*/CMakeFiles/*.dir programs/[cdgjsw]*/CMakeFiles/*.dir -type d -print | while read d; do gcov -o \"\$d\" \"\${d/CMakeFiles*.dir//}\"/*.cpp; done >/dev/null; programs/build_helpers/set_sonar_branch sonar-project.properties"
1111
du -hs sonar_cache

programs/build_helpers/scan_with_sonar_step_2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ programs/build_helpers/buildstep -s 3500
55
ccache -s
66
programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt"
77
programs/build_helpers/buildstep cmake 5 "cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage -DBoost_USE_STATIC_LIBS=OFF -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON ."
8-
programs/build_helpers/buildstep make.programs 1800 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node cli_wallet js_operation_serializer get_dev_key network_mapper"
8+
programs/build_helpers/buildstep make.programs 1800 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node cli_wallet js_operation_serializer get_dev_key network_mapper app_test chain_test cli_test"
99
set -o pipefail
1010
programs/build_helpers/buildstep prepare.sonar 20 "find libraries/[acdenptuw]*/CMakeFiles/*.dir programs/[cdgjsw]*/CMakeFiles/*.dir -type d -print | while read d; do gcov -o \"\$d\" \"\${d/CMakeFiles*.dir//}\"/*.cpp; done >/dev/null; programs/build_helpers/set_sonar_branch sonar-project.properties"
1111
du -hs sonar_cache

programs/build_helpers/scan_with_sonar_step_3

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ programs/build_helpers/buildstep -s 3500
55
ccache -s
66
programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt"
77
programs/build_helpers/buildstep cmake 5 "cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage -DBoost_USE_STATIC_LIBS=OFF -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON ."
8-
programs/build_helpers/buildstep make.programs 1800 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node cli_wallet js_operation_serializer get_dev_key network_mapper"
8+
programs/build_helpers/buildstep make.programs 1800 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node cli_wallet js_operation_serializer get_dev_key network_mapper app_test chain_test cli_test"
99
set -o pipefail
10+
programs/build_helpers/buildstep run.chain_test 600 "libraries/fc/tests/run-parallel-tests.sh tests/chain_test"
11+
programs/build_helpers/buildstep run.cli_test 180 "libraries/fc/tests/run-parallel-tests.sh tests/cli_test"
12+
programs/build_helpers/buildstep run.app_test 180 "tests/app_test"
1013
programs/build_helpers/buildstep prepare.sonar 20 "find libraries/[acdenptuw]*/CMakeFiles/*.dir programs/[cdgjsw]*/CMakeFiles/*.dir -type d -print | while read d; do gcov -o \"\$d\" \"\${d/CMakeFiles*.dir//}\"/*.cpp; done >/dev/null; programs/build_helpers/set_sonar_branch sonar-project.properties"
1114
du -hs sonar_cache
1215
# The first pass is skipped here
@@ -15,7 +18,7 @@ programs/build_helpers/buildstep prepare.sonar.part2 1 "cp sonar-project.propert
1518
programs/build_helpers/buildstep run.sonar.part2 1500 "which sonar-scanner && sonar-scanner"
1619
programs/build_helpers/buildstep prepare.sonar.full 1 "cp sonar-project.properties.bak sonar-project.properties"
1720
du -hs sonar_cache
18-
# The second pass, scan all files
21+
# The third pass, scan all files
1922
programs/build_helpers/buildstep run.sonar.full 1500 "which sonar-scanner && sonar-scanner"
2023
du -hs sonar_cache
2124
programs/build_helpers/buildstep end 0

programs/build_helpers/set_sonar_branch

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,18 @@ ORIGINAL_TARGET="$( grep 'sonar\.branch\.target' "$1" | sed 's=^.*[:=] *==' )"
2626

2727
BRANCH=
2828
TARGET="$ORIGINAL_TARGET"
29-
FETCH=
3029

31-
if [ -n "$TRAVIS_PULL_REQUEST" -a "$TRAVIS_PULL_REQUEST" != false ]; then
30+
if [ -n "$TRAVIS_PULL_REQUEST" -a "$TRAVIS_PULL_REQUEST" != "false" ]; then
3231
# PRs work per default, remove sonar.branch.* since they only work with sonar.pullrequest.*
3332
echo "Detected PR '$TRAVIS_PULL_REQUEST'"
3433
TARGET=
35-
FETCH="$TRAVIS_BRANCH"
3634
elif [ -n "$TRAVIS_TAG" ]; then
3735
# Tag build is either master or testnet
3836
echo "Detected tag '$TRAVIS_TAG'"
3937
BRANCH="$TRAVIS_BRANCH"
4038
case "$TRAVIS_TAG" in
41-
*test*) TARGET=testnet; FETCH=testnet; ;;
42-
*) TARGET=master; FETCH=master; ;;
39+
*test*) TARGET=testnet; ;;
40+
*) TARGET=master; ;;
4341
esac
4442
else
4543
BRANCH="$TRAVIS_BRANCH"
@@ -48,29 +46,31 @@ else
4846
# Long-lived branches stand for themselves, no target
4947
echo "Detected long-lived branch '$TRAVIS_BRANCH'"
5048
TARGET=
51-
FETCH="$TRAVIS_BRANCH"
5249
;;
5350
*test*release*)
5451
# Testnet release branch will be merged into testnet
5552
echo "Detected testnet release branch '$TRAVIS_BRANCH'"
5653
TARGET=testnet
57-
FETCH=testnet
5854
;;
5955
*release*)
6056
# Release branch will be merged into default (master)
6157
echo "Detected release branch '$TRAVIS_BRANCH'"
6258
TARGET=master
63-
FETCH=master
6459
;;
6560
*)
6661
# All other branches should have sonar.branch.target in their
6762
# sonar.properties, leave it unchanged
6863
echo "Detected normal branch '$TRAVIS_BRANCH'"
69-
FETCH="$TARGET"
7064
esac
7165
fi
7266

73-
echo "Branch '$BRANCH', target '$TARGET', fetch target '$FETCH'"
67+
echo "Branch '$BRANCH', target '$TARGET'"
68+
69+
git fetch --no-tags --unshallow
70+
git fetch --no-tags origin +refs/heads/$TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH
71+
if [ -n "$TARGET" ]; then
72+
git fetch --no-tags origin +refs/heads/$TARGET:refs/remotes/origin/$TARGET
73+
fi
7474

7575
if [ "x$TARGET" != "x$ORIGINAL_TARGET" ]; then
7676
clear_branch "$1"
@@ -81,11 +81,5 @@ fi
8181
if [ -n "$BRANCH" ]; then
8282
echo "sonar.branch.name=$BRANCH" >>"$1"
8383
fi
84-
#if [ -n "$FETCH" ]; then
85-
# Unfortunately this leads to sonar failing. Apparently it needs a full
86-
# clone, not a shallow one. Since our repo is somewhat large and this is
87-
# only required for blame annotations, disabled for now.
88-
#git fetch --depth=50 origin "$FETCH:$FETCH"
89-
#fi
9084

9185
exit 0

0 commit comments

Comments
 (0)