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:
Simon Glass
2026-01-01 16:58:22 -07:00
parent bde735ad13
commit 83035cc785
2 changed files with 10 additions and 0 deletions

View File

@@ -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',

View File

@@ -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')