linera-io/linera-protocol

Split `test_simple_user_operation` unit test into smaller unit tests

已关闭

#1,484 创建于 2024年1月12日

 (0 条评论) (0 个反应) (0 位负责人)Rust (2,354 个派生)batch import
good first issuerefactortesting

仓库指标

星标
 (32,149 个星标)
PR 合并指标
 (平均合并 2天 22小时) (30 天内合并 111 个 PR)

描述

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

贡献者指南