Commit graph

5615 commits

Author SHA1 Message Date
Fabio Baltieri
092e559366 twister: add an explicit path before import Domains
This is line is breaking in some CI setups since the recent ruff fixup
with:

ModuleNotFoundError: No module named 'domains'

Try and fixit by explicitly adding the path before the include, all
other instances have it already.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-30 10:33:29 +00:00
Benjamin Cabé
7d3aa194de Revert "modules: nanopb: Move pip dependencies to optional module"
This reverts commit 26614832f2.
A bug in upstream nanopb, which this commit was pulling as part
of the submanifest update, seems to be causing test failures
on big-endian platforms.
Upstream bug: https://github.com/nanopb/nanopb/issues/1039

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-29 21:45:54 +01:00
Lukasz Mrugala
63dd36993c scripts: Remove useless PyLint suppression
Consider using with suppression became
obsolte and should be removed.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
89d4aa8559 scripts: Fix twisterlib for ruff - E501
This fixes ruff linting error E501,
indicating overlong lines.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
bbd5d16a7a scripts: Fix twisterlib for ruff - UP007
This fixes ruff linting error UP007,
where one would use Optional or Union
instead of X | Y notation.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
9b4397a764 scripts: Fix twisterlib for ruff - UP030, UP031, UP032
Fixes ruff linting errors UP030, UP031, UP032,
which make you use format specifiers (fstrings)
instead of printf formatting or str.format().

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
7746a97e31 scripts: Fix twisterlib for ruff - F541
This fixes ruff linting error F541,
where an fstring is used when a normal
string would suffice.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
8353a6c95f scripts: Fix twisterlib for ruff - F811
This fixes ruff linting error F811,
where a module is reimported or otherwise
redefined without being used.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
22a875e490 scripts: Fix twisterlib for ruff - SIM115
This fixes ruff linting error SIM115,
where files were opened without the use of
a context handler.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
0c6fd60407 scripts: Fix twisterlib for ruff - UP015
This fixes ruff linting error UP015,
where open() has specified unnecessary modes.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
9b128a24e2 scripts: Fix twisterlib for ruff - B028
This fixes ruff linting error B028,
where warnings.warn() lacked explicit
stacklevel parameter.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
0df8240b49 scripts: Fix twisterlib for ruff - SIM105
This fixes ruff linting error SIM105,
where try-except-pass construct was used
instead of contextlib.suppress().

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
96beec0add scripts: Fix twisterlib for ruff - B006
This fixes ruff linting error B006,
where mutables were used as
default parameters.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
12a374cc8b scripts: Fix twisterlib for ruff - B023
This fixes ruff linting error B023,
where function definitions use
loop variables incorrectly.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
9584eaee2d scripts: Fix twisterlib for ruff - B904
This fixes ruff linting error B904,
where an error raised inside an except
clause does not specify from where it
should start.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
29cdac06a0 scripts: Fix twisterlib for ruff - B905
This fixes ruff linter error B905,
where zip lacks explicit use of the
strict parameter.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
1eed6dfaa9 scripts: Fix twisterlib for ruff - B009
This fixes ruff linting error B009,
where getattr() was used with a
constant field name.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
dad7a8e17e scripts: Fix twisterlib for ruff - SIM102
This fixes ruff linting error SIM102,
where multiple ifs were used instead
of combining them with and or similar
operators.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
c0553343c4 scripts: Fix twisterlib for ruff - UP008
This fixes ruff linting error UP008,
where super() call has unnecessary
parameters.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
fbde9f1b1a scripts: Fix twisterlib for ruff - UP021, UP022
This fixes ruff linting errors UP021 and UP022,
where obsolete subprocess parameters were
still used.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
52cd7d673f scripts: Fix twisterlib for ruff - UP004
This fixes ruff linting error UP004,
where a redundant `object` inheritance
is present.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
c273419864 scripts: Fix twisterlib for ruff - UP006
this fixes ruff linting error UP006,
where old typing types are still used
instead of newer, PEP585-compliant ones.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
39599cafc9 scripts: Fix twisterlib for ruff - E713
This fixes ruff linting error E713,
where `not x in y` is used instead
of `x not in y`.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
b541f0415a scripts: Fix twisterlib for ruff - E741
This fixes ruff linting error E741,
where a variable name is ambiguous
or hard to read (e.g. l).

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
c8ac6c3add scripts: Fix twisterlib for ruff - SIM110
This fixes ruff linting error SIM1101,
where a builtin, like any() or all()
has been reimplemented.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
f80f3771a7 scripts: Fix twisterlib for ruff - SIM114
This fixes ruff linting error SIM114,
where there are multiple arms in an
if-elif-else construct with the same result.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
e8c54657e4 scripts: Fix twisterlib for ruff - SIM202, SIM201
This fixes ruff linting error SIM201,
where not is used instead of a more
appropriate comparison operator.
SIM202 exclusion was removed, as it
didn't apply to anything.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
f9c62afd26 scripts: Fix twisterlib for ruff - SIM300
This fixes ruff linting error SIM300,
where constant values are on the left
side of an expression.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
a20e395174 scripts: Fix twisterlib for ruff - SIM401
This fixes the ruff linting error SIM401,
where if-else construction is used instead
of dict.get().

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
f07edf3302 scripts: Fix twisterlib for ruff - SIM118
This fixes the ruff linting error SIM118 - unnecessary
use of keys().

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
240cb62bdf scripts: Fix twisterlib for ruff - I001
This fixes the error I001 - unsorted imports.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
a29236d808 scripts: Fix twisterlib for ruff - UP035
This fixes errors of type UP035 - deprecated import.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Lukasz Mrugala
4175bbb4ce scripts: Fix twisterlib for ruff - E402
This fixes errors E402 - module import
not at top of file.
One error in testplan.py left in,
as it is a part of a obscure 2020 fix
that would need to be re-tested.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-29 15:29:31 +01:00
Pieter De Gendt
26614832f2 modules: nanopb: Move pip dependencies to optional module
The west packages extension can be used to install module dependencies.

