diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 261a5e38db..c19919af69 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -70,10 +70,10 @@ jobs: df -h - name: Unit-Tests run: | - _build/tests/app_test - _build/tests/es_test - libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test - libraries/fc/tests/run-parallel-tests.sh _build/tests/cli_test + _build/tests/app_test -l message + _build/tests/es_test -l message + libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test -l message + libraries/fc/tests/run-parallel-tests.sh _build/tests/cli_test -l message df -h - name: Node-Test run: | @@ -146,12 +146,12 @@ jobs: df -h - name: Unit-Tests run: | - _build/tests/app_test + _build/tests/app_test -l message df -h - _build/tests/es_test + _build/tests/es_test -l message df -h - libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test - libraries/fc/tests/run-parallel-tests.sh _build/tests/cli_test + libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test -l message + libraries/fc/tests/run-parallel-tests.sh _build/tests/cli_test -l message df -h - name: Node-Test run: | @@ -336,9 +336,9 @@ jobs: df -h - name: Unit-Tests run: | - _build/tests/app_test - libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test - libraries/fc/tests/run-parallel-tests.sh _build/tests/cli_test + _build/tests/app_test -l message + libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test -l message + libraries/fc/tests/run-parallel-tests.sh _build/tests/cli_test -l message df -h - name: Node-Test run: | diff --git a/programs/build_helpers/build_and_test b/programs/build_helpers/build_and_test index 0b712e859f..27e7d85f52 100755 --- a/programs/build_helpers/build_and_test +++ b/programs/build_helpers/build_and_test @@ -5,10 +5,10 @@ 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.everything 2400 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node cli_wallet chain_test cli_test" 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 run.chain_test 240 "libraries/fc/tests/run-parallel-tests.sh tests/chain_test -l message" +programs/build_helpers/buildstep run.cli_test 60 "libraries/fc/tests/run-parallel-tests.sh tests/cli_test -l message" 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 diff --git a/programs/build_helpers/scan_with_sonar b/programs/build_helpers/scan_with_sonar index ba133aafcd..7afe80434e 100755 --- a/programs/build_helpers/scan_with_sonar +++ b/programs/build_helpers/scan_with_sonar @@ -5,11 +5,14 @@ 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 2400 "programs/build_helpers/make_with_sonar bw-output -j 2 witness_node cli_wallet" 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 +# Note: since the first pass was done already in `build_and_test`, ideally we don't need to do it again here. +# However, if we skip this step, the second pass below will come with a very low cache hit, don't know why. +# Anyway, a 100% cache hit is expected for this step, so it's fast and it doesn't matter to do it again. 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" diff --git a/tests/app/main.cpp b/tests/app/main.cpp index 2cb58156ec..a0d1b9b168 100644 --- a/tests/app/main.cpp +++ b/tests/app/main.cpp @@ -246,11 +246,11 @@ BOOST_AUTO_TEST_CASE( two_node_network ) BOOST_TEST_MESSAGE( "Starting app1 and waiting 500 ms" ); app1.startup(); #ifdef NDEBUG - #define LISTEN_WAIT_TIME (fc::milliseconds(30000)) + #define NODE_STARTUP_WAIT_TIME (fc::milliseconds(30000)) #else - #define LISTEN_WAIT_TIME (fc::milliseconds(120000)) + #define NODE_STARTUP_WAIT_TIME (fc::milliseconds(120000)) #endif - fc::wait_for( LISTEN_WAIT_TIME, [&app1] () { + fc::wait_for( NODE_STARTUP_WAIT_TIME, [&app1] () { const auto status = app1.p2p_node()->network_get_info(); return status["listening_on"].as( 5 ).port() == 3939; }); @@ -273,12 +273,7 @@ BOOST_AUTO_TEST_CASE( two_node_network ) BOOST_TEST_MESSAGE( "Starting app2 and waiting for connection" ); app2.startup(); - #ifdef NDEBUG - #define CONNECT_WAIT_TIME (fc::milliseconds(10000)) - #else - #define CONNECT_WAIT_TIME (fc::milliseconds(30000)) - #endif - fc::wait_for( CONNECT_WAIT_TIME, [&app1] () { return app1.p2p_node()->get_connection_count() > 0; } ); + fc::wait_for( NODE_STARTUP_WAIT_TIME, [&app1] () { return app1.p2p_node()->get_connection_count() > 0; } ); BOOST_REQUIRE_EQUAL(app1.p2p_node()->get_connection_count(), 1u); BOOST_CHECK_EQUAL(std::string(app1.p2p_node()->get_connected_peers().front().host.get_address()), "127.0.0.1");