skip running heavy randomized tests in CI

This commit is contained in:
Alex Stokes 2021-08-24 14:57:56 -07:00
parent 933c1323dd
commit f7c0dc36be
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69
4 changed files with 47 additions and 0 deletions

View File

@ -9,6 +9,7 @@ from eth2spec.test.context import (
misc_balances_in_default_range_with_many_validators,
with_phases,
zero_activation_threshold,
only_generator,
)
from eth2spec.test.context import (
always_bls,
@ -21,6 +22,7 @@ from eth2spec.test.utils.random import (
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -46,6 +48,7 @@ def test_randomized_0(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -71,6 +74,7 @@ def test_randomized_1(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -96,6 +100,7 @@ def test_randomized_2(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -121,6 +126,7 @@ def test_randomized_3(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -146,6 +152,7 @@ def test_randomized_4(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -171,6 +178,7 @@ def test_randomized_5(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -196,6 +204,7 @@ def test_randomized_6(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -221,6 +230,7 @@ def test_randomized_7(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -246,6 +256,7 @@ def test_randomized_8(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -271,6 +282,7 @@ def test_randomized_9(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -296,6 +308,7 @@ def test_randomized_10(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -321,6 +334,7 @@ def test_randomized_11(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -346,6 +360,7 @@ def test_randomized_12(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -371,6 +386,7 @@ def test_randomized_13(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -396,6 +412,7 @@ def test_randomized_14(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([ALTAIR])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,

View File

@ -456,6 +456,17 @@ with_altair_and_later = with_phases([ALTAIR, MERGE])
with_merge_and_later = with_phases([MERGE]) # TODO: include sharding when spec stabilizes.
def only_generator(reason):
def _decorator(inner):
def _wrapper(*args, **kwargs):
if is_pytest:
dump_skipping_message(reason)
return None
return inner(*args, **kwargs)
return _wrapper
return _decorator
def fork_transition_test(pre_fork_name, post_fork_name, fork_epoch=None):
"""
A decorator to construct a "transition" test from one fork of the eth2 spec

View File

@ -9,6 +9,7 @@ from eth2spec.test.context import (
misc_balances_in_default_range_with_many_validators,
with_phases,
zero_activation_threshold,
only_generator,
)
from eth2spec.test.context import (
always_bls,
@ -21,6 +22,7 @@ from eth2spec.test.utils.random import (
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -46,6 +48,7 @@ def test_randomized_0(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -71,6 +74,7 @@ def test_randomized_1(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -96,6 +100,7 @@ def test_randomized_2(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -121,6 +126,7 @@ def test_randomized_3(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -146,6 +152,7 @@ def test_randomized_4(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -171,6 +178,7 @@ def test_randomized_5(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -196,6 +204,7 @@ def test_randomized_6(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -221,6 +230,7 @@ def test_randomized_7(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -246,6 +256,7 @@ def test_randomized_8(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -271,6 +282,7 @@ def test_randomized_9(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -296,6 +308,7 @@ def test_randomized_10(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -321,6 +334,7 @@ def test_randomized_11(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -346,6 +360,7 @@ def test_randomized_12(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -371,6 +386,7 @@ def test_randomized_13(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,
@ -396,6 +412,7 @@ def test_randomized_14(spec, state):
)
@only_generator("randomized test for broad coverage, not point-to-point CI")
@with_phases([PHASE0])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,

View File

@ -157,6 +157,7 @@ from eth2spec.test.context import (
misc_balances_in_default_range_with_many_validators,
with_phases,
zero_activation_threshold,
only_generator,
)
from eth2spec.test.context import (
always_bls,
@ -169,6 +170,7 @@ from eth2spec.test.utils.random import (
)"""
test_template = """
@only_generator(\"randomized test for broad coverage, not point-to-point CI\")
@with_phases([{phase}])
@with_custom_state(
balances_fn=misc_balances_in_default_range_with_many_validators,