You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test that a backend 422 for an invalid execution config is reported - #146
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.
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: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
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 checks: 3 passed
Check name
Status
Explanation
Title check
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
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
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.
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.
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
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.
Closes #1210
The backend now rejects an invalid
execution_configwith422before any run is created (see the paired backend PR). The CLI already converts that response into anAPIErrorviahandle_api_error, so no code change is needed.This adds a regression test that a 422 from
create_cli_test_run_executionsurfaces as anAPIErrorwith the backend's message, so no test is started.