The goal is to use artifacts from Oniro zephyr builds with twister's --test-only option and let twister do all the heavy-lifting in terms of flashing all the images to the board and getting the results back to LAVA.
try doing it on the local host. Try with philosopher image or one of the zephyr kernel tests once the build for those is fixed
if it's working, move this to lava. We can utilize LAVA docker job for this. The only unknown for me atm is how to parse the results from twister but imo shouldn't be too hard.
Edited
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
Per the discussion with @stevan.radakovic, this is doable in LAVA by putting the twister test environment inside docker container. Apart from that, we also need build system to provide the test images with the original twister out hierarchy.
We plan to prepare the docker image required in LAVA, and use zephyr upstream source to build and upload twister output like the above to file server for POC in LAVA. @idlethread, I guess, eventually, we will need the help from build team to build artifacts required by twister for oniro using the bitbake build system.
The obvious benefits with twister are:
With twister, we can run all the tests in one LAVA job. Currently, we need a separate LAVA job for each test image.
Twitwister.csv is generated by scripts/twister -p 96b_nitrogen --build-only. Example:
Before test image flashing, the scripts/twister --device-testing --hardware-map map.yml -p 96b_nitrogen --test-only command needs to load the csv file to generate a list of tests for the specific platform. Refer to https://github.com/zephyrproject-rtos/zephyr/blob/main/scripts/twister#L1113ster also can generate consolidated report in xml format which can be easily converted to LAVA results.
Tester/developer can use twister on their local environment without LAVA. Currently, we need the help from LAVA dispatcher to parse test output for generating results.
=== Comments from Andrei ===
I'd need to understand more now twister interacts with the build's artefacts. Especially how that csv file is composed and what it includes. The zephyr elf files should already be provided by the build.
==== ends ===
twister.csv is generated by scripts/twister -p 96b_nitrogen --build-only. Example:
With customized west flash argument scripts/twister -vvv --device-testing --device-serial /dev/ttyACM0 -p arduino_nano_33_ble --west-flash="--bossac=/etc/lava-dispatcher-host/build/boards/nano33ble/bossac" --test-only -O twister-out -T tests/kernel/pending/, the board can be flashed, but fails to run test. I am checking twister source code to understand the issue.
Twister connect serial first and then flash test image. On the nano33 board, we need to press reset twice to enter bootloader for flashing, this will disconnect the serial connection. I needed to patch twister to allow to connect after flash.
For the nano33 board, the test artifacts are generated by command scripts/twister -p arduino_nano_33_ble --build-only -T tests/kernel/context. Since the required ttyACM0 is not enabled from the upstream either, I replaced the zephyr.bin file with the context.bin that provided by @brgl.
From my point of view, the above LAVA job examples proved that we can use twister in LAVA for zephyr testing on both nitrogen and nano33 ble. IMHO, the remaining dependencies on build team are:
Enable ttyACM0 for arduino nano33 ble board
Provide a way to build test artifacts using oniro build system. The build command I used is scripts/twister -p <platform> --build-only tests/kernel. Build recipe/system can just run the command to generate the raw 'twister-out' directory, CI can decide which files should be published.
Nice, thorough work @chaseqi , thanks! I'll consider this ticket close and we can move on with the implementation while keeping the dependencies in mind. I'll open a follow up issue for the next sprint.