From 8ed7edd8e058f9f3fcb5972286fd178ab9f43673 Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 28 May 2024 16:19:41 -0400 Subject: [PATCH 1/7] Remove tester but keep validating_tester for eosio_system_tester; add setup_policy to eosio_system_tester constructor for more flexibility --- tests/eosio.limitauth_tests.cpp | 2 +- tests/eosio.system_tester.hpp | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/tests/eosio.limitauth_tests.cpp b/tests/eosio.limitauth_tests.cpp index c873d9ce..95568428 100644 --- a/tests/eosio.limitauth_tests.cpp +++ b/tests/eosio.limitauth_tests.cpp @@ -26,7 +26,7 @@ inline const auto bob = "bob111111111"_n; struct limitauth_tester: eosio_system_tester { action_result push_action(name code, name action, permission_level auth, const variant_object& data) { try { - TESTER::push_action(code, action, {auth}, data); + validating_tester::push_action(code, action, {auth}, data); return ""; } catch (const fc::exception& ex) { edump((ex.to_detail_string())); diff --git a/tests/eosio.system_tester.hpp b/tests/eosio.system_tester.hpp index 89d144fe..df763363 100644 --- a/tests/eosio.system_tester.hpp +++ b/tests/eosio.system_tester.hpp @@ -15,17 +15,9 @@ using namespace fc; using mvo = fc::mutable_variant_object; -#ifndef TESTER -#ifdef NON_VALIDATING_TEST -#define TESTER tester -#else -#define TESTER validating_tester -#endif -#endif - namespace eosio_system { -class eosio_system_tester : public TESTER { +class eosio_system_tester : public validating_tester { public: void basic_setup() { @@ -91,7 +83,8 @@ class eosio_system_tester : public TESTER { full }; - eosio_system_tester( setup_level l = setup_level::full ) { + eosio_system_tester( setup_level l = setup_level::full, setup_policy policy = setup_policy::full ) + : validating_tester({}, nullptr, policy) { if( l == setup_level::none ) return; basic_setup(); @@ -1315,7 +1308,7 @@ class eosio_system_tester : public TESTER { } produce_blocks( 250); - auto trace_auth = TESTER::push_action(config::system_account_name, updateauth::get_name(), config::system_account_name, mvo() + auto trace_auth = validating_tester::push_action(config::system_account_name, updateauth::get_name(), config::system_account_name, mvo() ("account", name(config::system_account_name).to_string()) ("permission", name(config::active_name).to_string()) ("parent", name(config::owner_name).to_string()) From d4227b8bb483fb028cf10e738ce6ec3b3793bf9a Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 28 May 2024 16:20:28 -0400 Subject: [PATCH 2/7] Start bios_inst_fin_tests with legacy tester --- tests/eosio.bios_inst_fin_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/eosio.bios_inst_fin_tests.cpp b/tests/eosio.bios_inst_fin_tests.cpp index cd1a4622..f76dbee8 100644 --- a/tests/eosio.bios_inst_fin_tests.cpp +++ b/tests/eosio.bios_inst_fin_tests.cpp @@ -16,7 +16,7 @@ using namespace fc; using mvo = fc::mutable_variant_object; // tests for instant finality actions -class eosio_bios_if_tester : public tester { +class eosio_bios_if_tester : public tester_not_transition_to_savanna { public: eosio_bios_if_tester() { From 486447652089f59c1b6c8a30900384fce173152f Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 28 May 2024 16:21:20 -0400 Subject: [PATCH 3/7] Keep powerup_tests under legacy_tester for now --- tests/eosio.powerup_tests.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/eosio.powerup_tests.cpp b/tests/eosio.powerup_tests.cpp index ef5c6396..bcaf7864 100644 --- a/tests/eosio.powerup_tests.cpp +++ b/tests/eosio.powerup_tests.cpp @@ -71,7 +71,12 @@ using namespace eosio_system; struct powerup_tester : eosio_system_tester { - powerup_tester() { create_accounts_with_resources({ "eosio.reserv"_n }); } + // Use full_except_do_not_transition_to_savanna for now until + // https://github.com/AntelopeIO/reference-contracts/issues/91 is resolved + powerup_tester() + : eosio_system_tester(setup_level::full, setup_policy::full_except_do_not_transition_to_savanna) { + create_accounts_with_resources({ "eosio.reserv"_n }); + } void start_rex() { create_account_with_resources("rexholder111"_n, config::system_account_name, core_sym::from_string("1.0000"), From cc812f8fe0e2e0ea14ece688b84fdc2e8cc250c6 Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 28 May 2024 16:22:06 -0400 Subject: [PATCH 4/7] Adjust proposer schedule change for producer_wtmsig tests --- tests/eosio.system_tests.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/eosio.system_tests.cpp b/tests/eosio.system_tests.cpp index 7bce7fa8..a3cad504 100644 --- a/tests/eosio.system_tests.cpp +++ b/tests/eosio.system_tests.cpp @@ -843,7 +843,7 @@ BOOST_FIXTURE_TEST_CASE( producer_wtmsig, eosio_system_tester ) try { produce_block(); produce_block( fc::minutes(2) ); - produce_blocks(2); + produce_blocks(config::producer_repetitions * 2); BOOST_REQUIRE_EQUAL( control->active_producers().version, 1u ); produce_block(); BOOST_REQUIRE_EQUAL( control->pending_block_producer(), "alice1111111"_n ); @@ -901,7 +901,7 @@ BOOST_FIXTURE_TEST_CASE( producer_wtmsig, eosio_system_tester ) try { produce_block(); produce_block( fc::minutes(2) ); - produce_blocks(2); + produce_blocks(config::producer_repetitions * 2); BOOST_REQUIRE_EQUAL( control->active_producers().version, 2u ); produce_block(); BOOST_REQUIRE_EQUAL( control->pending_block_producer(), "alice1111111"_n ); @@ -933,7 +933,7 @@ BOOST_FIXTURE_TEST_CASE( producer_wtmsig_transition, eosio_system_tester ) try { produce_block(); produce_block( fc::minutes(2) ); - produce_blocks(2); + produce_blocks(config::producer_repetitions * 2); BOOST_REQUIRE_EQUAL( control->active_producers().version, 1u ); auto convert_to_block_timestamp = [](const fc::variant& timestamp) -> eosio::chain::block_timestamp_type { @@ -2925,6 +2925,10 @@ BOOST_FIXTURE_TEST_CASE(producer_onblock_check, eosio_system_tester) try { BOOST_REQUIRE_EQUAL(success(), vote( "producvoterb"_n, vector(producer_names.begin(), producer_names.begin()+21))); BOOST_REQUIRE_EQUAL(success(), vote( "producvoterc"_n, vector(producer_names.begin(), producer_names.end()))); + int retries = 50; + while (produce_block()->producer == config::system_account_name && --retries); + BOOST_REQUIRE(retries > 0); + // give a chance for everyone to produce blocks { produce_blocks(21 * 12); From 43c76eaeaa24d540fa1cbc3787c2e87a8e0ef90e Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 28 May 2024 16:23:30 -0400 Subject: [PATCH 5/7] Point spring-dev target to default_tester branch to get around circular reference contracts and Spring dependency --- .cicd/defaults.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cicd/defaults.json b/.cicd/defaults.json index 48fecb15..e5095a93 100644 --- a/.cicd/defaults.json +++ b/.cicd/defaults.json @@ -1,6 +1,6 @@ { "spring-dev":{ - "target":"main", + "target":"default_tester", "prerelease":false }, "cdt":{ From 4ccfbbfee3a2b5a58d79d8b0ff23b253d3876428 Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 4 Jun 2024 10:33:36 -0400 Subject: [PATCH 6/7] Use legacy_tester instead of tester_not_transition_to_savanna --- tests/eosio.bios_inst_fin_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/eosio.bios_inst_fin_tests.cpp b/tests/eosio.bios_inst_fin_tests.cpp index f76dbee8..e3e3f505 100644 --- a/tests/eosio.bios_inst_fin_tests.cpp +++ b/tests/eosio.bios_inst_fin_tests.cpp @@ -16,7 +16,7 @@ using namespace fc; using mvo = fc::mutable_variant_object; // tests for instant finality actions -class eosio_bios_if_tester : public tester_not_transition_to_savanna { +class eosio_bios_if_tester : public legacy_tester { public: eosio_bios_if_tester() { From 9d4d6cd34dab7805ba0d9c3f43cfc94c72128293 Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 4 Jun 2024 10:55:26 -0400 Subject: [PATCH 7/7] Change spring-dev/target back to main --- .cicd/defaults.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cicd/defaults.json b/.cicd/defaults.json index e5095a93..48fecb15 100644 --- a/.cicd/defaults.json +++ b/.cicd/defaults.json @@ -1,6 +1,6 @@ { "spring-dev":{ - "target":"default_tester", + "target":"main", "prerelease":false }, "cdt":{