Skip to content

feat: add cxtm.yaml support for enriching issue bodies with test case definitions#34

Draft
ChristopherJHart wants to merge 1 commit intomasterfrom
feat/cxtm-yaml-test-case-extraction
Draft

feat: add cxtm.yaml support for enriching issue bodies with test case definitions#34
ChristopherJHart wants to merge 1 commit intomasterfrom
feat/cxtm-yaml-test-case-extraction

Conversation

@ChristopherJHart
Copy link
Collaborator

Summary

  • Add --cxtm-file option to process-test-requirements command
  • Extract test case metadata (title, robot_file, git_commit_sha) from cxtm.yaml
  • Embed structured test case definitions in GitHub issue bodies

Problem

When the tac-agent-worker processes PRs, it needs the test case identifier/title to pass to the Claude agent. Previously, this data was extracted from manually-written YAML in the project issue body, which could be missing or inconsistent (e.g., PR #2732 where the branch name was incorrectly used as the test case identifier).

Solution

This PR enables github-ops-manager to read from cxtm.yaml (the authoritative source for test case definitions) and embed the structured test case metadata directly into the issue body:

## Test Case Definition

test_case_group:
  name: "Verify Module Serial Number on NX-OS devices"
test_case:
  identifier: "0"
  title: "Verify Module Serial Number on NX-OS devices"
  robot_file: "catalog/NX-OS/verify_nxos_module_serial_number.robot"
  git_url: "https://wwwin-github.cisco.com/Testing-as-Code/tac-catalog"
  git_commit_sha: "feat/nx-os/add-verify-nxos-module-serial-number"

Changes

  • New file: github_ops_manager/utils/cxtm.py - cxtm.yaml parsing utilities
  • schemas/tac.py: Added CXTMTestCase, CXTMTestCaseGroup, CXTMConfiguration models
  • configuration/cli.py: Added --cxtm-file option to process-test-requirements
  • synchronize/test_requirements.py: Integrated cxtm.yaml lookup when rendering issue bodies
  • templates/tac_issues_body.j2: Added "Test Case Definition" section

Usage

github-ops-manager repo ... process-test-requirements ./test_cases \
  --base-directory ./workspace/jobfiles \
  --cxtm-file ./cxtm.yaml

Pipeline Integration

The Google project Jenkinsfile has been updated to:

  1. Run tac-tools synchronizer expand BEFORE process-test-requirements (so cxtm.yaml is populated)
  2. Pass --cxtm-file ./cxtm.yaml to the command

Test plan

  • Run unit tests (uv run pytest tests/unit/)
  • Test with Google project pipeline
  • Verify issue bodies contain test case definitions
  • Verify tac-agent-worker can parse the new issue format

🤖 Generated with Claude Code

… definitions

Add --cxtm-file option to process-test-requirements command that extracts
test case metadata (title, robot_file, git_commit_sha, etc.) from cxtm.yaml
and embeds it as a structured YAML block in the GitHub issue body.

This enables downstream systems (like tac-agent-worker) to reliably extract
test case identifiers and robot file paths from the issue, rather than
relying on manually-written YAML in the test requirement definition.

Changes:
- Add CXTMConfiguration, CXTMTestCaseGroup, CXTMTestCase models
- Add utils/cxtm.py with load/find/format functions
- Add --cxtm-file CLI option to process-test-requirements
- Update issue template with "Test Case Definition" section
- Integrate cxtm lookup in render_issue_body_for_test_case()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant