/js-buildkite-analytics

Buildkite Test Analytics Collector for Javascript

Primary LanguageJavaScriptMIT LicenseMIT

Buildkite Test Analytics Collector for JavaScript

This is the official repo for JavaScript-based Buildkite Test Analytics collectors ✨

So far, it supports Jest. We hope to add more JavaScript test frameworks soon.

Usage - Jest

  1. Setup a project on Buildkite Test Analytics and note the key
  2. Add 'buildkite-analytics' to your npm packages
  3. Configure Jest to use the reporter and enable testLocationInResults
  // jest.config.js
  reporters: [
    'default',
    'buildkite-analytics/jest-reporter'
  ],
  testLocationInResults: true
  1. set the environment variable for your test analytics
  export BUILDKITE_ANALYTICS_API_TOKEN=xyz
  1. Run your tests

To enable debugging, set BUILDKITE_ANALYTICS_DEBUG_ENABLED=true

JavaScript Collector Roadmap

DONE

  • Send test pass/fail status on test completion
  • Send failure reason
  • Tests

TODO

  • Sending through failure_expanded
  • HTTP tracing
  • SQL tracing
  • Annotations
  • Live stream results via web sockets
  • Additional test framework support (Cypress , Jasmine, AVA, Mocha, etc)

Pull requests welcome!

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/buildkite/js-buildkite-analytics.

Working on js-buildkite-analytics

After cloning the repository install the dependencies using npm:

npm install

You can run the tests for this library by executing:

npm test

License

The package is available as open source under the terms of the MIT License.