Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompose 6 non-atomic tests in InstructionsTests.kt suite #321

Open
16 tasks
AlexStroke opened this issue Apr 18, 2023 · 0 comments
Open
16 tasks

Decompose 6 non-atomic tests in InstructionsTests.kt suite #321

AlexStroke opened this issue Apr 18, 2023 · 0 comments

Comments

@AlexStroke
Copy link
Contributor

AlexStroke commented Apr 18, 2023

Feature request

We should have atomic tests for better test maintainability and readability. There are a few tests that have multiple checks, and we need to decompose them into separate tests.

Motivation

Having atomic tests makes it easier to identify the root cause of test failures and ensures that each test only checks for a specific behavior.

Decompose existing tests into more atomic tests

The following tests should be decomposed into more atomic tests using the Allure SdkTestId annotations to define the new tests:

register and unregister account instruction committed

  • register_account @Permission("no_permission_required")
  • unregister_account @Permission("no_permission_required")

register and unregister asset instruction committed

  • register_asset_definition @Permission("no_permission_required")
  • unregister_asset_definition @Permission("no_permission_required")

register and unregister domain instruction committed

  • register_domain @Permission("no_permission_required")
  • unregister_domain @Permission("no_permission_required")

burn if condition otherwise not burn

  • burn_asset_if_condition @Permission("no_permission_required")
  • not_burn_asset_if_condition_not_met @Permission("no_permission_required")

check assets with type Fixed are properly minted and burned

  • register_fixed_asset_definition @Permission("no_permission_required")
  • mint_fixed_asset @Permission("no_permission_required")
  • burn_fixed_asset @Permission("no_permission_required")

register and grant role to account

  • register_asset_definition_with_store_value_type @Permission("no_permission_required")
  • register_role @Permission("no_permission_required")
  • attach_permissions_to_role @Permission("no_permission_required")
  • grant_role_to_account @Permission("no_permission_required")
  • set_key_value_in_foreign_asset_after_granting_role @Permission("can_set_key_value_in_user_asset")
@AlexStroke AlexStroke changed the title Decompose non-atomic tests in Instructions suite Decompose 8 non-atomic tests in Instructions suite Apr 18, 2023
@AlexStroke AlexStroke changed the title Decompose 8 non-atomic tests in Instructions suite Decompose 8 non-atomic tests in InstructionsTests.kt suite Apr 18, 2023
@arndey arndey added the iroha2 label Apr 25, 2023
@AlexStroke AlexStroke changed the title Decompose 8 non-atomic tests in InstructionsTests.kt suite Decompose 6 non-atomic tests in InstructionsTests.kt suite May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants