Add expected results for verifiable steps in the test-plan-generator agent - #6450
Open
jpangas wants to merge 3 commits into
Open
Add expected results for verifiable steps in the test-plan-generator agent#6450jpangas wants to merge 3 commits into
test-plan-generator agent#6450jpangas wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the test-plan-generator → TestRail submission pipeline to support step-indexed expected results, so verification steps can populate TestRail’s “Expected” column while non-verification steps remain blank.
Changes:
- Add
step_expectationsto generated test case schemas and enforce “at least one verification expectation” validation. - Map
step_expectationsinto TestRailcustom_steps_separated[].expectedvia a new_separated_steps()helper. - Extend unit tests and update the agent system prompt to instruct how to populate expectations.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/hackbot-runtime/tests/test_testrail_handler.py | Updates plan fixtures and asserts expectations are mapped into custom_steps_separated.expected; adds _separated_steps unit tests. |
| libs/hackbot-runtime/tests/test_testrail_action.py | Adds step_expectations to action input tests and validates rejection of cases with no non-blank expectation. |
| libs/hackbot-runtime/hackbot_runtime/actions/testrail.py | Extends action input schema with step_expectations and validates that at least one expectation is present. |
| libs/hackbot-runtime/hackbot_runtime/actions/handlers/testrail_handler.py | Uses _separated_steps() to build TestRail payloads with per-step expected results. |
| agents/test-plan-generator/hackbot_agents/test_plan_generator/result.py | Extends generated-case result schema with step_expectations and validates expectations exist. |
| agents/test-plan-generator/hackbot_agents/test_plan_generator/prompts/system.md | Instructs the agent to include expectations only for verification steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+61
to
+65
| @model_validator(mode="after") | ||
| def expectations_must_include_verification(self) -> "TestRailCaseInput": | ||
| if not any(self.step_expectations): | ||
| raise ValueError("at least one step must include an expected result") | ||
| return self |
Comment on lines
+43
to
+47
| if not any(self.step_expectations): | ||
| raise ValueError( | ||
| "each generated test case must include an expected result on at " | ||
| "least one verification step" | ||
| ) |
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.
Fixes #6432
This pull request introduces significant improvements to how test case steps and their expected results are handled and validated throughout the test plan generation and submission process.