From e21f721a9013cbfd734a57b731d09d698f843042 Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Mon, 10 Jun 2024 10:32:32 -0400 Subject: [PATCH] Split system_tests into multiple suites such that each of them can finish CICD testing in time --- tests/eosio.system_tests.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/eosio.system_tests.cpp b/tests/eosio.system_tests.cpp index a3cad50..72c7339 100644 --- a/tests/eosio.system_tests.cpp +++ b/tests/eosio.system_tests.cpp @@ -24,11 +24,13 @@ FC_REFLECT( connector, (balance)(weight) ); using namespace eosio_system; -BOOST_AUTO_TEST_SUITE(eosio_system_tests) - bool within_error(int64_t a, int64_t b, int64_t err) { return std::abs(a - b) <= err; }; bool within_one(int64_t a, int64_t b) { return within_error(a, b, 1); } +// Split the tests into multiple suites so that they can be finished within CICD time limit. +// Each suite takes approximately same amount of time. +BOOST_AUTO_TEST_SUITE(eosio_system_part1_tests) + BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( core_sym::from_string("0.0000"), get_balance( "alice1111111" ) ); @@ -1640,6 +1642,9 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::t } } FC_LOG_AND_RETHROW() +BOOST_AUTO_TEST_SUITE_END() +BOOST_AUTO_TEST_SUITE(eosio_system_part2_tests) + BOOST_FIXTURE_TEST_CASE(change_inflation, eosio_system_tester) try { { @@ -1773,6 +1778,9 @@ BOOST_AUTO_TEST_CASE(extreme_inflation) try { BOOST_REQUIRE_EQUAL(t.wasm_assert_msg("quantity exceeds available supply"), t.push_action("defproducera"_n, "claimrewards"_n, mvo()("owner", "defproducera"))); } FC_LOG_AND_RETHROW() +BOOST_AUTO_TEST_SUITE_END() +BOOST_AUTO_TEST_SUITE(eosio_system_part3_tests) + BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::unit_test::tolerance(1e-10)) try { const int64_t secs_per_year = 52 * 7 * 24 * 3600; @@ -3035,6 +3043,8 @@ BOOST_FIXTURE_TEST_CASE( voters_actions_affect_proxy_and_producers, eosio_system } FC_LOG_AND_RETHROW() +BOOST_AUTO_TEST_SUITE_END() +BOOST_AUTO_TEST_SUITE(eosio_system_part4_tests) BOOST_FIXTURE_TEST_CASE( vote_both_proxy_and_producers, eosio_system_tester ) try { //alice1111111 becomes a proxy @@ -3718,6 +3728,9 @@ BOOST_FIXTURE_TEST_CASE( wasmcfg, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( active_params.max_table_elements, 8192 ); } FC_LOG_AND_RETHROW() +BOOST_AUTO_TEST_SUITE_END() +BOOST_AUTO_TEST_SUITE(eosio_system_part5_tests) + BOOST_FIXTURE_TEST_CASE( setram_effect, eosio_system_tester ) try { const asset net = core_sym::from_string("8.0000");