[go: up one dir, main page]

Proto/tests: Refactor begin_test and init_constants

What

Refactor of some test initialization functions to make constant setting more explicit, and will allow a greater degree of control over flags

Why

Part of the refactoring effort for AI/AS tests

How

Includes the constants definition in the scenario DSL, which makes it way less cumbersome on the test side. Caveats:

  • Uses a module whose sole purpose is to abstract constant setting, it might be difficult or painful to maintain (?)
  • constants are now completely defined within the scenarios, which means they cannot be extracted for high level use. In the existing tests, the only case was consensus_rights_delay, which was used to compute a certain number of cycles to wait until things happen. The current solution is to use the default value, but it might require a smarter solution (for instance, a wait_n_cycles equivalent that can take a value computed from constants).

Manually testing the MR

dune exec src/proto_alpha/lib_protocol/test/integration/main.exe -- --match "test_scenario.*\.ml"

The tests should be exactly the same, so using --verbose &>> test.out before and after the patch should yield (more or less) the same results... it might take a bit, though

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Lucas Randazzo

Merge request reports

Loading