Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Turn API Tests Into Useful CI Receipts

Description and use

Generate structured API test receipts that capture run ID, request/response details, fixture ownership, and cleanup status, turning noisy CI logs into quick‑replay debugging artifacts.

Problem

API tests that only report status codes leave developers guessing what happened during a run, especially when retries or external state are involved.

Outcome

Receipts transform noisy CI logs into compact, replayable debugging artifacts, reducing time to identify failures caused by retries, external state, or fixture mismatches.

Workflow

  • Generate a unique run_id combining GitHub run number and attempt
  • Pass run_id to test process via environment variable
  • Include run_id in API request headers (e.g., X-Test-Run)
  • Execute API test and capture receipt fields in a finally block
  • Write receipt JSON to a predefined directory
  • Upload receipt as a GitHub Actions artifact with if: always()
  • Optionally validate receipt schema and redact sensitive data
  • Print a concise summary in the job output
  • Keep receipts short‑lived and compare across retries

Evidence

A receipt records the request identity, the response evidence, the relevant fixture, and the cleanup result.

Source

The workflow should always upload the receipt, including on failure.

Source

  • Record date: 2026-09-21T18:00:21.010Z