Skip to content

Cherry-pick #144: run-tests rejects unknown options before the -- separator - #145

Merged
rquidute merged 5 commits into
project-chip:v2.17-cli-developfrom
rquidute:fix/1215-cli-reject-unknown-options-v2.17
Nov 23, 2026
Merged

rquidute merged 5 commits into
project-chip:v2.17-cli-developfrom
rquidute:fix/1215-cli-reject-unknown-options-v2.17

Conversation

@rquidute

Copy link
Copy Markdown
Contributor

Summary

Cherry-pick of #144 onto v2.17-cli-develop. The original PR is not merged yet; this branch will need updating if review changes it.

Closes #1215 together with the backend cherry-pick certification-tool-backend#422.

th-cli run-tests silently accepted any unknown option and forwarded it to the Python test runner, so a typo such as --prompt_timeout only failed deep inside the run.

  • Options before -- are parsed strictly: unknown ones fail with No such option and a suggestion.
  • A run-tests option placed after -- (e.g. -- --prompt-timeout 5) fails with a hint to pass it before the separator.
  • Suite-level errors from the backend are now printed, once each.
  • Multi-line API and suite errors are shown on separate lines.

Full description and review discussion: #144.

Conflicts

None; the five commits applied cleanly. On this branch the same 5 tests fail as on the untouched v2.17-cli-develop (config-file related, unrelated to this change); everything else passes.

Behaviour change

Passing test parameters without -- (e.g. run-tests -t X --int-arg PIXIT.X:1) now errors. The help text and docs describe only the -- form.

run-tests accepted any unknown option and forwarded it to the Python
test runner as an extra test parameter, so a typo such as
--prompt_timeout (instead of --prompt-timeout) only failed inside the
SDK container, with the error visible only in the backend logs.

Parse options before a literal -- strictly, so unknown options fail
with "No such option" and a suggestion. Arguments after -- are still
forwarded as test parameters.

Closes #1215
Suite updates carry an errors list (e.g. a failed suite setup), but the CLI
only printed the suite title and state, so the reason was visible only in the
backend log. Print each suite error once.

Related to #1215
Everything after -- is passed to the test runner, so an option of run-tests
itself there (e.g. -- --prompt-timeout 5, or the --prompt_timeout typo) was
either rejected by the runner deep inside the run or silently ignored. Fail
up front and tell the user to pass it before the separator. The option names
come from the command definition, so they cannot drift.

Related to #1215
A long error glued to the header with ' - ' is hard to read. Put multi-line
API error content below the header, and indent every line of a multi-line
suite error.

Related to #1215
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b742fe51-cff3-46b9-9047-4f4354188b48

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@mergify

mergify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@rquidute rquidute self-assigned this Nov 23, 2026
@rquidute
rquidute merged commit a8c7641 into project-chip:v2.17-cli-develop Nov 23, 2026
6 checks passed
@rquidute
rquidute deleted the fix/1215-cli-reject-unknown-options-v2.17 branch November 23, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants