diff --git a/.travis.yml b/.travis.yml index 8d657f926b..58e58a277d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,12 @@ env: jobs: include: - stage: build for cache - script: ./programs/build_helpers/build_protocol - - stage: build, test and scan partly with sonar + script: ./programs/build_helpers/build_for_cache + - stage: build and test script: ./programs/build_helpers/build_and_test - - stage: scan fully with sonar - script: ./programs/build_helpers/scan_with_sonar + - stage: scan with sonar, step 1 + script: ./programs/build_helpers/scan_with_sonar_step_1 + - stage: scan with sonar, step 2 + script: ./programs/build_helpers/scan_with_sonar_step_2 + - stage: scan with sonar, step 3 + script: ./programs/build_helpers/scan_with_sonar_step_3 diff --git a/libraries/egenesis/seed-nodes.txt b/libraries/egenesis/seed-nodes.txt index f3489a60c1..a64ddd193a 100644 --- a/libraries/egenesis/seed-nodes.txt +++ b/libraries/egenesis/seed-nodes.txt @@ -1,9 +1,11 @@ // https://bitsharestalk.org/index.php/topic,23715.0.html -"seed01.liondani.com:1776", // liondani (GERMANY) -"45.35.12.22:1776", // sahkan (USA) -"bts.lafona.net:1776", // lafona (France) -"bts-seed1.abit-more.com:62015", // abit (China) -"node.blckchnd.com:4243", // blckchnd (Germany) -"seed.roelandp.nl:1776", // roelandp (Canada) -"seed.bts.bangzi.info:55501", // Bangzi (Germany) +"seed01.liondani.com:1776", // liondani (Germany) +"bts.lafona.net:1776", // lafona (France) +"bts-seed1.abit-more.com:62015", // abit (China) +"seed.blckchnd.com:4243", // blckchnd (Germany) +"seed.roelandp.nl:1776", // roelandp (Canada) +"seed.bts.bangzi.info:55501", // Bangzi (Germany) +"seed1.xbts.io:1776", // xbts.io (Germany) +"seed2.xbts.io:1776", // xbts.io (Germany) +"seed.bitshares.org:666", // bitshares.org (France) "seeds.btsnodes.com:1776", // Community diff --git a/programs/build_helpers/build_and_test b/programs/build_helpers/build_and_test index 0b712e859f..497186f0cf 100755 --- a/programs/build_helpers/build_and_test +++ b/programs/build_helpers/build_and_test @@ -5,17 +5,11 @@ programs/build_helpers/buildstep -s 3500 ccache -s programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt" 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 ." -programs/build_helpers/buildstep make.everything 2400 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node chain_test cli_test" +programs/build_helpers/buildstep make.some.targets 2400 "make -j 2 witness_node cli_wallet chain_test cli_test js_operation_serializer get_dev_key network_mapper" +programs/build_helpers/buildstep make.others 600 "make" set -o pipefail -programs/build_helpers/buildstep run.chain_test 240 "libraries/fc/tests/run-parallel-tests.sh tests/chain_test" -programs/build_helpers/buildstep run.cli_test 60 "libraries/fc/tests/run-parallel-tests.sh tests/cli_test" -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" -du -hs sonar_cache -# The first pass, skip some files. This will remove the skipped files from the cache, but is an acceptable trade-off -programs/build_helpers/buildstep prepare.sonar.part 1 "cp sonar-project.properties sonar-project.properties.bak; sed -i '/sonar\.exclusions=/d;s/#sonar\.exclusions.part/sonar.exclusions/' sonar-project.properties" -programs/build_helpers/buildstep run.sonar.part 1500 "which sonar-scanner && sonar-scanner" -programs/build_helpers/buildstep prepare.sonar.full 1 "cp sonar-project.properties.bak sonar-project.properties" -du -hs sonar_cache +programs/build_helpers/buildstep run.chain_test 600 "libraries/fc/tests/run-parallel-tests.sh tests/chain_test" +programs/build_helpers/buildstep run.cli_test 180 "libraries/fc/tests/run-parallel-tests.sh tests/cli_test" programs/build_helpers/buildstep end 0 ccache -s diff --git a/programs/build_helpers/build_protocol b/programs/build_helpers/build_for_cache similarity index 91% rename from programs/build_helpers/build_protocol rename to programs/build_helpers/build_for_cache index 2a0fc32771..3586c746b6 100755 --- a/programs/build_helpers/build_protocol +++ b/programs/build_helpers/build_for_cache @@ -11,6 +11,5 @@ programs/build_helpers/buildstep make.protocol 250 "make -j 2 graphene_protocol" programs/build_helpers/buildstep make.chain 450 "make -j 2 graphene_chain" programs/build_helpers/buildstep make.node 600 "make -j 2 witness_node" programs/build_helpers/buildstep make.cli 500 "make -j 2 cli_wallet" -programs/build_helpers/buildstep make.chain_test 750 "make -j 2 chain_test" programs/build_helpers/buildstep end 0 ccache -s diff --git a/programs/build_helpers/scan_with_sonar b/programs/build_helpers/scan_with_sonar_step_1 similarity index 62% rename from programs/build_helpers/scan_with_sonar rename to programs/build_helpers/scan_with_sonar_step_1 index ba133aafcd..7601184665 100755 --- a/programs/build_helpers/scan_with_sonar +++ b/programs/build_helpers/scan_with_sonar_step_1 @@ -5,18 +5,15 @@ programs/build_helpers/buildstep -s 3500 ccache -s programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt" 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 ." -programs/build_helpers/buildstep make.everything 2400 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node chain_test cli_test" +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" set -o pipefail 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" du -hs sonar_cache # The first pass, skip some files. This will remove the skipped files from the cache, but is an acceptable trade-off -programs/build_helpers/buildstep prepare.sonar.part 1 "cp sonar-project.properties sonar-project.properties.bak; sed -i '/sonar\.exclusions=/d;s/#sonar\.exclusions.part/sonar.exclusions/' sonar-project.properties" -programs/build_helpers/buildstep run.sonar.part 1500 "which sonar-scanner && sonar-scanner" +programs/build_helpers/buildstep prepare.sonar.part1 1 "cp sonar-project.properties sonar-project.properties.bak; sed -i '/sonar\.exclusions=/d;s/#sonar\.exclusions.part1/sonar.exclusions/' sonar-project.properties" +programs/build_helpers/buildstep run.sonar.part1 1500 "which sonar-scanner && sonar-scanner" programs/build_helpers/buildstep prepare.sonar.full 1 "cp sonar-project.properties.bak sonar-project.properties" du -hs sonar_cache -# The second pass, scan all files -programs/build_helpers/buildstep run.sonar.full 2000 "which sonar-scanner && sonar-scanner" -du -hs sonar_cache programs/build_helpers/buildstep end 0 ccache -s diff --git a/programs/build_helpers/scan_with_sonar_step_2 b/programs/build_helpers/scan_with_sonar_step_2 new file mode 100755 index 0000000000..ae3af7bcb0 --- /dev/null +++ b/programs/build_helpers/scan_with_sonar_step_2 @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +programs/build_helpers/buildstep -s 3500 +ccache -s +programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt" +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 ." +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" +set -o pipefail +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" +du -hs sonar_cache +# The first pass, skip some files. This will remove the skipped files from the cache, but is an acceptable trade-off +programs/build_helpers/buildstep prepare.sonar.part1 1 "cp sonar-project.properties sonar-project.properties.bak; sed -i '/sonar\.exclusions=/d;s/#sonar\.exclusions.part1/sonar.exclusions/' sonar-project.properties" +programs/build_helpers/buildstep run.sonar.part1 1500 "which sonar-scanner && sonar-scanner" +programs/build_helpers/buildstep prepare.sonar.full 1 "cp sonar-project.properties.bak sonar-project.properties" +du -hs sonar_cache +# The second pass, skip fewer files +programs/build_helpers/buildstep prepare.sonar.part2 1 "cp sonar-project.properties sonar-project.properties.bak; sed -i '/sonar\.exclusions=/d;s/#sonar\.exclusions.part2/sonar.exclusions/' sonar-project.properties" +programs/build_helpers/buildstep run.sonar.part2 1500 "which sonar-scanner && sonar-scanner" +programs/build_helpers/buildstep prepare.sonar.full2 1 "cp sonar-project.properties.bak sonar-project.properties" +du -hs sonar_cache +programs/build_helpers/buildstep end 0 +ccache -s + diff --git a/programs/build_helpers/scan_with_sonar_step_3 b/programs/build_helpers/scan_with_sonar_step_3 new file mode 100755 index 0000000000..2c18dabc9e --- /dev/null +++ b/programs/build_helpers/scan_with_sonar_step_3 @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +programs/build_helpers/buildstep -s 3500 +ccache -s +programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt" +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 ." +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" +set -o pipefail +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" +du -hs sonar_cache +# The first pass is skipped here +# The second pass, skip fewer files than the first pass. This will remove the skipped files from the cache, but is an acceptable trade-off +programs/build_helpers/buildstep prepare.sonar.part2 1 "cp sonar-project.properties sonar-project.properties.bak; sed -i '/sonar\.exclusions=/d;s/#sonar\.exclusions.part2/sonar.exclusions/' sonar-project.properties" +programs/build_helpers/buildstep run.sonar.part2 1500 "which sonar-scanner && sonar-scanner" +programs/build_helpers/buildstep prepare.sonar.full 1 "cp sonar-project.properties.bak sonar-project.properties" +du -hs sonar_cache +# The second pass, scan all files +programs/build_helpers/buildstep run.sonar.full 1500 "which sonar-scanner && sonar-scanner" +du -hs sonar_cache +programs/build_helpers/buildstep end 0 +ccache -s + diff --git a/sonar-project.properties b/sonar-project.properties index 9b7b162cf0..519cdab429 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -8,7 +8,8 @@ sonar.links.scm=https://github.com/bitshares/bitshares-core/tree/master sonar.tests=tests # Used by the `build_and_test` script for the first pass when building with Travis CI, to skip some files -#sonar.exclusions.part=programs/build_helper/**/*,libraries/fc/**/*,libraries/egenesis/egenesis_full.cpp,libraries/chain/**/*,libraries/protocol/**/* +#sonar.exclusions.part1=programs/build_helper/**/*,libraries/fc/**/*,libraries/egenesis/egenesis_full.cpp,libraries/chain/**/*,libraries/protocol/**/* +#sonar.exclusions.part2=programs/build_helper/**/*,libraries/fc/**/*,libraries/egenesis/egenesis_full.cpp,libraries/chain/**/* sonar.exclusions=programs/build_helper/**/*,libraries/fc/**/*,libraries/egenesis/egenesis_full.cpp sonar.sources=libraries,programs sonar.cfamily.build-wrapper-output=bw-output