[Worm CLI] Implement testing for worm submit command (ContractUpgrade case) #3196
AlberErre
started this conversation in
Protocol / feature design discussion
Replies: 2 comments
-
I agree with this approach, it's outside of the scope of these tests to ensure external factors like node uptime. |
Beta Was this translation helpful? Give feedback.
0 replies
-
A Pull request has been created to cover these test cases 🎉 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone 👋!
Would be nice to have some test coverage for the most important Worm CLI commands ⚙️. I've been able to discuss this internally with the core team, and looks like a good approach would be to start testing the
worm submit
command, specifically theContractUpgrade
case.The main goal for this test suite would be to secure this command's functionality. This way we could ensure this command is still functional after any refactor done on the CLI.
As these commands interacts directly with several blockchains networks,
end-to-end
testing would be messy to implement and expensive to execute in this case. Instead, I propose aunit-testing
approach.ℹ️ This
unit-testing
approach would focus on capturing network calls and verify they are as expected.At the end of the day,
worm submit
command launches REST API calls. These API calls could be against a Solana endpoint to submit a transaction, or another chains (such as Ethereum). We could use tools such asmswjs
to capture these REST API request. Therefore they will never reach the network on the test environment. Instead, they are captured and we can match if these request are as we expected.Thoughts? 👀
Beta Was this translation helpful? Give feedback.
All reactions