Move the existing "--no-load" argument from the OpenOCD and Intel Cyclone V
runners into an argument in the runners base class such that it can be used
by all runners. Also update the existing runners to work with the common
option instead of their own.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Update pyocd version to be greater than or equal to 0.36.0 to fix
the potential hang issue when execute "west packages pip --install"
This PR is to fix the issue #99115.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
`west sdk install` may fail with a GitHub API rate-limit (HTTP 403)
error. This typically occurs when the command is run multiple times
after previous failures, which is common for new users setting up
the project. Currently, the thrown exception only links to a generic
GitHub rate-limit documentation page, which may be confusing to users.
Users can bypass the rate limit by authenticating with GitHub using a
Personal Access Token. The install script supports this via the
`--personal-access-token` argument. Therefore, detect rate-limit related
failures and print a helpful message suggesting the use of this
argument or netrc based authentication.
Signed-off-by: Beleswar Prasad Padhi <b-padhi@ti.com>
An auto-cache directory can be provided via the `west blobs fetch
--auto-cache` argument or the `blobs.auto-cache-dir` config option.
When enabled, the auto-cache is automatically filled whenever a blob is
missing and must be downloaded.
One or more additional cache directories can be specified via argument
`west blobs fetch --cache-dirs` or the `blobs.cache-dir` config option
(multiple paths separated by `;`).
`west blobs fetch` searches all configured cache directories (including
the auto-cache) for a matching blob filename. Cached files may be stored
either under their original filename or with a SHA-256 suffix
(`<filename>.<sha>`).
If found, the blob is copied from the cache to the blob path; otherwise
it is downloaded from its url to the blob path.
Signed-off-by: Thorsten Klein <Thorsten.Klein@bshg.com>
Update workflow to use the new version of Vermin to enrich the Python
minimum version checks in the CI pipelines.
Signed-off-by: Morten Kristensen <me@mortens.dev>
Testing on linux, --flash-before argument did not work to wait for jlink
upload to complete. Instead Serial port opening throws file not found. The
fix ensures that the code waits for the serial port to appear before
attempting to connect. Tested on a proprietary platform with virtual UART
through usb.
Signed-off-by: Eemil Visakorpi <eemil@doublepoint.com>
The script currently only adds the 'size: XS' label for small PRs (1
commit with ≤1 addition and ≤1 deletion), but it doesn't remove this
label if the PR grows larger after subsequent updates.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change direction for raw data file from $ZEPHYR_BASE
to <path_to>twister-out/../<test>/
Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
Fix broken copyright parsing. Since REUSE 6.0.0 the copyright_lines
attribute has been removed. The new attribute copyright_notices is used.
Additionally, the python package REUSE should now be at least v0.6.0.
This will require an update of REUSE for users that were using a
version earlier than 0.6.
Fixes#98378
Signed-off-by: Simone Orru <simone.orru@secomind.com>
The rewrite by ruff seems to wrongly pass a single argument to filter(),
as seen in the logs:
```
f.process()
File "/home/runner/work/zephyr/zephyr/zephyr/./scripts/ci/test_plan.py",
line 145, in process
self.find_boards()
File "/home/runner/work/zephyr/zephyr/zephyr/./scripts/ci/test_plan.py",
line 292, in find_boards
self.resolved_files.extend(list(filter(resolved_filter)))
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: filter expected 2 arguments, got 1
```
Split things up properly to avoid this.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Until now the code was using the path to the .hex file to select the
directory where the generated JSON file required for nrfutil would be
generated. But this has a problem: if the .hex file in a sysbuild
project is located in the tree as a precompiled binary, the runner would
place a file in there and make the tree dirty. Instead use the build_dir
folder which always corresponds (in both sysbuild and regular builds)
to the current target build directory.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
File groups inherit file patterns from their parent area. A file will only
match a file group if it first matches the parent area's patterns, and then
also matches the file group's own patterns. This allows file groups to
further filter and subdivide files that are already covered by the area.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This new section allows defining a group of files in an area and makes
it possible to assign collaborators to the file group being defined.
The purpose of this new section is to allow fine tuning who is added as
reviewer when files change in a group. It is especially useful in large
areas with hundreds of files, for example platform areas.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Pass 'encoding="utf-8"' to all 'subprocess.run()' calls.
This treats the captured stdout and stderr streams as text rather than
byte sequences.
Example without this patch:
west patch apply --roll-back
ERROR: b'error: patch failed: examples/csp_server_client.py:32\n
error: examples/csp_server_client.py: patch does not apply\n'
FATAL ERROR: failed to apply patch libcsp/test.patch
Example with this patch:
west patch apply --roll-back
ERROR: error: patch failed: examples/csp_server_client.py:32
error: examples/csp_server_client.py: patch does not apply
FATAL ERROR: failed to apply patch libcsp/test.patch
Signed-off-by: Mirai SHINJO <oss@mshinjo.com>
Pass 'capture_output=True' to the 'subprocess.run()' call in the 'apply()'
method.
This ensures that stdout and stderr are captured, so 'proc.stderr'
is not 'None' when 'self.err()' is called on a failed process.
Example without this patch:
west patch apply --roll-back
error: patch failed: examples/csp_server_client.py:32
error: examples/csp_server_client.py: patch does not apply
ERROR: None
FATAL ERROR: failed to apply patch libcsp/test.patch
Example with this patch:
west patch apply --roll-back
ERROR: b'error: patch failed: examples/csp_server_client.py:32\n
error: examples/csp_server_client.py: patch does not apply\n'
FATAL ERROR: failed to apply patch libcsp/test.patch
Signed-off-by: Mirai SHINJO <oss@mshinjo.com>
Simple formatting via ruff on dictionary logging scripts.
No manual editing was done on the scripts.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
I initially added the GEN_UICR options to the gen_uicr image's Kconfig
tree only to not pollute the main tree.
But there is a lot of useful help text in the GEN_UICR option's
Kconfig file that I would like users to be able to read/reference from
the docs.
To not increase the complexity of the Kconfig doc generator, we add
the GEN_UICR options to the main tree and have them all be disabled
for builds other than the gen_uicr image.
Being in the main tree has the added benefit of being recognzied by
the compliance checker.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The readlines_until method is part of the testing framework
(pytest harness) and should not print a full stack trace
when the expected line isn't found. It should also raise
an AssertionError instead of a TwisterHarnessTimeoutException,
allowing users to know that a test failed because the expected
condition did not happen.
Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
In order to avoid duplication of logic in runners, allow subclasses
of ZephyrBinaryRunner to set self.dry_run so that they can then reuse
the logic in core.py to log instead of execute.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Move the argparse.add_argument() call to the abstract base class and
augment the RunnerCaps class with a dry_run parameter.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Extend twister's device serial handling to support multiple serial ports
for pytest-based tests. This enables testing scenarios that require
communication with multiple UART interfaces on the same device.
This enhancement enables comprehensive testing of multi-UART devices
while maintaining backward compatibility with single serial setups.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This commit makes two key improvements to the DeviceHandler:
1. Pass TWISTER_PLATFORM environment variable to serial PTY scripts
- Enables serial PTY scripts to access platform-specific configuration
- The platform name is now available via TWISTER_PLATFORM env variable
- Allows board-specific serial port and baudrate configuration in
external serial forwarding scripts
2. Reorder pre-script execution before serial PTY initialization
- Moved pre-script execution before serial PTY setup to avoid conflicts
- Prevents race conditions when pre-script performs board power cycling
or reset operations that might interfere with active serial
connections
These changes enable more flexible hardware testing scenarios where:
- Serial configuration can be automatically selected based on board type
- Board initialization (power cycling, FPGA programming) completes
before establishing serial connections
Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
This requirements file can be confusing and will only get stale over
time. Drop it since these dependencies are actually captured in
scripts/requirements-run-test.txt
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>