Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twister: extend reason field in Twister reports #85393

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

gchwier
Copy link
Collaborator

@gchwier gchwier commented Feb 7, 2025

Extended the reason field in Twister report to include more detailed information for 'Build failure' and
'CMake build failure'
Added parsing of specific error keys from logs to provide clearer context in the reports.

Requested here: https://discord.com/channels/720317445772017664/733037890514321419/1337400203019550786

To test you can modify hello_world sample, e.g.:

  • add unused variable to main.c, to have build error
  • add test configuration with wrong Kconfig to have Cmake error
  sample.cmake_err.helloworld:
    extra_args:
      - CONFIG_LOG="blah"

and run:
$ZEPHYR_BASE/scripts/twister -vv -T samples/hello_world -p native_sim -ll debug
then you will find more details in reason field in twister.json (and in message field in junit reports).

nashif
nashif previously approved these changes Feb 7, 2025
nashif
nashif previously approved these changes Feb 9, 2025
hakehuang
hakehuang previously approved these changes Feb 10, 2025
Extended the reason field in Twister report to include
more detailed information for 'Build failure' and
'CMake build failure'

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Updated test_report_summary to match new string with detailed
reason of build failure.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
After adding more detailed information to the reason field in
Twister report, update twister_report_analyzer.py to group
CMake and Build failures.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
@gchwier gchwier force-pushed the grch-twister-extend-reason branch from 80f2790 to 46651b7 Compare February 11, 2025 12:33
Copy link
Member

@PerMac PerMac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just one remark. This introduces some code duplication: the same analysis is in twister and twister_report_analyzer.py script. I don't mind it for now since such functionality is very new and we don't know yet how it will be used later on. To remove code duplication in future twister could e.g. import the analysis method from the analyzer script.

@kartben kartben merged commit 145b1b9 into zephyrproject-rtos:main Feb 13, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants