-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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: additional scripts #72808
base: main
Are you sure you want to change the base?
Twister: additional scripts #72808
Conversation
Add the execution of external scripts at precise moments. These scripts can be strategically deployed in three distinct phases: pre-script, post-flash-script and post-script. This functionality could help configuring the environment optimally before testing. Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
70a6788
to
1aff18b
Compare
pre_script: | ||
<PATH_TO_PRE_SCRIPT> | ||
post_flash_script: | ||
<PATH_TO_POST_FLASH_SCRIPT> | ||
post_script: | ||
<PATH_TO_POST_SCRIPT> | ||
comment: | ||
Testing extra scripts |
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.
Are we planning to use it for tests in Zephyr tree?
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.
Solution is designed with flexibility in mind, making it suitable for use in a variety of contexts, including the Zephyr tree.
why no just put to the map.yaml file? along with --device-testing? |
Currently, we have the capability to run scripts based on specified runner parameters; however, this approach limits us to the execution of pre scripts only. An alternative method would involve enhancing the map file to accommodate script execution, but this leads to redundancy when dealing with multiple identical boards, as we would need to replicate the script type, scenario, and path information for each entry. |
Add unit tests designed for testing additional scripting feature. Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
1aff18b
to
a0b6ba1
Compare
This could be easily out of control as no one knows what you do in the rep/post, why we need customer for each case? why not just use pytest framework to do so? |
I concur that allowing unrestricted modifications to scripts by everyone could pose risks. However, the proposed solution does not necessitate storing the scripts or the scripting-list.yaml file within the Zephyr repository, similar to how the quarantine-list file is managed. You will have the flexibility to manage scripts within your own environment. This file is not mandatory, it serves to enhance the functionality of Twister for use in personalized settings. |
this thing is if go this way, the twister will be diverged in its behavour, quaratine is to skip test cases. but adding pre/post staff will impact the way test runs. it is better in a controlable way. unless you have strong user case to supporting doing so. |
There are many ways of usage, i could take an example power management tests, where we can set up the necessary power conditions, calibrate or reset power measurement tools, perform initial checks to validate that the device is in the right state for power measurements and gather power usage data |
Add the execution of external scripts at precise moments. These scripts can be strategically deployed in three distinct phases: pre-script, post-flash-script and post-script. This functionality could help configuring the environment optimally before testing.
Script phases are already implemented solution, this PR serves as an extension to broaden their application and utility.
Usage is similar to quarantine file :
twister -p <BOARD> -T <TEST_SCENARIO> --scripting-list <PATH_TO_SCRIPTING_YAML>
An example of entries in a scripting list yaml:
Usage of all (pre_script, post_flash_script, post_script) is not mandatory, it could be only one parameter.
One of the primary benefits of this approach is the ability to execute scripts tailored to individual scenarios.