Commit Graph

11 Commits

Author SHA1 Message Date
Jörg Hofrichter
5f3c311fe6 tools: analyze changeset: automatically resolve git toplevel
With this change it is possible to execute changeset_testlist.py
in a directory which does not match the toplevel of the repository.

The toplevel is automatically detected by calling:

    git rev-parse --show-toplevel
2025-10-27 13:54:50 +01:00
Joerg Hofrichter
86f91137df tools: changeset_testlist: Align add-test and remove-test
Use the nargs="*" syntax for both the --add-test and the
--remove-test flags which allows adding and removing
multiple tests.

This fixes 6b05b65d4e.
2025-03-10 10:32:35 +01:00
Jörg Hofrichter
b7f41ad216 tools: analyze changeset: Fix diff command when using commit ids
... for both source and target.

Providing source and target as commit ID does not work when using
two arguments (e.g. "target... source"). Hence, use one argument
(e.g. "target...source") instead.
2025-03-07 11:58:29 +01:00
Martin Braun
6b05b65d4e tools: changeset analyzer: Add --add-test flag
This allows forcing tests into the test list from the outside, via
command line arguments. Tests passed in via --add-test will always be
part of the test list, regardless of the actual changeset.
2025-03-06 19:20:24 +01:00
Martin Braun
ec29ff397b tools: changeset_testlist: Allow removing test patterns
This adds a new argument to changeset_testlist.py:

    python3 changeset_testlist.py --remove-test "^hw" fpga.usrp3.e320

...would remove all tests that start with "hw", and fpga.usrp3.e320.
2025-03-03 14:38:31 +01:00
Martin Braun
f8a87d3c7e tools: Apply linter issues changeset_testlist.py 2025-03-03 14:38:31 +01:00
Martin Braun
5c897830c0 tools: changeset analyzer: Gracefully recover fail to get labels 2025-02-25 11:29:54 +01:00
Martin Braun
48e41a8678 tools: changeset_testlist.py skips comments
If a changeset includes only comments in a C++ or Python file, then the
corresponding tests are not triggered. This is achieved by a new rule
`include_content`, which checks the changeset for code and/or content
changes.

The values of the include_content argument have the following meaning:
- 'code': at least one line with code changed
- 'code-only': all changed lines must be code changes
- 'comments': at least one line with comments changed
- 'comments-only': all changed lines must be comment changes
- 'code-and-comments': either code or comments changes (always True)

Co-authored-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
2024-11-28 14:58:03 +01:00
Martin Braun
aeff51b599 ci/tools: Update changeset analyzer tool
- Add feature to read labels from github PR
- Match Python coding guidelines
- Update rule list to skip certain tests if Github labels say so
2024-10-09 23:32:50 +02:00
Matthew Crymble
29e45f7a95 ci: replace deprecated ruamel.yaml methods 2023-10-24 12:51:42 -05:00
Martin Braun
3b5f89ee72 tools: Add changeset analyzer
This tool compares two git branches of UHD and produces a list of tests
required to verify the changeset. The intended use case is to be able to
verify branches that are being created for pull requests.

For example, say a pull requests is based on a branch that only modifies
files in host/lib/usrp/x300. Then it is only necessary to run hardware
tests on X300, running tests on other USRPs would be a waste of time.

This commit contains two files: The utility itself (a Python script),
and a rule file (a YAML file). The former uses the latter to map
a changeset to a list of tests.
2023-07-14 13:38:44 -05:00