Upstream nanopb has added the pip package dependencies to the
zephyr/module.yml file. Remove in-tree pip package dependencies.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-29 15:25:06 +01:00
Wilfried Chauveau
468ce19e9c twister: testplan: fix robot filter when there is no simulator
#79174 incorectly interpreted the condition. If no simulator is found
if cannot be "renode" and therefore robot should be considered unsupported.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-11-28 15:43:48 +00:00
Anas Nashif
318492b5bf ci: testsplan: skip module handling with no west changes
In cases were west modules did not change, skip. This happens when
manifest layout changes, but without SHA changes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-27 10:59:11 -05:00
Anas Nashif
48ddfe7c4a twister: filters: add ability to filter by vendor
add vendor_allow and vendor_exclude to the list of filters. The vendor
data is maintained in the board.yml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-27 06:58:23 -05:00
Ilya Tagunov
3068f668d9 scripts: process_gperf: upgrade the asso_values type to unsigned short
The gperf tool automatically selects the optimal data type for the
asso_values table, depending on MAX_HASH_VALUE. However, there is
a corner case when the tables generated on different stages of the
build process have different data types, causing a link-time error.
Upgrade the data type for the table from unsigned char to unsigned
short to at least exclude this 8-bit to 16-bit transition. There is
another potential issue with the 16-bit to 32-bit transition, but
it seems not very likely to have 65k kernel objects anytime soon.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-27 06:57:23 -05:00
Dmitrii Golovanov
113875d53c twister: testplan: Detect duplicates on --no-detailed-test-id
Detect duplicate TestSuites on load, and raise error when it happens
with `--no-detailed-test-id` option which shortens TestSuite name
excluding the test project path prefix, thus increasing chances
for duplicates. Without this check, only the last duplicated
test configuration was selected while others silently ignored.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-11-27 08:19:39 +01:00
Dmitrii Golovanov
89466f9d7e twister: testplan: Fix duplicate scenarios error reporting
Fix duplicate test scenario error reporting to show paths to all
twister.yaml configuration files where these duplicates were found.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-11-27 08:19:39 +01:00
Pieter De Gendt
5d9a0cba9b ci: compliance: Install python packages from requirements
Instead of maintaining two lists, use the requirements file for
installing compliance dependencies.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-27 08:16:58 +01:00
Torsten Rasmussen
971dfa6024 device: export CMake pre-load from device subsystem enumeration script
Extend the device subsystem enumeration script to produce a CMake
pre-load script.

This allow CMake linker generator scripts to create iterable sections
based on output from device subsystem enumeration.

This ensures that same functionality is available in both ld linker
templates and the linker generator.

Update linker generators to support the use of the device subsystem
enumeration CMake pre-load script.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-11-27 08:15:22 +01:00
Bjarki Arge Andreasen
ece79c3767 device: Add device subsystem enumeration script
The device enumeration feature requires all devices
to place their API implementation in linker sections
by api type. This commit adds a script which uses
the tag __subsystem to identify all existing driver
API types and generate iterable sections for them.

The script is invoked from the top CMakeLists.txt

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
Co-authored-by: Pieter De Gendt <pieter.degendt@basalte.be>
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-27 08:15:22 +01:00
Pieter De Gendt
d2a6e9d701 scripts: ci: tags: Add zephyr-keep-sorted check
The tag entries should be sorted, add zephyr-keep-sorted check and sort
accordingly.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-26 14:43:47 +00:00
de19a13c34 runners: add minichlink
This commit adds a runner wrapper for the 'minichlink' program which
offers a free, open mechanism to use the CH-LinkE programming dongle for
the CH32V003.

https://github.com/cnlohr/ch32v003fun/tree/master/minichlink

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
Pieter De Gendt
43b112a309 scripts: west_commands: runners: Fix jlink unbound cmd
Commit e2a32d8b0ca596afeae48739c43817f693720a88 introduced an unbound
cmd issue for jlink flashing.

Fixed by moving cmd assignment outside of condition.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-26 08:45:06 +01:00
Jean-Christophe Pince
dd5874b924 jlink: custom flashing support
Allows to use a custom flashing script with jlink runners.

Signed-off-by: Jean-Christophe Pince <jean.christophe.pince@qorvo.com>
2024-11-25 21:53:43 +01:00
Pieter De Gendt
2ad915284b scripts: west_commands: Add packages command
Add a new west command as helper for package management of Zephyr
and modules.

The first package manager to get supported is pip, where west projects
can list individual packages or requirements files in their module file.

A convenience --install argument is added to install the packages instead.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-25 12:16:43 +01:00
Pieter De Gendt
bf2db7afc0 python: Format and sort imports
ruff check --select I001 --fix applied to all python files that had
this as only issue.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-25 10:07:13 +01:00
Wilfried Chauveau
7cc70f01f1 scripts: twisterlib: Enable multiple simulator support in twister
This change introduces the ability in twister to select which
emulation/simulation tool to use on the command line.

If none is specified, it will select the first in the list.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-11-25 08:31:28 +01:00