CI/CD Test Automation Ingestion
Klority provides a native REST API to ingest execution results directly from your CI/CD pipelines. Connect your Playwright, Cypress, Jest, PyTest, or JUnit suites to Klority in minutes with a single cURL command.
Why Ingest CI/CD Results into Klority?
- Single Source of Truth: Manual and automated test results live in the same project dashboard.
- Automated Test Cycles: Every CI pipeline execution creates a clean, timestamped Test Cycle.
- Stack Trace Capture: Failing assertions and stack traces are preserved for immediate review.
- AI Root Cause Diagnostics: One-click Amazon Bedrock AI failure analysis and auto-filing of bug tickets.
- Requirements Traceability: Automated runs update the live Traceability Matrix in real-time.
1. Generate a Project API Token
To authenticate requests from your CI/CD runners, generate a Personal Access Token in Klority:
- Open your project in Klority (e.g.
https://app.klority.com/projects/WEB/settings). - Navigate to Project Settings → Access Tokens.
- Click Generate New Token, provide a descriptive name (e.g.
github-actions-ci), and copy the generated token starting withklor_pat_.... - Save this token as a secret in your repository (e.g.
KLORITY_API_TOKENin GitHub Secrets).
API Token Security
2. Ingest Endpoint Specification
Klority accepts JUnit XML reports via HTTP POST:
# Headers:
Authorization: Bearer klor_pat_...
Content-Type: application/xml (or multipart/form-data)
cURL Example (Raw XML)
-H "Authorization: Bearer $KLORITY_API_TOKEN" \
-H "Content-Type: application/xml" \
--data-binary @results.xml
cURL Example (Multipart File Upload)
-H "Authorization: Bearer $KLORITY_API_TOKEN" \
-F "file=@cypress/results/junit.xml"
3. Framework Configuration Guides
Playwright
Configure Playwright to generate standard JUnit XML output in playwright.config.ts:
reporter: [['junit', { outputFile: 'results.xml' }], ['html']],
});
Or pass it directly in the command line: npx playwright test --reporter=junit:results.xml
Cypress
Install the JUnit reporter: npm install -D mocha-junit-reporter
Add to cypress.config.ts:
reporter: 'mocha-junit-reporter',
reporterOptions: {
mochaFile: 'results.xml',
toConsole: true
}
});
Jest / Vitest
Install jest-junit: npm install -D jest-junit
Run your suite with output configuration:
PyTest (Python)
PyTest includes native JUnit XML reporting out of the box:
4. GitHub Actions CI/CD Workflow
Add this ready-to-use step to your .github/workflows/test.yml file:
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npx playwright test --reporter=junit:results.xml
continue-on-error: true # Ensure reporting step runs even on test failures
- name: Ingest Results to Klority QA
if: always()
run: |
curl -X POST "https://api.klority.com/api/projects/YOUR_PROJECT_KEY/test-runs/ingest-junit" \
-H "Authorization: Bearer ${{ secrets.KLORITY_API_TOKEN }}" \
-H "Content-Type: application/xml" \
--data-binary @results.xml
5. Inspecting Ingested Results in Klority
Once ingested:
- Navigate to Projects → Test Hub → Test Cycles.
- You will see a newly created cycle named
Automated Run (<timestamp>). - Click Report to view the visual pass/fail breakdown, duration, and error logs.
- Click any failed test case and hit "AI Auto-Diagnose Bug" to let Amazon Bedrock draft complete reproduction steps and log the defect directly into your sprint backlog or Linear!