[go: up one dir, main page]

Where to put Michelson scripts for system tests?

Related: #3894, #3942 (closed)

Overview

graph LR
    !6680:::merged --> !6658
    !6658:::merged --> !6660:::merged
    !6658 --> !7172:::merged
    !7172 --> !7173:::merged
    !7172 --> !7174
    !7173 --> !7463:::merged
    !7174:::merged --> !7463
    classDef merged fill:#CBE2F9
    classDef open fill:#C3E6CD
    classDef draft fill:#FDF1DD

Legend: blue is merged, green is open, yellow is draft.

  • !6680 (merged): Implement a script versioning mechanism in tezt.
  • !6658 (merged): Restructure and move tezt/tests/contracts to a central location (here michelson_test_scripts in the root of octez)
  • !7172 (merged): Rename bug_XXX.tz scripts in pytest/contracts_* folder that does not follow convention
    • !7173 (merged): Use Michelson_script in pytest
    • !7174 (merged): Tezt/Tests: use [Michelson_script] for tests using Michelson scripts in tests_python
      • !7463 (merged): Merge tests_python/contracts_* into michelson_test_scripts

Context

We store a set of michelson scripts for testing purposes in various parts of the project:

Folder # of .tz files
./src/* 84
./tests_python/contracts_* 388
./tezt/ 37

(scripts duplicated in per protocol are omitted)

The dispersion of scripts is unfortunate leading to duplication and confusion.

The tests in the tezt are stored in a confusing manner, where sub-folders correspond both to a versioning scheme (the folders proto_alpha and proto_current_mainnet) and a categorization scheme mini_scenarios but scripts are also stored directly in tezt/tests/contracts.

On the pytest side, there is a large amount of duplication between protocols.

Up to now, pytests and scripts have been migrated tezt in an ad hoc manner. Unfortunately, this has only increased the dispersion and confusing, leaving us with unknown regression traces, potentially duplicated scripts etc. Therefore I propose an upfront restructuring so that both existing tezts, pytests and migrated pytests follow the same structure.

Goals:

  • Centralize script storage for system tests (pytest and tezt)
  • Make future-compatible with ongoing migration from pytest to tezt
  • Make it easy to distinguish script by a loosely defined category (by default, going with the categorization used in pytests i.e. ill_typed, op_codes, mini_scenarios, ...).
  • Make it easy to version scripts by protocol.

Side goals:

  • Do these changes with minimal disruption to regression traces to ease review.

Scope:

  • For now, I will only consder system tests (the folders tezt/tests/contracts and tests_python/contracts_*)
Edited by Arvid Jakobsson