linera-io/linera-protocol
在 GitHub 查看Split `test_simple_user_operation` unit test into smaller unit tests
Open
#1,484 建立於 2024年1月12日
good first issuerefactortesting
描述
Motivation
The test_simple_user_operation is an integration test that covers a few different functionalities, like:
- Handling an operation
- Forwarding authentication
- Using the runtime storage
- Performing a cross-application call
- Using a session
- Performing a query
Partly this was because it relied on a custom TestApplication type before #1482 was merged replacing it with a more customizable MockApplication. With the MockApplication it is now possible to split the test into simpler tests that are more like unit tests, which would help with regressions by making it simpler to isolate the issues.
Proposal
Split the test into a few smaller tests. One suggestion is to have at least:
- a test for handling an operation that uses the runtime storage
- a test that performs a query
- a test that performs a cross-application call
- a test to ensure authentication is forwarded correctly
New tests can also be added, like for example:
- a test that performs a cross-application query
- a test that calls a session more than once