Skip to content

Test that a backend 422 for an invalid execution config is reported - #146

Merged
rquidute merged 1 commit into
project-chip:v2.17-cli-developfrom
rquidute:fix/1210-validate-cli-execution-config-v2.17
Nov 24, 2026
Merged

rquidute merged 1 commit into
project-chip:v2.17-cli-developfrom
rquidute:fix/1210-validate-cli-execution-config-v2.17

Conversation

@rquidute

Copy link
Copy Markdown
Contributor

Closes #1210

The backend now rejects an invalid execution_config with 422 before any run is created (see the paired backend PR). The CLI already converts that response into an APIError via handle_api_error, so no code change is needed.

This adds a regression test that a 422 from create_cli_test_run_execution surfaces as an APIError with the backend's message, so no test is started.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test module imports _create_new_test_run_cli and APIError. A new async test simulates a backend 422 response during CLI test-run creation. It asserts that the call raises APIError with status 422 and a formatted message containing the backend’s “invalid properties” detail.

Suggested reviewers: antonio-amjr

Merge Risk: Minimal · up to 6411e

This PR adds test coverage for how the CLI reports a backend 422 rejection and changes no runtime behavior. It carries no actionable merge risk.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Linked issue #1210 is the only active direct target. Its coding requirements are: (1) backend validation of execution_config with 422 and no execution created; (2) a CLI-side clear error before test s… Provide evidence for the following, then reassess: (a) the paired backend PR, or merged backend code, that validates execution_config with the project config model and returns 422 without creating an execution; (b) the handle_api_error impl…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the change accurately. The PR adds a regression test that a backend 422 for an invalid execution config surfaces as an APIError, which matches the raw summary and the PR objectives. It…
Description check Passed The description relates directly to the changeset. It links issue #1210, explains that the backend now returns 422 for an invalid execution_config, and states that the PR adds a regression test that a…
Out of Scope Changes check Passed The only change is a regression test in tests/test_run_tests.py. Per the raw summary, it adds imports of _create_new_test_run_cli and APIError and one async test. That test checks that a backend 422 f…
Full details: Title check

Explanation

The title names the change accurately. The PR adds a regression test that a backend 422 for an invalid execution config surfaces as an APIError, which matches the raw summary and the PR objectives. It is specific and descriptive. The title says 'Test' and not the issue's CLIError framing, but this matches the actual scope of the PR.

Full details: Description check

Explanation

The description relates directly to the changeset. It links issue #1210, explains that the backend now returns 422 for an invalid execution_config, and states that the PR adds a regression test that a 422 from create_cli_test_run_execution surfaces as an APIError. This matches the raw summary.

Full details: Out of Scope Changes check

Explanation

The only change is a regression test in tests/test_run_tests.py. Per the raw summary, it adds imports of _create_new_test_run_cli and APIError and one async test. That test checks that a backend 422 for an invalid execution configuration becomes an APIError with the backend detail. This change directly supports #1210's CLI test requirement. It does not modify production code, and it does not touch the project-edit scope of #1094. The whole-PR diff could not be read, so the file list and the raw summary are the evidence used here.

Full details: Linked Issues check

Explanation

Linked issue #1210 is the only active direct target. Its coding requirements are: (1) backend validation of execution_config with 422 and no execution created; (2) a CLI-side clear error before test startup; (3) tests for valid, invalid, and absent configs, plus a CLI test that a 422 is reported as a clear error. Requirement (1) is in the backend code, which this PR does not change. The PR states that backend work is in a paired backend PR. That PR is not in this review, so requirement (1) cannot be verified here. For requirement (2), the PR relies on existing handling: create_cli_test_run_execution's 422 is converted to APIError by handle_api_error. The issue asks for CLIError, while the PR tests APIError. The reviewed head has no visible change to the handling path. I could not read th_cli/exceptions.py or the new test body in full, because the tool output was truncated. So I cannot confirm that the user sees the backend message before any run starts. The only code change is a regression test in tests/test_run_tests.py. Per the raw summary, it asserts APIError with status 422 and the backend 'invalid properties' detail.

Resolution

Provide evidence for the following, then reassess: (a) the paired backend PR, or merged backend code, that validates execution_config with the project config model and returns 422 without creating an execution; (b) the handle_api_error implementation and the run_tests error path, showing that the APIError message is shown to the user before test startup; (c) confirmation from the issue owner that APIError is acceptable in place of the CLIError named in #1210, or a change to raise CLIError.

  • 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

Recent review info

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: 9896ff7a-f644-43af-98e7-aa0a2c38f165
Commits

Reviewing files that changed from the base of the PR and between a8c7641 and 6411e00.

Files selected for processing: 1

  • tests/test_run_tests.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@mergify

mergify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@rquidute rquidute self-assigned this Nov 24, 2026
@rquidute
rquidute merged commit 4fbbdb5 into project-chip:v2.17-cli-develop Nov 24, 2026
6 checks passed
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