pytest: add slow_test marker.

And when it's set, and we're SLOW_MACHINE, simply disable valgrind.

Since Travis (SLOW_MACHINE=1) only does VALGRIND=1 DEVELOPER=1 tests,
and VALGRIND=0 DEVELOPER=0 tests, it was missing tests which needed
DEVELOPER and !VALGRIND.

Instead, this demotes them to non-valgrind tests for SLOW_MACHINEs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-08-07 12:44:59 +09:30
committed by Christian Decker
parent 51aae9cce7
commit 01a82d38f7
6 changed files with 34 additions and 27 deletions

View File

@@ -959,7 +959,11 @@ class LightningNode(object):
class NodeFactory(object):
"""A factory to setup and start `lightningd` daemons.
"""
def __init__(self, testname, bitcoind, executor, directory, db_provider, node_cls):
def __init__(self, request, testname, bitcoind, executor, directory, db_provider, node_cls):
if request.node.get_closest_marker("slow_test") and SLOW_MACHINE:
self.valgrind = False
else:
self.valgrind = VALGRIND
self.testname = testname
self.next_id = 1
self.nodes = []
@@ -969,7 +973,6 @@ class NodeFactory(object):
self.lock = threading.Lock()
self.db_provider = db_provider
self.node_cls = node_cls
self.valgrind = VALGRIND
def split_options(self, opts):
"""Split node options from cli options