Skip to content

Commit

Permalink
Merge pull request #2088 from skalenetwork/bug/2031-fix-all-tests
Browse files Browse the repository at this point in the history
Bug/2031 fix all tests
  • Loading branch information
DmytroNazarenko authored Jan 30, 2025
2 parents 008952b + 504d580 commit 0b34352
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
5 changes: 4 additions & 1 deletion test/tools/libtesteth/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ void printHelp() {
cout << setw( 30 ) << "--list-tests" << setw( 25 ) << "List all test suites/cases and exit\n";

cout << "\nAdditional Tests\n";
cout << setw( 30 ) << "--all" << setw( 25 ) << "Enable all tests\n";
cout << setw( 30 ) << "--all" << setw( 25 ) << "Enable all tests other than manual\n";
cout << setw( 30 ) << "--express" << setw( 25 ) << "Only 'express' tests\n";
cout << setw( 30 ) << "--manual" << setw( 25 ) << "Only 'manual' tests\n";

cout << "\nTest Generation\n";
cout << setw( 30 ) << "--filltests" << setw( 25 ) << "Run test fillers\n";
Expand Down Expand Up @@ -223,6 +224,8 @@ Options::Options( int argc, const char** argv ) {
all = true;
else if ( arg == "--express" )
this->express = true;
else if ( arg == "--manual" )
this->manual = true;
else if ( arg == "--singletest" ) {
throwIfNoArgumentFollows();
singleTest = true;
Expand Down
4 changes: 3 additions & 1 deletion test/tools/libtesteth/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ class Options {
int trDataIndex; ///< GeneralState data
int trGasIndex; ///< GeneralState gas
int trValueIndex; ///< GeneralState value
bool all = false; ///< Running every test, including time consuming ones.
bool manual = false; ///< Running tests that require external infrastructure.
bool all = false; ///< Running every test, including time consuming ones,
///< but without "manuallyRunningTests".
bool express = false; ///< run only carefullty selected "express" test
/// @}

Expand Down
4 changes: 4 additions & 0 deletions test/tools/libtestutils/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,7 @@ boost::unit_test::assertion_result dev::test::run_not_express( boost::unit_test:
return boost::unit_test::assertion_result(
( !!dev::test::Options::get().all ) || ( !dev::test::Options::get().express ) );
}

boost::unit_test::assertion_result dev::test::manuallyRunningTest( boost::unit_test::test_unit_id ) {
return boost::unit_test::assertion_result( dev::test::Options::get().manual );
}
1 change: 1 addition & 0 deletions test/tools/libtestutils/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ boost::filesystem::path getRandomPath();

boost::unit_test::assertion_result option_all_tests( boost::unit_test::test_unit_id );
boost::unit_test::assertion_result run_not_express( boost::unit_test::test_unit_id );
boost::unit_test::assertion_result manuallyRunningTest( boost::unit_test::test_unit_id );

} // namespace test

Expand Down
2 changes: 1 addition & 1 deletion test/unittests/libevm/VMTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class SstoreTestFixture : public TestOutputHelperFixture {
LastBlockHashes lastBlockHashes;
Address from{KeyPair::create().address()};
Address to{KeyPair::create().address()};
State state = State(0).createStateCopyAndClearCaches();
State state = State( 0, dev::TransientDirectory().path(), dev::h256() ).createStateCopyAndClearCaches();
std::unique_ptr< SealEngineFace > se{
ChainParams( genesisInfo( Network::ConstantinopleTest ) ).createSealEngine()};
EnvInfo envInfo{blockHeader, lastBlockHashes, 1, 0, se->chainParams().chainID};
Expand Down
20 changes: 7 additions & 13 deletions test/unittests/libweb3jsonrpc/jsonrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4481,7 +4481,7 @@ BOOST_AUTO_TEST_CASE( skip_invalid_transactions ) {


BOOST_AUTO_TEST_CASE( eth_signAndSendRawTransaction,
*boost::unit_test::precondition( dev::test::run_not_express ) ) {
*boost::unit_test::precondition( dev::test::manuallyRunningTest ) ) {
SkaledFixture fixture( skaledConfigFileName );
fixture.setupFirstKey();
auto firstAccount = fixture.testAccounts.begin()->second;
Expand All @@ -4494,7 +4494,7 @@ BOOST_AUTO_TEST_CASE( eth_signAndSendRawTransaction,
}

BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthTransfers,
*boost::unit_test::precondition( dev::test::run_not_express ) ) {
*boost::unit_test::precondition( dev::test::manuallyRunningTest ) ) {
SkaledFixture fixture( skaledConfigFileName );
vector< Secret > accountPieces;

Expand All @@ -4512,7 +4512,7 @@ BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthTransfers,
}

BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthMTMTransfers,
*boost::unit_test::precondition( dev::test::run_not_express ) ) {
*boost::unit_test::precondition( dev::test::manuallyRunningTest ) ) {
SkaledFixture fixture( skaledConfigFileName );
vector< Secret > accountPieces;

Expand All @@ -4527,11 +4527,8 @@ BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthMTMTransfers,

}




BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthType1Transfers,
*boost::unit_test::precondition( dev::test::run_not_express )) {
*boost::unit_test::precondition( dev::test::manuallyRunningTest )) {
SkaledFixture fixture( skaledConfigFileName );
vector< Secret > accountPieces;

Expand All @@ -4548,9 +4545,8 @@ BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthType1Transfers,

}


BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthType2Transfers,
*boost::unit_test::precondition( dev::test::run_not_express )) {
*boost::unit_test::precondition( dev::test::manuallyRunningTest )) {
SkaledFixture fixture( skaledConfigFileName );
vector< Secret > accountPieces;

Expand All @@ -4567,9 +4563,8 @@ BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthType2Transfers,

}


BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthPowTransfers,
*boost::unit_test::precondition( dev::test::run_not_express )) {
*boost::unit_test::precondition( dev::test::manuallyRunningTest )) {
SkaledFixture fixture( skaledConfigFileName );
vector< Secret > accountPieces;

Expand All @@ -4586,9 +4581,8 @@ BOOST_AUTO_TEST_CASE( perf_sendManyParalelEthPowTransfers,

}


BOOST_AUTO_TEST_CASE( perf_sendManyParalelERC20Transfers,
*boost::unit_test::precondition( dev::test::run_not_express )) {
*boost::unit_test::precondition( dev::test::manuallyRunningTest )) {
SkaledFixture fixture( skaledConfigFileName );
vector< Secret > accountPieces;

Expand Down

0 comments on commit 0b34352

Please sign in to comment.