ref-fvm icon indicating copy to clipboard operation
ref-fvm copied to clipboard

Improve testing framework

Open Stebalien opened this issue 2 years ago • 1 comments

The current integration testing framework:

https://github.com/filecoin-project/ref-fvm/blob/7c44970d968c8c49c4eedd5168eb16b08d095f26/testing/integration/src/tester.rs#L51-L72

Has some warts:

  1. There's no distinct "builder" versus "tester". This means the executor/state-tree get stashed in options. We should have:
    1. A TesterBuilder for setting up the executor.
    2. A TestBuilder::build() method to create the final Tester.
  2. Modifying the state-tree after instantiating the executor is painful (none of the helper functions like create_account, set_state, etc. work). Ideally, those functions would work on the fully instantiated tester (i.e., work through the instantiated executor) so they could be called at any time.
  3. We could use some additional helpers for sending messages, constructing new actors, etc.
  4. Right now, we construct many of these actors by manually constructing their state. Instead, we should construct them by invoking the actor's constructor (i.e., sending a message with method-number 1).

(this list is non-exhaustive).

Stebalien avatar Mar 07 '23 17:03 Stebalien

Just for noting:

  • Adding support for arbitrary => future fuzzing

Jacarte avatar Mar 13 '23 10:03 Jacarte