#cargo #test #buildkite #analytics

app buildkite-test-collector

Official Buildkite Test Analytics Collector for Rust

3 releases

0.1.2 Oct 8, 2023
0.1.1 Jan 13, 2023
0.1.0 Jun 3, 2022

#23 in Testing

Download history 556/week @ 2023-11-02 477/week @ 2023-11-09 256/week @ 2023-11-16 548/week @ 2023-11-23 618/week @ 2023-11-30 904/week @ 2023-12-07 529/week @ 2023-12-14 636/week @ 2023-12-21 1045/week @ 2023-12-28 2410/week @ 2024-01-04 2305/week @ 2024-01-11 2074/week @ 2024-01-18 2312/week @ 2024-01-25 1780/week @ 2024-02-01 2568/week @ 2024-02-08 2149/week @ 2024-02-15

9,129 downloads per month

MIT license

701 lines

Buildkite Test Collector for Rust (Beta)

The official Rust adapter for Buildkite Test Analytics which implements a parser and sender for Rust's JSON test output.

📦 Supported CI systems: Buildkite, GitHub Actions, CircleCI, and others via the BUILDKITE_ANALYTICS_* environment variables.

👉 Installing

  1. Create a test suite, and copy the API token that it gives you.

  2. Install the buildkite-test-collector crate

cargo install buildkite-test-collector

Alternatively you can install direct from the repo

cargo install --git https://github.com/buildkite/test-collector-rust buildkite-test-collector
  1. Configure your environment

Set the BUILDKITE_ANALYTICS_TOKEN environment variable to contain the token provided by the analytics project settings.

We try and detect several common CI environments based in the environment variables which are present. If this detection fails then the application will crash with an error. To force the use of a "generic CI environment" just set the CI environment variable to any non-empty value.

  1. Change your test output to JSON format

In your CI environment you will need to change your output format to JSON and add --report-time to include execution times in the output. Unfortunately, these are currently unstable options for Rust, so some extra command line options are needed. Once you have the JSON output you can simply pipe it through the buildkite-test-collector binary - the input JSON is echoed back to STDOUT so that you can still operate upon it if needed.

cargo test -- -Z unstable-options --format json --report-time | buildkite-test-collector
  1. Confirm correct operation

Verify that the run is visible in the Buildkite analytics dashboard

🔜 Roadmap

See the GitHub 'enhancement' issues for planned features. Pull requests are always welcome, and we’ll give you feedback and guidance if you choose to contribute 💚

⚒ Developing

After cloning the repository, run the tests:

cargo test

Useful resources for developing collectors include the Buildkite Test Analytics docs and the RSpec and Minitest collectors.

👩‍💻 Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/buildkite/test-collector-rust

🚀 Releasing

Version bump the code, tag and push

cargo install cargo-bump
cargo bump --git-tag
git push && git push --tags

Publish to the Cargo registry

cargo publish

Create a new GitHub release

open "https://github.com/buildkite/test-collector-rust/releases"

📜 License

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

🤙 Thanks

Thanks to the folks at Alembic for building and maintaining this package.


~109K SLoC