We've recently updated the navigation
You can find APIs and Integrations in their own sections in the horizontal menu bar at the top of the page.
JavaScript Collectors
Test Analytics ships with a Jest test collector, and more are coming soon. You can also upload test results by importing JSON or JUnit XML.
Jest collector
Test Analytics ships with a Jest test collector.
If you're already using Jest, then you can add buildkite-collector/jest/reporter
to your list of reporters to collect your test results into your Test Analytics dashboard.
Before you start, make sure Jest runs with access to CI environment variables.
In your CI environment, set the
BUILDKITE_ANALYTICS_TOKEN
environment variable securely to your Buildkite Test Analytics API token.-
Create a new branch:
$ git checkout -b install-buildkite-test-analytics
-
Install
buildkite-test-collector
using your package manager.npm:
$ npm install --dev buildkite-test-collector
Yarn:
$ yarn add --dev buildkite-test-collector
-
Add
"buildkite-test-collector/jest/reporter"
to Jest'sreporters
configuration array (typically found injest.config.js
,jest.config.js
, orpackage.json
):{ "reporters": ["default", "buildkite-test-collector/jest/reporter"] }
-
Commit and push your changes:
$ git add . $ git commit -m "Install and set up Buildkite Test Analytics" $ git push
Once you're done, in your Test Analytics dashboard, you'll see analytics of test executions on all branches that include this code.
If you don't see branch names, build numbers, or commit hashes in the Test Analytics UI, then see CI Environments to learn more about exporting your environment to Jest.
Troubleshooting missing test executions and --forceExit
Using the --forceExit
option when running Jest could result in missing test executions from Test Analytics.
--forceExit
could potentially terminate any ongoing processes that are attempting to send test executions to Buildkite.
We recommend using --detectOpenHandles
to track down open handles which are preventing Jest from exiting cleanly.