Skip to content

Add expected results for verifiable steps in the test-plan-generator agent - #6450

Open
jpangas wants to merge 3 commits into
mozilla:masterfrom
jpangas:add_expected
Open

Add expected results for verifiable steps in the test-plan-generator agent#6450
jpangas wants to merge 3 commits into
mozilla:masterfrom
jpangas:add_expected

Conversation

@jpangas

@jpangas jpangas commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

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.

Copilot AI review requested due to automatic review settings August 2, 2026 08:11
@jpangas
jpangas requested a review from a team as a code owner August 2, 2026 08:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_expectations to generated test case schemas and enforce “at least one verification expectation” validation.
  • Map step_expectations into TestRail custom_steps_separated[].expected via 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"
)
Comment thread agents/test-plan-generator/hackbot_agents/test_plan_generator/prompts/system.md Outdated
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.

Generate test cases in test rail with test steps in the field on the left and expectations in the field on the right

2 participants