-
Notifications
You must be signed in to change notification settings - Fork 30
Speed up the framework #171
Description
Instructions
Make the testing framework faster so that Jest timeouts don't need to be so long.
Issue To Be Solved
The testing framework can be quite slow with complex tests (exceeding 10 seconds long). This can cause discrepancy between local testing and CI runners confusing developers.
(Optional): Suggest A Solution
There are a few ways which emulator performance can potentially be optimized.
-
Use a WASM version of the flow-emulator. This would allow direct interfacing with the emulator via Javascript, remove slowdowns related to spawning a new process. (and it would be a cleaner way of operating this library, which is always a plus). Prototyping has shown WASM to be significantly slower than native and this does not appear to be a solution. -
Find a better way of deploying FlowManager. Currently, multiple transactions and scripts are involved in checking if FlowManager is deployed/deploying it at any point of execution which causes some slowdown. While this would likely have lower latency if the emulator was built through WebAssembly, it is still an inefficient means of completing this task.
Whether through WASM or not, there should be some efficient means of deploying the FlowManager contract invariably when Flow JS Testing starts up (avoiding constantly checking if it has already been deployed).
(Optional): Context
An example of this is on the flow-nft repo. The tests in this commit https://github.com/onflow/flow-nft/tree/a8674860f8f6cb2c441532a5ff9051d8176fcda8 will pass on a M1 Macbook but fail on the CI runner. This discrepancy can be somewhat troubling for the end user and potentially hard to debug.
See GH actions log: https://github.com/onflow/flow-nft/runs/7903285241?check_suite_focus=true