-
Notifications
You must be signed in to change notification settings - Fork 8.3k
twister: ztest: short test case names on --no-detailed-test-id #82302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
twister: ztest: short test case names on --no-detailed-test-id #82302
Conversation
b51d0fd to
d1c841b
Compare
d1c841b to
8223e37
Compare
8223e37 to
0df70f9
Compare
|
rebased resolving conflicts with #82043 |
0df70f9 to
cacd64a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That note at the end i do not understand, what is Ztest Identificator? sounds like a new terminology.
I would also reduce verbosity in the help for command line option and prefer to expand in the documentation but this seems to be a common theme across all options, need to clean this up a bit, we have too many options and each comes with a mouthful of help making --help less helpful :(
Anyways, what I noticed is the following:
./scripts/twister --test-tree -T tests/kernel/semaphore/ --no-detailed-test-id
ZEPHYR_BASE unset, using "/home/nashif/zephyrproject/zephyr"
Renaming output directory to /home/nashif/zephyrproject/zephyr/twister-out.8
INFO - Using Ninja..
INFO - Zephyr version: v4.0.0-1232-gcacd64a67ae1
INFO - Using 'zephyr' toolchain.
Testsuite
├── Samples
└── Tests
├── kernel_sys_sem
├── semaphore
├── semaphore_1cpu
└── semaphore_null_case
vs
./scripts/twister --test-tree -T tests/kernel/semaphore/
ZEPHYR_BASE unset, using "/home/nashif/zephyrproject/zephyr"
Renaming output directory to /home/nashif/zephyrproject/zephyr/twister-out.9
INFO - Using Ninja..
INFO - Zephyr version: v4.0.0-1232-gcacd64a67ae1
INFO - Using 'zephyr' toolchain.
Testsuite
├── Samples
└── Tests
└── kernel
└── semaphore
├── kernel.semaphore.semaphore.k_sem_correct_count_limit
├── kernel.semaphore.semaphore.k_sem_define
├── kernel.semaphore.semaphore.k_sem_init
├── kernel.semaphore.semaphore.sem_count_get
├── kernel.semaphore.semaphore.sem_give_from_isr
├── kernel.semaphore.semaphore.sem_give_from_thread
├── kernel.semaphore.semaphore.sem_give_take_from_isr
├── kernel.semaphore.semaphore.sem_measure_timeout_from_thread
├── kernel.semaphore.semaphore.sem_measure_timeouts
├── kernel.semaphore.semaphore.sem_multi_take_timeout_diff_sem
├── kernel.semaphore.semaphore.sem_multiple_threads_wait
├── kernel.semaphore.semaphore.sem_reset
├── kernel.semaphore.semaphore.sem_reset_waiting
├── kernel.semaphore.semaphore.sem_take_multiple
├── kernel.semaphore.semaphore.sem_take_no_wait
├── kernel.semaphore.semaphore.sem_take_no_wait_fails
├── kernel.semaphore.semaphore.sem_take_timeout
├── kernel.semaphore.semaphore.sem_take_timeout_fails
├── kernel.semaphore.semaphore.sem_take_timeout_forever
├── kernel.semaphore.semaphore.sem_thread2isr
├── kernel.semaphore.semaphore.sem_thread2thread
├── kernel.semaphore.semaphore_1cpu.sem_multiple_take_and_timeouts
├── kernel.semaphore.semaphore_1cpu.sem_queue_mutual_exclusion
├── kernel.semaphore.semaphore_1cpu.sem_take_timeout_isr
├── kernel.semaphore.semaphore_null_case.sem_count_get_null
├── kernel.semaphore.semaphore_null_case.sem_give_null
├── kernel.semaphore.semaphore_null_case.sem_init_null
├── kernel.semaphore.semaphore_null_case.sem_reset_null
├── kernel.semaphore.semaphore_null_case.sem_take_null
├── kernel.semaphore.usage.kernel_sys_sem.multi_thread_sem_limit
└── kernel.semaphore.usage.kernel_sys_sem.multiple_thread_sem_usage
So, this is completeltly different output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That note at the end i do not understand, what is Ztest Identificator? sounds like a new terminology.
changed
Anyways, what I noticed is the following:
... So, this is completeltly different output.
fixed with Twister tests extended.
cacd64a to
4b8e4da
Compare
4b8e4da to
ca73979
Compare
Extend `--no-detailed-test-id` command line option: in addition to its current behavior to exclude from a test Suite name its configuration path prefix, also don't prefix each Ztest Case name with its Scenario name. For example: 'kernel.common.timing' Scenario name, the same Suite name, and 'sleep.usleep' test Case (where 'sleep' is its Ztest suite name and 'usleep' is Ztest test name. This way both TestSuite and TestCase names follow the same principle having no parent object name prefix. There is no information loss in Twister reports with this naming: TestSuite is a container object for its TestCases, whereas TestSuite has its configuration path as a property. Signed-off-by: Dmitrii Golovanov <[email protected]>
ca73979 to
a0b13a6
Compare
|
Look at the output in with this PR: classname should be |
The testcase.classname properties in `twister_report.xml` and `twister_suite_report.xml` now contain the full testsuite name (without its path prefix) instead of just two its dot-separated leftmost components. This way `twister_report.xml` testsuite container has no duplicate testcase elements with the same `classname` and `name` properties executing with --no-detailed-test-id for a project with same testcase names in its 'sibling' suites, for example`tests/kernel/sleep`. Signed-off-by: Dmitrii Golovanov <[email protected]>
Pretty print XML reports with tab identation on levels for better readability and ease text diff there as well. Signed-off-by: Dmitrii Golovanov <[email protected]>
fixed, also addressing duplicate testcase elements possible in |
Extend
--no-detailed-test-idcommand line option: in addition to its current behavior to exclude from a test Suite name its configuration path prefix, also don't prefix each Ztest Case name with its Scenario name.For example:
kernel.common.timingScenario name is the same as Suite name, andsleep.usleeptest Case wheresleepis its Ztest suite name andusleepis Ztest test name.With detailed-id:
tests/kernel/sleep/kernel.common.timingandkernel.common.timing.sleep.usleeprespectively.This way both TestSuite and TestCase names follow the same principle having no parent object name prefix.
There is no information loss in Twister reports with this naming: TestSuite is a container object for its TestCases, whereas TestSuite has its configuration path as a property.
Follow-up to review #80088 and recent discussions at the Twster WG meetings.