This directory contains two scripts that are used to run tests on a remote Raspberry Pi, which is connected to a J-Link debugger:
- The
request_resource.sh
script, which should be used inside a GitHub Action Workflow before and after running tests on the device. - The
twister_pty.py
script, which is used with thewest/east twister
command. This script receives and prints the outputs generated by the device.
Documentation on how to set up the Raspberry Pi and a detailed explanation of the functionality can be found here.
The scripts mentioned are used by the twister-rpi.yaml
GitHub Actions Workflow. The workflow is
not included in this repository, as it is opt-in. To include it, you must copy the
twister-rpi.yaml
from the
linked repository
into .github/workflows
folder inside your repository and add the following GitHub secrets:
- RPI_IP - IP address of the Raspberry Pi running the JLinkRemoteServer.
The IP can be the local IP address of the Raspberry Pi, if the GitHub Action runner is running on the same network. Or it has to be the VPN IP address of the Raspberry Pi, if the GitHub Action runner is running on a different network.
The following make command has been added to the projects makefile
:
test-remote:
east twister -T tests -p nrf52840dk_nrf52840 --device-testing --device-serial-pty="scripts/twister_pty.py --host ${RPI_IP} --port 7777" --west-runner=jlink --west-flash="--tool-opt=ip ${RPI_IP}:7778"
The command is used to run twister tests on the remote device. The --device-serial-pty
and
--west-flash
options are used to connect to the remote device. The twister_pty.py
script is used
to print the output of the device to the GitHub Actions log. The --west-runner
and --west-flash
options are used to flash the device with the firmware and run the tests.
IMPORTANT: The testcase.yaml
has been modified as well to include the
- CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y
extra_configs
option.
This flag fixes the tests taking a minute longer, due to a timeout. This related issue describes the problem.