bitshares / bitshares-core

BitShares Blockchain node and command-line wallet
https://bitshares.github.io/
Other
1.17k stars 647 forks source link

Regression test for each hard fork #2483

Open abitmore opened 3 years ago

abitmore commented 3 years ago

By now, in many tests, there is code to proceed to the hard fork times that enabled the features, so essentially we do check whether the tests pass just after the hard forks occur, but do not check if they still pass after a longer time.

E.G. in the htlc_expires test, there is code https://github.com/bitshares/bitshares-core/blob/c06d09cecdd9e7526a23456986eb2f9b2b6894aa/tests/tests/htlc_tests.cpp#L83

Ideally we should run tests which still apply after each hard fork.

E.G. for the htlc_expires test, ideally we should test with

Test {
  advance_past_htlc_first_hardfork();
  INVOKE(htlc_expires_test);
}
Test_next {
  advance_past_the_next_hardfork();
  INVOKE(htlc_expires_test);
}
Test_next_next {
  advance_past_next_next_hardfork();
  INVOKE(htlc_expires_test);
}
// more hard forks and more tests ...

An idea is to generate code with CMake script to proceed to each hard fork time and invoke applicable tests.