Guide

CI Reporter Integration

Automatically publish test results from your CI pipeline to TestOps using framework-specific reporters. See results, coverage, and trends directly in your TestOps dashboard.

Overview

TestOps provides reporter packages that plug into your existing test frameworks. When your CI pipeline runs tests, the reporter automatically streams results to TestOps in real time. No changes to your test code are required — just add the reporter to your framework configuration.

Available reporters:

  • @calimatic-testops/jest-reporter — For Jest 27+

Prerequisites

  1. A TestOps account with at least one project created. Go to Getting Started if you have not set this up yet.
  2. A CLI Token for authentication. Generate one from Settings > CLI Tokens in the TestOps dashboard.
  3. Your project slug (visible on the project settings page).

Installation

Install the reporter as a dev dependency in your project:

npm install --save-dev @calimatic-testops/jest-reporter

Configuration

Add the reporter to your Jest configuration. The reporter requires three environment variables and accepts optional inline options.

Environment Variables (required)

TESTOPS_URL=https://testops.calimatic.com TESTOPS_TOKEN=ttok_your_token_here TESTOPS_PROJECT=your-project-slug

Set these in your CI environment (GitHub Actions secrets, GitLab CI variables, etc.). The reporter silently disables itself when these are missing, so local test runs are unaffected.

Jest Configuration

Add the reporter to your jest.config.js or jest.config.ts:

module.exports = { reporters: [ 'default', ['@calimatic-testops/jest-reporter', { launchName: 'Unit Tests', layers: ['unit'], }], ], };

Setting Test Layers

The layers option controls what appears in the Layers column on the TestOps dashboard. Set it to match the type of tests the configuration runs. Common values:

unitUnit tests
integrationIntegration tests
e2eEnd-to-end tests
smokeSmoke tests
systemSystem tests
contractsContract tests
functionalFunctional tests
regressionRegression tests

If your project has separate Jest configurations for different test types, set the layer accordingly in each:

// jest.config.unit.js layers: ['unit'] // jest.config.integration.js layers: ['integration'] // jest.config.e2e.js layers: ['e2e']

You can also pass multiple layers if a single config runs mixed test types:

layers: ['unit', 'integration']

Alternatively, set layers via the TESTOPS_LAYERS environment variable (comma-separated):

TESTOPS_LAYERS=unit,integration

All Reporter Options

OptionTypeDefaultDescription
urlstringTESTOPS_URL envTestOps server URL
tokenstringTESTOPS_TOKEN envAPI token
projectstringTESTOPS_PROJECT envProject slug
layersstring[]TESTOPS_LAYERS envTest layers shown in dashboard
sourcestring"jest-reporter"Source identifier
launchNamestring"Jest Run"Name shown in dashboard
attributesobjectundefinedExtra metadata attached to the launch
flushSizenumber100Batch size for result uploads
silentbooleantrueSilently disable when config is missing

All Environment Variables

VariableDescription
TESTOPS_URLTestOps server URL (required)
TESTOPS_TOKENAPI token from Settings > CLI Tokens (required)
TESTOPS_PROJECTProject slug (required)
TESTOPS_LAYERSComma-separated test layers, e.g. "unit,integration"
TESTOPS_SOURCESource identifier override
TESTOPS_ENVIRONMENTEnvironment name (e.g. "staging", "ci")
TESTOPS_CORRELATION_IDGroup multiple suites under one logical run

GitHub Actions Example

A complete workflow that runs unit and integration tests as separate jobs, each reporting to TestOps with the correct layer:

# .github/workflows/tests.yml name: Tests on: [push, pull_request] jobs: unit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: 20 } - run: npm ci - run: npx jest --config jest.config.unit.js env: TESTOPS_URL: ${{ secrets.TESTOPS_URL }} TESTOPS_TOKEN: ${{ secrets.TESTOPS_TOKEN }} TESTOPS_PROJECT: ${{ secrets.TESTOPS_PROJECT }} integration: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: 20 } - run: npm ci - run: npx jest --config jest.config.integration.js env: TESTOPS_URL: ${{ secrets.TESTOPS_URL }} TESTOPS_TOKEN: ${{ secrets.TESTOPS_TOKEN }} TESTOPS_PROJECT: ${{ secrets.TESTOPS_PROJECT }}

Grouping Suites with Correlation IDs

When multiple test suites (unit, integration, e2e) run in the same CI pipeline, pass the same TESTOPS_CORRELATION_ID to group them under a single combined report in TestOps.

On GitHub Actions this is auto-detected from the run ID. On other CI providers, set it explicitly:

TESTOPS_CORRELATION_ID=$CI_PIPELINE_ID