test/py: Add an add option to skip flat-tree tests
Add a --no-full option to pytest that passes -F to sandbox, skipping flat-tree tests. This allows running only live-tree tests for faster iteration during development. The default is to run full tests (both live and flat tree). Use --no-full to run only live-tree tests. Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
@@ -102,6 +102,10 @@ def pytest_addoption(parser):
|
||||
help='Show info on test timing')
|
||||
parser.addoption('-P', '--persist', default=False, action='store_true',
|
||||
help='Persist test artifacts (do not clean up after tests)')
|
||||
parser.addoption('--no-timeout', default=False, action='store_true',
|
||||
help='Disable console timeout (useful for debugging)')
|
||||
parser.addoption('--no-full', default=False, action='store_true',
|
||||
help='Skip flat-tree tests (run live-tree only)')
|
||||
|
||||
|
||||
def run_build(config, source_dir, build_dir, board_type, log):
|
||||
@@ -352,6 +356,8 @@ def pytest_configure(config):
|
||||
ubconfig.persist = config.getoption('persist')
|
||||
ubconfig.role = config.getoption('role')
|
||||
ubconfig.allow_exceptions = config.getoption('allow_exceptions')
|
||||
ubconfig.no_timeout = config.getoption('no_timeout')
|
||||
ubconfig.no_full = config.getoption('no_full')
|
||||
|
||||
env_vars = (
|
||||
'board_type',
|
||||
|
||||
@@ -53,6 +53,10 @@ class ConsoleSandbox(ConsoleBase):
|
||||
cmd += ['-d', self.config.dtb]
|
||||
cmd += self.sandbox_flags
|
||||
|
||||
# Skip flat-tree tests if --no-full was passed
|
||||
if self.config.no_full:
|
||||
cmd.append('-F')
|
||||
|
||||
# Always disable the pager
|
||||
cmd.append('-P')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user