Skip to content

Commit

Permalink
twister: Ignore skips due to toolchain incompatibility.
Browse files Browse the repository at this point in the history
Skips are turned to errors on integration platforms. However, if
a user (or a CI) selects toolchain other than zephyr, unexpected
errors due to skips can appear. With this commit skips due to
toolchain incompatibilities are not treated as errors.

Signed-off-by: Maciej Perkowski <[email protected]>
  • Loading branch information
PerMac authored and nashif committed Sep 20, 2023
1 parent c82d023 commit 813e40f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/pylib/twister/twisterlib/testplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class Filters:
QUARENTINE = 'Quarantine filter'
# in case a test suite is skipped intentionally .
SKIP = 'Skip filter'
# in case of incompatibility between selected and allowed toolchains.
TOOLCHAIN = 'Toolchain filter'


class TestLevel:
Expand Down Expand Up @@ -779,7 +781,7 @@ def apply_filters(self, **kwargs):
instance.add_filter("In test case platform exclude", Filters.TESTSUITE)

if ts.toolchain_exclude and toolchain in ts.toolchain_exclude:
instance.add_filter("In test case toolchain exclude", Filters.TESTSUITE)
instance.add_filter("In test case toolchain exclude", Filters.TOOLCHAIN)

if platform_filter and plat.name not in platform_filter:
instance.add_filter("Command line platform filter", Filters.CMD_LINE)
Expand All @@ -793,7 +795,7 @@ def apply_filters(self, **kwargs):
instance.add_filter("Not in testsuite platform type list", Filters.TESTSUITE)

if ts.toolchain_allow and toolchain not in ts.toolchain_allow:
instance.add_filter("Not in testsuite toolchain allow list", Filters.TESTSUITE)
instance.add_filter("Not in testsuite toolchain allow list", Filters.TOOLCHAIN)

if not plat.env_satisfied:
instance.add_filter("Environment ({}) not satisfied".format(", ".join(plat.env)), Filters.PLATFORM)
Expand Down Expand Up @@ -1025,7 +1027,8 @@ def change_skip_to_error_if_integration(options, instance):
and "quarantine" not in instance.reason.lower():
# Do not treat this as error if filter type is command line
filters = {t['type'] for t in instance.filters}
ignore_filters ={Filters.CMD_LINE, Filters.SKIP, Filters.PLATFORM_KEY}
ignore_filters ={Filters.CMD_LINE, Filters.SKIP, Filters.PLATFORM_KEY,
Filters.TOOLCHAIN}
if filters.intersection(ignore_filters):
return
instance.status = "error"
Expand Down

0 comments on commit 813e40f

Please sign in to comment.