Skip to content

Commit

Permalink
twister: testplan: do not error on missing unsatisfied env
Browse files Browse the repository at this point in the history
bsim requires a special setup for it to be usuable and run by twister.
If this environment is not available, we should not error.

Most developers and users of twister will not have the babblesim setup
and reporting errors is misleading and confusing. So if such env. is not
available, just filter as usual and do not error.

Signed-off-by: Anas Nashif <[email protected]>
  • Loading branch information
nashif committed Nov 30, 2024
1 parent 092e559 commit ea9f9f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/pylib/twister/twisterlib/testplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class Filters:
TOOLCHAIN = 'Toolchain filter'
# in case an optional module is not available
MODULE = 'Module filter'
# in case an optional module is not available
ENVIRONMENT = 'Environment filter'


class TestLevel:
Expand Down Expand Up @@ -1011,7 +1013,7 @@ def apply_filters(self, **kwargs):
if not plat.env_satisfied:
instance.add_filter(
"Environment ({}) not satisfied".format(", ".join(plat.env)),
Filters.PLATFORM
Filters.ENVIRONMENT
)

if not force_toolchain \
Expand Down Expand Up @@ -1305,7 +1307,7 @@ def change_skip_to_error_if_integration(options, instance):
filters = {t['type'] for t in instance.filters}
ignore_filters ={Filters.CMD_LINE, Filters.SKIP, Filters.PLATFORM_KEY,
Filters.TOOLCHAIN, Filters.MODULE, Filters.TESTPLAN,
Filters.QUARANTINE}
Filters.QUARANTINE, Filters.ENVIRONMENT}
if filters.intersection(ignore_filters):
return
instance.status = TwisterStatus.ERROR
Expand Down

0 comments on commit ea9f9f2

Please sign in to comment.