Skip to content

Commit

Permalink
Merge branch 'default_tester' into GH-170-savanna-protocol-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner authored May 31, 2024
2 parents cd79e82 + faa9075 commit 1df48ca
Show file tree
Hide file tree
Showing 11 changed files with 317 additions and 3,065 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:
chown -R $(id -u):$(id -g) $PWD
zstdcat build.tar.zst | tar x
cd build
ctest --output-on-failure -j $(nproc) -LE "(nonparallelizable_tests|long_running_tests)" --timeout 420
ctest --output-on-failure -j $(nproc) -LE "(nonparallelizable_tests|long_running_tests)" --timeout 480
- name: Upload core files from failed tests
uses: actions/upload-artifact@v4
if: failure()
Expand Down
8 changes: 4 additions & 4 deletions tests/get_producers_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ BOOST_AUTO_TEST_SUITE(get_producers_tests)
using namespace eosio::testing;

// this test verifies the exception case of get_producer, where it is populated by the active schedule of producers
BOOST_AUTO_TEST_CASE( get_producers) { try {
tester chain;
BOOST_AUTO_TEST_CASE_TEMPLATE( get_producers, T, testers ) { try {
T chain;

eosio::chain_apis::read_only plugin(*(chain.control), {}, fc::microseconds::maximum(), fc::microseconds::maximum(), {});
eosio::chain_apis::read_only::get_producers_params params = { .json = true, .lower_bound = "", .limit = 21 };
Expand Down Expand Up @@ -46,8 +46,8 @@ BOOST_AUTO_TEST_CASE( get_producers) { try {
} FC_LOG_AND_RETHROW() }

// this test verifies the normal case of get_producer, where the contents of the system contract's producers table is used
BOOST_AUTO_TEST_CASE( get_producers_from_table) { try {
eosio_system::eosio_system_tester chain;
BOOST_AUTO_TEST_CASE_TEMPLATE( get_producers_from_table, T, eosio_system::eosio_system_testers ) { try {
T chain;

// ensure that enough voting is occurring so that producer1111 is elected as the producer
chain.cross_15_percent_threshold();
Expand Down
7 changes: 4 additions & 3 deletions tests/test_snapshot_information.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ void test_snapshot_information() {
chain.set_abi("snapshot"_n, test_contracts::snapshot_test_abi());
chain.produce_blocks(1);

constexpr uint32_t savanna_base_block_num = 9;
auto block = chain.produce_block();
if constexpr (std::is_same_v<TESTER, savanna_tester>) {
BOOST_REQUIRE_EQUAL(block->block_num(), 15u); // ensure that test setup stays consistent with original snapshot setup
BOOST_REQUIRE_EQUAL(block->block_num(), 6u + savanna_base_block_num); // ensure that test setup stays consistent with original snapshot setup
} else {
BOOST_REQUIRE_EQUAL(block->block_num(), 6u); // ensure that test setup stays consistent with original snapshot setup
}
Expand All @@ -42,7 +43,7 @@ void test_snapshot_information() {

auto block2 = chain.produce_block();
if constexpr (std::is_same_v<TESTER, savanna_tester>) {
BOOST_REQUIRE_EQUAL(block2->block_num(), 16u); // ensure that test setup stays consistent with original snapshot setup
BOOST_REQUIRE_EQUAL(block2->block_num(), 7u + savanna_base_block_num); // ensure that test setup stays consistent with original snapshot setup
} else {
BOOST_REQUIRE_EQUAL(block2->block_num(), 7u); // ensure that test setup stays consistent with original snapshot setup
}
Expand Down Expand Up @@ -71,7 +72,7 @@ void test_snapshot_information() {
pending_snapshot pending{ block2->previous, next, pending_path.generic_string(), final_path.generic_string() };
test_snap_info = pending.finalize(*chain.control);
if constexpr (std::is_same_v<TESTER, savanna_tester>) {
BOOST_REQUIRE_EQUAL(test_snap_info.head_block_num, 15u);
BOOST_REQUIRE_EQUAL(test_snap_info.head_block_num, 6u + savanna_base_block_num);
} else {
BOOST_REQUIRE_EQUAL(test_snap_info.head_block_num, 6u);
}
Expand Down
14 changes: 8 additions & 6 deletions unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ foreach(RUNTIME ${EOSIO_WASM_RUNTIMES})
set_tests_properties(api_part2_unit_test_${RUNTIME} PROPERTIES COST 5000)
set_tests_properties(api_part3_unit_test_${RUNTIME} PROPERTIES COST 5000)
set_tests_properties(api_part4_unit_test_${RUNTIME} PROPERTIES COST 5000)
set_tests_properties(wasm_part1_unit_test_${RUNTIME} PROPERTIES COST 4000)
set_tests_properties(wasm_part2_unit_test_${RUNTIME} PROPERTIES COST 4000)
set_tests_properties(wasm_part3_unit_test_${RUNTIME} PROPERTIES COST 4000)
set_tests_properties(wasm_config_part1_unit_test_${RUNTIME} PROPERTIES COST 4000)
set_tests_properties(wasm_config_part2_unit_test_${RUNTIME} PROPERTIES COST 4000)
set_tests_properties(wasm_config_part3_unit_test_${RUNTIME} PROPERTIES COST 4000)
set_tests_properties(wasm_part1_unit_test_${RUNTIME} PROPERTIES COST 5000)
set_tests_properties(wasm_part2_unit_test_${RUNTIME} PROPERTIES COST 5000)
set_tests_properties(wasm_part3_unit_test_${RUNTIME} PROPERTIES COST 5000)
set_tests_properties(wasm_config_part1_unit_test_${RUNTIME} PROPERTIES COST 5000)
set_tests_properties(wasm_config_part2_unit_test_${RUNTIME} PROPERTIES COST 5000)
set_tests_properties(wasm_config_part3_unit_test_${RUNTIME} PROPERTIES COST 5000)
set_tests_properties(snapshot_unit_test_${RUNTIME} PROPERTIES COST 4000)
set_tests_properties(finality_unit_test_${RUNTIME} PROPERTIES COST 4000)
set_tests_properties(delay_unit_test_${RUNTIME} PROPERTIES COST 3000)
endforeach()

Expand Down
Loading

0 comments on commit 1df48ca

Please sign in to comment.