Skip to content

Commit 30ad190

Browse files
nashifkartben
authored andcommitted
twister: testplan: do not verify_platforms_existence again
We already sanitize those lists very early on, no need to call this check again on the same lists. Signed-off-by: Anas Nashif <[email protected]>
1 parent c0dbcda commit 30ad190

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

scripts/pylib/twister/twisterlib/testplan.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -816,12 +816,7 @@ def apply_filters(self, **kwargs):
816816
if platform_filter:
817817
logger.debug(f"Checking platform filter: {platform_filter}")
818818
# find in aliases and rename
819-
self.verify_platforms_existence(platform_filter, "platform_filter")
820-
for pf in platform_filter:
821-
logger.debug(f"Checking platform in filter: {pf}")
822-
if pf in self.platform_names:
823-
_platforms.append(self.get_platform(pf).name)
824-
platform_filter = _platforms
819+
platform_filter = self.verify_platforms_existence(platform_filter, "platform_filter")
825820
platforms = list(filter(lambda p: p.name in platform_filter, self.platforms))
826821
elif emu_filter:
827822
platforms = list(
@@ -850,7 +845,7 @@ def apply_filters(self, **kwargs):
850845

851846
keyed_tests = {}
852847

853-
for ts_name, ts in self.testsuites.items():
848+
for _, ts in self.testsuites.items():
854849
if (
855850
ts.build_on_all
856851
and not platform_filter
@@ -862,14 +857,10 @@ def apply_filters(self, **kwargs):
862857
filter(lambda item: item.name in ts.integration_platforms, self.platforms)
863858
)
864859
if self.options.integration:
865-
self.verify_platforms_existence(
866-
ts.integration_platforms, f"{ts_name} - integration_platforms")
867860
platform_scope = integration_platforms
868861
else:
869862
# if not in integration mode, still add integration platforms to the list
870863
if not platform_filter:
871-
self.verify_platforms_existence(
872-
ts.integration_platforms, f"{ts_name} - integration_platforms")
873864
platform_scope = platforms + integration_platforms
874865
else:
875866
platform_scope = platforms
@@ -886,7 +877,6 @@ def apply_filters(self, **kwargs):
886877
and not integration
887878
and platform_config.get('increased_platform_scope', True)
888879
):
889-
self.verify_platforms_existence(ts.platform_allow, f"{ts_name} - platform_allow")
890880
a = set(platform_scope)
891881
b = set(filter(lambda item: item.name in ts.platform_allow, self.platforms))
892882
c = a.intersection(b)
@@ -979,12 +969,6 @@ def apply_filters(self, **kwargs):
979969
instance.add_filter("In test suite vendor exclude", Filters.TESTSUITE)
980970

981971
if ts.platform_exclude and plat.name in ts.platform_exclude:
982-
# works only when we have all platforms parsed, -p limits parsing...
983-
if not platform_filter:
984-
self.verify_platforms_existence(
985-
ts.platform_exclude,
986-
f"{ts_name} - platform_exclude"
987-
)
988972
instance.add_filter("In test case platform exclude", Filters.TESTSUITE)
989973

990974
if ts.toolchain_exclude and toolchain in ts.toolchain_exclude:

0 commit comments

Comments
 (0)