linera-io/linera-protocol

Split `test_simple_user_operation` unit test into smaller unit tests

Open

#1,484 建立於 2024年1月12日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Rust (32,149 star) (2,354 fork)batch import
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

貢獻者指南

Split `test_simple_user_operation` unit test into smaller unit tests · linera-io/linera-protocol#1484 | Good First Issue