Skip to main content
Use these recipes to send run results outside Momentic: a JSON or JUnit file for CI tooling, New Relic events for dashboards, or a self-hosted result viewer.

Export run results as JSON

Use the json reporter when you need a local, machine-readable report after a run finishes.

1. Run with the JSON reporter

The command writes reports/checkout.momentic.json. Filenames derive from --name, or from the project name when --name is omitted. You can combine the JSON reporter with other reporters:

2. Read the report

reports/checkout.momentic.json
The public JSON schema is available at https://schemas.momentic.ai/momentic-json-report.schema.json.

Custom outputs and JUnit reports

Declare outputs in a test to capture environment variables or templated values at the end of a run. These values are part of the run result. The current JUnit reporter emits test metadata, timing, and status; it does not include custom outputs as a testOutputs property.

1. Declare outputs

output-to-junit.test.yaml

2. Run with the JUnit reporter

3. Read the report

The report includes properties such as the test id, base_url, and run_url, along with retry counts and timestamps. For example:
PLAN_OUTPUT is not included in this XML. If another tool needs custom outputs in JUnit, add them in your own report-processing step.

Push run results to New Relic

The newrelic reporter pushes run results to the New Relic Event API. The reporter sends each test run as a MomenticRun custom event and each run group as a MomenticRunGroup summary event. Query both with New Relic Query Language (NRQL).

1. Configure the reporter

Add a reporting.newrelic block to momentic.config.yaml:
momentic.config.yaml
  • region defaults to US. Use EU for accounts in New Relic’s EU data center.
  • licenseKey is optional. If omitted, the reporter reads the NEW_RELIC_LICENSE_KEY environment variable. Use an ingest license key.
  • attributes adds static tags (e.g. service, team) to every event, useful when multiple projects report into the same account.
  • accountId, licenseKey, and attributes values all support ${ENV_VAR} interpolation.

2. Run with the New Relic reporter

Pass --reporter newrelic to momentic run:
Pass --reporter multiple times to combine reporters:

3. Event reference

The reporter sends MomenticRun once per executed test: The reporter sends MomenticRunGroup once per run group as a summary: The reporter adds custom attributes from the config to both event types.

4. Query in New Relic

Pass rate per test over the last day:
Alert on run group pass rate:

Self-host the result viewer

Momentic’s result viewer is a static JavaScript bundle that renders any Momentic run-result zip. You can host it yourself on any static host instead of uploading runs to the dashboard. You need somewhere to serve the bundle and somewhere to store the zipped run results. The example below uses AWS S3 for both, but any static host works. The zips need to be reachable over HTTP with CORS enabled.

1. Host the static JavaScript bundle

Create a bundle-hosting bucket

Create a publicly readable bucket following the S3 static website documentation.

Upload the run-viewer-static bundle

Upload the contents of the run-viewer-static directory from the Momentic npm package. The current bundle is available on the momentic npm page, or from your project at node_modules/momentic/run-viewer-static. The bucket should contain:

2. Host the run-result zips

Create a results bucket

The bucket needs to be reachable from wherever the bundle is hosted. For this example a publicly readable bucket works.

Upload the test-results directory

CLI runs write to ./test-results by default (override with --output-dir). The directory contains:
  • metadata.json: metadata for the full run group
  • runs/<run_id>.zip: one zip per individual run
Upload each runs/*.zip to the results bucket.

Allow CORS from the viewer origin

Add a CORS policy that allows GET and HEAD from the bundle-hosting bucket’s URL (replace hosted-run-viewer with your bundle bucket name):

3. View a run

Navigate to the viewer’s index.html with a zipUrl query parameter pointing at the run zip:
The viewer fetches and unpacks the zip in the browser and needs no server component.