intake-test-failure
This skill converts raw, unstructured, or varied failure reports into a standardized Normalized Failure Payload ready for consumption by the test-fixer subagent or developer remediation workflow.
Prerequisites
gcloudCLI installed and authenticated with access togs://nightly-test-dataor target GCS log buckets (requiresroles/storage.objectViewerpermission). If permission or authentication fails when runninggcloud storage, verify login viagcloud auth login.ghCLI installed (optional, for querying GitHub issues).
Input Formats Handled
- GitHub Issue URL (e.g.,
https://github.com/hashicorp/terraform-provider-google/issues/28244) - Direct Text Prompt (Test name, error message, and optional log snippet/URL)
- GCS / Remote Log URL (e.g.,
https://storage.googleapis.com/...orgs://...) - Local Log File (e.g.,
test_output.logor debug log file)
Execution Steps
Step 1: Extract Core Failure Information
Path A: GitHub Issue URL
- Use
read_url_content(orgh issue viewif CLI available) to read the issue content and inspect its GitHub labels. - Check if labels contain
test-failure,test-failure-100,test-failure-50, or any similartest-failure*labels to confirm this is an acceptance test failure issue. - Determine Target Provider Version (
ga,beta, orboth):- Inspect the issue
Failure ratessection:- If GA failure rate > 0% and Beta == 0%, set
target_provider: "ga". - If Beta failure rate > 0% and GA == 0%, set
target_provider: "beta". - If both GA and Beta failure rates > 0%, set
target_provider: "both".
- If GA failure rate > 0% and Beta == 0%, set
- Match provider-specific GCS error message links in the issue body:
ga error message(e.g..../test-errors/ga/.../*.txt)beta error message(e.g..../test-errors/beta/.../*.txt)
- Fetch the complete content of each failing provider's error text file using
gcloud storage catto populateerror_message(if a GCS permission or authentication failure occurs, immediately report remediation instructions to checkgcloud auth loginandroles/storage.objectVieweraccess, and abort execution).
- Inspect the issue
- Distinguish between Error Message Links and Debug Log Links in the issue body:
- Error Message Links: Contain the exact
go testoutput, backtraces, andstdoutplan diffs for GA and/or Beta runs. - Debug Log Links: Contain the full
TF_LOG=DEBUGprovider trace (ga debug log/beta debug log). Fetch and process viatf_debug_parser.pyforparsed_logs_dir.
- Error Message Links: Contain the exact
- Search the issue body or fetched error log file for:
- Impacted acceptance test name (e.g.,
TestAcc<Resource>_<Scenario>). - Full error text, backtrace, and
stdoutplan diff.
- Impacted acceptance test name (e.g.,
Path B: Direct Prompt / Text Entry
- Extract
test_name,target_provider(ga,beta, orboth), and fullerror_messagedirectly from user input. - Extract any GCS or local log paths provided.
Path C: Remote / GCS Log URLs
- Convert HTTPS GCS URLs (
https://storage.cloud.google.com/<bucket>/<path>orhttps://storage.googleapis.com/<bucket>/<path>) togs://<bucket>/<path>. - For Error Log links, fetch the content using
gcloud storage cat:
Store the complete output ingcloud storage cat gs://<bucket>/<path>error_message. - For Debug Log links, copy the file locally for parsing instead of printing to stdout:
mkdir -p debug_output && gcloud storage cp gs://<bucket>/<path> debug_output/raw_test.log - Error Handling: If
gcloud storage catorgcloud storage cpfails with a permission or authentication error (permission denied,401,403), immediately output an error message instructing the user to checkgcloud auth loginand ensureroles/storage.objectVieweraccess to the GCS bucket, and abort execution.
Step 2: Log Parsing (If Debug Log Available)
If a debug log (local or GCS) is present:
- Run the
parse-debug-logsskill:python3 .agents/scripts/tf_debug_parser.py <path_to_log> --extract-dir debug_output/<test_name> - Inspect
debug_output/<test_name>/outline.txtto capture relevant API HTTP request/response JSON file paths.
Step 3: Produce Complete Normalized Failure Payload
Assemble and present the normalized payload in the following format. CRITICAL: Include target_provider (ga, beta, or both) and do NOT truncate multi-line error output, assertion backtraces, or stdout plan diffs. Use a multi-line YAML block scalar (|) to preserve full error context:
normalized_failure_payload:
test_name: "<ExactTestFunctionName>"
target_provider: "ga" # "ga", "beta", or "both"
error_message: |
<Full error output, go test backtrace, and stdout plan diff for GA and/or Beta>
parsed_logs_dir: "debug_output/<test_name>/" # Optional
Next Step & Handoff
Pass the Normalized Failure Payload to the test-fixer subagent (.agents/agents/test-fixer/) to initiate automated diagnosis and remediation.