Repository navigation
Cherry-pick #418: Fail fast on test parameters the SDK test runner does not accept - #422
Merged
rquidute merged 6 commits intoNov 23, 2026
Conversation
Test parameters are forwarded as --<name> <value> to test_harness_client.py. A mistyped one (e.g. --prompt_timeout) only failed when the runner was first invoked, in the middle of the run, with the reason visible only in the Python test log. At the start of the Python test suite setup, read the runner's options from its --help (no side effects, never stale) and end the run with a clear message, before any DUT interaction, if a test parameter is unknown. If the options cannot be read the check is skipped. Related to #1215
Cache the options the SDK test runner accepts (read from its --help) whenever the Python test files are generated, in sdk_tests/runner_options.json. The test run create (/cli) and start endpoints use it to answer 422 with the offending parameter, so a mistyped one no longer creates a run, starts a container and cancels every step. The suite-setup check stays as a fallback for when the cache is unavailable. An unreadable or malformed cache means "do not validate", and a failed refresh drops the old cache so a previous SDK version's list is never used. Related to #1215
MagicMock(spec=SDKContainer) created in parametrize raised AttributeError while importing test_utils.py, breaking collection of the whole module.
The backend should not know the options of one client. Drop the th-cli run-tests hint and instead make the 'did you mean' suggestion stricter (cutoff 0.8): the default suggested the unrelated --timeout for --prompt-timeout and --tests for --tests-list. Real typos still get a suggestion. Related to #1215
- Do not fail the suite setup when the --help probe raises, and drop the redundant warning when the options are unavailable (already logged). - Reject ambiguous option abbreviations like argparse does: an exact name is accepted, otherwise it must abbreviate exactly one option. - Do not abort test file generation when the options cache cannot be written or deleted; empty it instead so a stale list is never used. Related to #1215
The error is shown in a terminal by th-cli, where a single long line is hard to read. Related to #1215
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
This pull request is merged. |
antonio-amjr
approved these changes
Nov 23, 2026
rquidute
deleted the
fix/1215-validate-test-parameters-preflight-v2.17
branch
November 23, 2026 13:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-pick of #418 onto
v2.17-develop. The original PR is not merged yet; this branch will need updating if review changes it.Closes #1215 together with the CLI cherry-pick (certification-tool-cli#145).
A mistyped test parameter (e.g.
--prompt_timeoutinstead of--prompt-timeout) only failed when the SDK runner was first invoked, in the middle of the run. Now:--helpwhen the Python test files are generated, and cached insdk_tests/runner_options.json(git-ignored).POST /test_run_executions/cliand/{id}/startanswer 422 with the offending parameter, so no run is created.Full description and review discussion: #418.
Conflict resolutions (v2.17-develop differs from v2.16-develop)
tests/python_tests/test_utils.py: kept v2.17's file (it already has the native-log tests) and appended the validation tests.python_testing/models/utils.py: kept v2.17'sre/datetimeimports and added only the new functions.python_testing/test_manager.py: kept v2.17's_generate_all_test_files(script_errors)signature and added the_refresh_runner_optionscall after the container starts.The six commits are otherwise unchanged. Every file added by the original PR is identical to it.
Tests
Same tests as #418. Not run locally (backend dependencies unavailable where this was prepared); please rely on CI.