mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 23:41:18 +01:00
Merge pull request #12891 from aabadie/pr/boards/hifive1b_fix_autotest
tools/testrunner: make interactive test sync retries/delay configurable
This commit is contained in:
commit
e8a5eb8dde
10
dist/pythonlibs/testrunner/spawn.py
vendored
10
dist/pythonlibs/testrunner/spawn.py
vendored
@ -24,6 +24,10 @@ RIOTBASE = (os.environ.get('RIOTBASE') or
|
||||
# default value (3)
|
||||
MAKE_TERM_STARTED_DELAY = int(os.environ.get('TESTRUNNER_START_DELAY') or 3)
|
||||
|
||||
# Allow customizing test interactive settings with environment variables
|
||||
TEST_INTERACTIVE_RETRIES = int(os.environ.get('TEST_INTERACTIVE_RETRIES') or 5)
|
||||
TEST_INTERACTIVE_DELAY = int(os.environ.get('TEST_INTERACTIVE_DELAY') or 1)
|
||||
|
||||
|
||||
def list_until(l, cond):
|
||||
return l[:([i for i, e in enumerate(l) if cond(e)][0])]
|
||||
@ -79,8 +83,10 @@ def sync_child(child):
|
||||
_test_utils_interactive_sync(child, modules)
|
||||
|
||||
|
||||
def _test_utils_interactive_sync(child, modules, retries=5, delay=1):
|
||||
def _test_utils_interactive_sync(child, modules):
|
||||
if 'test_utils_interactive_sync' not in modules:
|
||||
return
|
||||
|
||||
utils.test_utils_interactive_sync(child, retries=retries, delay=delay)
|
||||
utils.test_utils_interactive_sync(child,
|
||||
TEST_INTERACTIVE_RETRIES,
|
||||
TEST_INTERACTIVE_DELAY)
|
||||
|
||||
2
dist/pythonlibs/testrunner/utils.py
vendored
2
dist/pythonlibs/testrunner/utils.py
vendored
@ -9,7 +9,7 @@
|
||||
import pexpect
|
||||
|
||||
|
||||
def test_utils_interactive_sync(child, retries=5, delay=1):
|
||||
def test_utils_interactive_sync(child, retries, delay):
|
||||
"""Synchronisation for 'test_utils_interactive_sync' function.
|
||||
|
||||
Interacts through input to wait for node being ready.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user