Skip to content

Commit

Permalink
Split system_tests into multiple suites such that each of them can fi…
Browse files Browse the repository at this point in the history
…nish CICD testing in time
  • Loading branch information
linh2931 committed Jun 10, 2024
1 parent 229dd4f commit e21f721
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/eosio.system_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) );
Expand Down Expand Up @@ -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 {

{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit e21f721

Please sign in to comment.