diff --git a/specs/test_formats/README.md b/specs/test_formats/README.md index 4783dc475..ac84d5bc0 100644 --- a/specs/test_formats/README.md +++ b/specs/test_formats/README.md @@ -186,6 +186,18 @@ To prevent parsing of hundreds of different YAML files to test a specific test t ... <--- more test types ``` +## Common test-case properties + +Some test-case formats share some common key-value pair patterns, and these are documented here: + +``` +bls_setting: int -- optional, can have 3 different values: + 0: (default, applies if key-value pair is absent). Free to choose either BLS ON or OFF. + Tests are generated with valid BLS data in this case, + but there is no change of outcome when running the test if BLS is ON or OFF. + 1: known as "BLS required" - if the test validity is strictly dependent on BLS being ON + 2: known as "BLS ignored" - if the test validity is strictly dependent on BLS being OFF +``` ## Note for implementers diff --git a/specs/test_formats/epoch_processing/README.md b/specs/test_formats/epoch_processing/README.md index 117be89d1..d3dbfcbd9 100644 --- a/specs/test_formats/epoch_processing/README.md +++ b/specs/test_formats/epoch_processing/README.md @@ -9,8 +9,7 @@ Hence, the format is shared between each test-handler. (See test condition docum ```yaml description: string -- description of test case, purely for debugging purposes -bls_required: bool -- optional, true if the test validity is strictly dependent on BLS being ON. False otherwise. -bls_ignored: bool -- optional, true if the test validity is strictly dependent on BLS being OFF. False otherwise. +bls_setting: int -- see general test-format spec. pre: BeaconState -- state before running the sub-transition post: BeaconState -- state after applying the epoch sub-transition. ``` diff --git a/specs/test_formats/operations/README.md b/specs/test_formats/operations/README.md index 039e01a2f..04e24ddad 100644 --- a/specs/test_formats/operations/README.md +++ b/specs/test_formats/operations/README.md @@ -6,8 +6,7 @@ The different kinds of operations ("transactions") are tested individually with ```yaml description: string -- description of test case, purely for debugging purposes -bls_required: bool -- optional, true if the test validity is strictly dependent on BLS being ON. False otherwise. -bls_ignored: bool -- optional, true if the test validity is strictly dependent on BLS being OFF. False otherwise. +bls_setting: int -- see general test-format spec. pre: BeaconState -- state before applying the operation : -- the YAML encoded operation, e.g. a "ProposerSlashing", or "Deposit". post: BeaconState -- state after applying the operation. No value if operation processing is aborted. diff --git a/specs/test_formats/sanity/blocks.md b/specs/test_formats/sanity/blocks.md index 696813740..3004a6de7 100644 --- a/specs/test_formats/sanity/blocks.md +++ b/specs/test_formats/sanity/blocks.md @@ -6,8 +6,7 @@ Sanity tests to cover a series of one or more blocks being processed, aiming to ```yaml description: string -- description of test case, purely for debugging purposes -bls_required: bool -- optional, true if the test validity is strictly dependent on BLS being ON. False otherwise. -bls_ignored: bool -- optional, true if the test validity is strictly dependent on BLS being OFF. False otherwise. +bls_setting: int -- see general test-format spec. pre: BeaconState -- state before running through the transitions triggered by the blocks. blocks: [BeaconBlock] -- blocks to process, in given order, following the main transition function (i.e. process slot and epoch transitions in between blocks as normal) post: BeaconState -- state after applying all the transitions triggered by the blocks. diff --git a/specs/test_formats/sanity/slots.md b/specs/test_formats/sanity/slots.md index e8961608d..81866d47b 100644 --- a/specs/test_formats/sanity/slots.md +++ b/specs/test_formats/sanity/slots.md @@ -6,8 +6,7 @@ Sanity tests to cover a series of one or more empty-slot transitions being proce ```yaml description: string -- description of test case, purely for debugging purposes -bls_required: bool -- optional, true if the test validity is strictly dependent on BLS being ON. False otherwise. -bls_ignored: bool -- optional, true if the test validity is strictly dependent on BLS being OFF. False otherwise. +bls_setting: int -- see general test-format spec. pre: BeaconState -- state before running through the transitions. slots: N -- amount of slots to process, N being a positive numer. post: BeaconState -- state after applying all the transitions. diff --git a/test_libs/pyspec/eth2spec/test/context.py b/test_libs/pyspec/eth2spec/test/context.py index a484cc995..2be9322de 100644 --- a/test_libs/pyspec/eth2spec/test/context.py +++ b/test_libs/pyspec/eth2spec/test/context.py @@ -39,7 +39,7 @@ def expect_assertion_error(fn): # Tags a test to be ignoring BLS for it to pass. -bls_ignored = with_tags({'bls_ignored': True}) +bls_ignored = with_tags({'bls_setting': 2}) def never_bls(fn): @@ -54,7 +54,7 @@ def never_bls(fn): # Tags a test to be requiring BLS for it to pass. -bls_required = with_tags({'bls_required': True}) +bls_required = with_tags({'bls_setting': 1}) def always_bls(fn):