Skip to content

Commit 01002a2

Browse files
committed
twister: config: test on integration plaforms if defined
Add option to force integration mode on a defined list of tests, for example tests for sample that are identified with 'sample.'. A sample per definition shall be tested on documented and supported platforms listed in the sample documentation. Samples shall not be used as tests to verify functionality of a feature on all available plaforms in Zephyr. To still allow testing on platforms not listed in the doc, and when such platforms are covered by the provided filter, we should still be able to build/run the tests on those platforms (not directly listed in integration_platforms). We detect a sample by its test identifier, i.e., it starts with 'sample.'. Signed-off-by: Anas Nashif <[email protected]>
1 parent ea322cc commit 01002a2

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

scripts/pylib/twister/twisterlib/testplan.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -786,11 +786,14 @@ def apply_filters(self, **kwargs):
786786
if self.options.integration:
787787
platform_scope = integration_platforms
788788
else:
789-
# if not in integration mode, still add integration platforms to the list
789+
platform_scope = platforms
790790
if not platform_filter:
791-
platform_scope = platforms + integration_platforms
792-
else:
793-
platform_scope = platforms
791+
tco = self.test_config.get('options', {})
792+
im = tco.get('integration_mode', [])
793+
if any(ts.id.startswith(i) for i in im):
794+
platform_scope = integration_platforms
795+
else:
796+
platform_scope += integration_platforms
794797
else:
795798
platform_scope = platforms
796799

scripts/schemas/twister/test-config-schema.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
type: map
66
mapping:
7+
"options":
8+
type: map
9+
required: false
10+
mapping:
11+
"integration_mode":
12+
type: seq
13+
required: false
14+
sequence:
15+
- type: str
716
"platforms":
817
type: map
918
required: false

tests/test_config_ci.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
options:
2+
integration_mode:
3+
- sample.
4+
platforms:
5+
override_default_platforms: false
6+
increased_platform_scope: true
7+
levels:
8+
- name: smoke
9+
description: >
10+
A plan to be used verifying basic zephyr features on hardware.
11+
adds:
12+
- kernel.threads.*
13+
- kernel.timer.behavior
14+
- arch.interrupt
15+
- boards.*
16+
- drivers.gpio.1pin
17+
- drivers.console.uart
18+
- drivers.entropy
19+
- name: acceptance
20+
description: >
21+
More coverage
22+
inherits:
23+
- smoke
24+
adds:
25+
- kernel.*

0 commit comments

Comments
 (0)