Skip to content

twsiter: binary handler: pass verbose setting to west call #91131

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hakehuang
Copy link
Contributor

  1. pass verbose setting to west call.
  2. refactor the runner setting code.

@github-actions github-actions bot added the area: Twister Twister label Jun 5, 2025
@hakehuang hakehuang force-pushed the verbose_west_flash branch 4 times, most recently from 5f4c0ac to 4de9170 Compare June 5, 2025 14:51
1. pass verbose setting to west call.
2. refactor the runner setting code.

Signed-off-by: Hake Huang <hake.huang@nxp.com>
@hakehuang hakehuang force-pushed the verbose_west_flash branch from 4de9170 to 97b48a9 Compare June 5, 2025 14:58
Copy link

sonarqubecloud bot commented Jun 5, 2025

@hakehuang
Copy link
Contributor Author

@gchwier @golowanow @anasnashif please help to review, Thanks

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.

Please address the verbosity level. I am not convinced the refactoring helps, but I won't block on this.

Comment on lines +550 to +551
if self.options.verbose > 0:
command.append(f"-{'v'*self.options.verbose}")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of sharing verbosity parameter between twister ang west. Twister uses verbosity level e.g. to print summary, so I keep it always in my command. And I do not want to see a bunch of debug logs from west in the output. Adding new parameter to Twister just to pass it to west is also not good solution, as we have too much of them already. What about passing verbosity only when it is greater than 2?

            if self.options.verbose > 2:
                command.append(f"-{'v' * (self.options.verbose - 2)}")

# Handle standard runners from the mapping
elif runner in runner_extra_args_config:
command_extra_args.extend(runner_extra_args_config[runner])

Copy link
Contributor

@gchwier gchwier Jul 25, 2025

Choose a reason for hiding this comment

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

I'm not sure if such a refactoring simplifies the code or if it is more readable. I agree to extract "openocd" to one elif. If you want to keep common settings in runner_extra_args_config, why you missed "jlink" and "linkserver"? And please remember, that there is also one location with the same code in pytest-twister-harness: https://github.com/zephyrproject-rtos/zephyr/blob/main/scripts/pylib/pytest-twister-harness/src/twister_harness/device/hardware_adapter.py#L64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants