-
Notifications
You must be signed in to change notification settings - Fork 8k
twister: scripts: sharing of built applications #94167
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: scripts: sharing of built applications #94167
Conversation
3d80e6d
to
23498c2
Compare
@JingsaiLu this is the function that you asked for bt testing |
23498c2
to
f64f2ff
Compare
hi @gchwier I am trying to understand and validate this solution on my boards, one question, add |
Thanks for testing it!
All test applications must be available in test plan. So you can build everything from that folder (skip |
Thanks @gchwier for the detailed explanation : ), another question is, ![]() |
scripts/pylib/pytest-twister-harness/src/twister_harness/fixtures.py
Outdated
Show resolved
Hide resolved
return build_dirs[0] | ||
return None | ||
|
||
def apply_changes_for_required_applications(self, loaded_from_file=False): |
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.
This method should be split for multiple methods to reduce its complexity.
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.
look on apply_filters
, this is a continuation ;)
I do not really want to split this method, as it has a sequential nature, the current implementation keeps all related logic (validating and processing required application) together, making it easier to maintain and debug
I agree, it looks redundant. Within that PR there is not possible to add required applications automatically. The current implementation requires explicit specification of required builds on the command line. I could not find any easy solution how to implement it, without too many changes.
If required apps is not in test plan, then the current test is filtered out. I do not want to raise an error, to not break current test execution. If you are using integration platform (
Yes, all tests that you specified in the command line will be executed. For now the logic is simple. I thought about adding required apps automatically, if are not given from the comamnd line - and then mark them as
In the current implementation we only pass the build dirs of required apps to the pytest run - and in pytest scenario implementation you can do what you want with that artefacts. If that PR is merged, we can extend it by adding new functionalities in a separate PR. Some of these enhancements would require refactoring several methods and updating unit tests, so it's better to keep them separate since the current PR is already big enough. |
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.
@fundakol Thank you for reviewing the changes.
return build_dirs[0] | ||
return None | ||
|
||
def apply_changes_for_required_applications(self, loaded_from_file=False): |
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.
look on apply_filters
, this is a continuation ;)
I do not really want to split this method, as it has a sequential nature, the current implementation keeps all related logic (validating and processing required application) together, making it easier to maintain and debug
f64f2ff
to
8fa6943
Compare
8fa6943
to
b717f38
Compare
This feature enables sharing of built applications between test scenarios, allowing tests to access build artifacts from other applications. Signed-off-by: Grzegorz Chwierut <[email protected]>
b717f38
to
e7171f1
Compare
|
#95056 a device for test approach, please take a look |
bf2378e
into
zephyrproject-rtos:main
Added tests for sharing of build application feature added in zephyrproject-rtos#94167 Signed-off-by: Grzegorz Chwierut <[email protected]>
Added tests for sharing of build application feature added in zephyrproject-rtos#94167 Signed-off-by: Grzegorz Chwierut <[email protected]>
Added tests for sharing of build application feature added in #94167 Signed-off-by: Grzegorz Chwierut <[email protected]>
Added tests for sharing of build application feature added in zephyrproject-rtos#94167 Signed-off-by: Grzegorz Chwierut <[email protected]>
This feature enables sharing of built applications between test scenarios, allowing tests to access build artifacts from other applications.
from twister.rst:
Required applications must be available in the source tree (specified with
-T
and/or
-s
options). When reusing build directories (e.g., with--no-clean
),Twister can find required applications in the current build directory.
How it works:
--required-build
argumentsand accessible through the
required_build_dirs
fixtureLimitations: Not supported with
--subset
or--runtime-artifact-cleanup
options.samples/subsys/testsuite/pytest/shell
is extended to show how to use that feature.To test one can run:
./scripts/twister -c -vv -ll info -T samples/subsys/testsuite/pytest/shell -G
if samples were built, one can run it with
--no-clean
(required builds will be found in build directory):./scripts/twister --no-clean -vv -ll debug -T samples/subsys/testsuite/pytest/shell -s sample.pytest.required_app_demo -p native_sim
To run on the hardware (must have hardware map or change the command with platform and serial parameters):
./scripts/twister -vv -ll debug -T samples/subsys/testsuite/pytest/shell -s sample.pytest.required_app_demo --device-testing --hardware-map ~/tmp/hardware_map.yml --west-flash -s sample.harness.shell -s sample.pytest.shell
Related to RFC: #62649
Based on that PR: #75291 (but removed
no_own_image
part and added option to re-use previously built applications from outdir)