Records an automated test result in Spira.
Maps to Spira API: POST /projects/{product_id}/test-runs/record
Use this to push automated test results from CI/CD pipelines into Spira for quality tracking.
Args:
product_id: The numeric ID of the product (e.g., 55 for PR:55). If omitted, uses SPIRA_PROJECT_ID from environment.
test_name: The name of the test being run
short_message: Brief result description (50 chars or less)
long_message: Full test outcome description in plain text
error_count: Number of errors during test (0 if none)
test_case_id: Test case ID without TC prefix (e.g., 12 for TC:12)
execution_status_id: Status (1=Failed, 2=Passed, 3=Not Run, 4=N/A, 5=Blocked, 6=Caution)
Returns:
JSON: {"test_run_id": "TR:123", "message": "Test run recorded successfully"}
Error Responses:
Returns structured JSON with error, error_code, details, and suggestion.
Common error codes: INVALID_PARAMETER, API_ERROR, NOT_FOUND
Example Usage:
result = record_automated_test_run(
product_id=55, test_name="test_login", short_message="Passed",
long_message="Login successful", error_count=0, test_case_id=123, execution_status_id=2
)