Skip to main content

Buildkite Test Analytics collector

Project description

Buildkite Test Collector for Python (Beta)

The official Python adapter for Buildkite Test Analytics which collects information about your tests.

Supported python versions: >=3.8

Supported test frameworks: pytest.

📦 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. Add buildkite-test-collector to your list of dev dependencies in setup.py

        extras_require={
            "dev": [
                "buildkite-test-collector"
            ]
        }
  1. Set up your API token

Add the BUIDLKITE_ANALYTICS_TOKEN environment variable to your build system's environment.

  1. Run your tests

Run your tests like normal. Note that we attempt to detect the presence of several common CI environments, however if this fails you can set the CI environment variable to any value and it will work.

$ pytest
  1. Verify that it works

If all is well, you should see the test run in the test analytics section of the Buildkite dashboard.

🎢 Tracing

Buildkite Test Analytics has support for tracing potentially slow operations within your tests (SQL queries, HTTP requests, etc). This library now supports the ability to add tracing information to your test analytics output by using the new spans pytest fixture. See the SpanCollector documentation for more information.

🔜 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, install the dependencies:

pip install -e '.[dev]'

And run the tests:

pytest

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-python

🚀 Releasing

  1. Version bump the code, tag and push.
  2. Publish to the Python Package Index:
python3 -m build
python3 -m twine upload dist/*
  1. Create a new github release.

📜 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

buildkite-test-collector-0.1.6.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

buildkite_test_collector-0.1.6-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file buildkite-test-collector-0.1.6.tar.gz.

File metadata

  • Download URL: buildkite-test-collector-0.1.6.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for buildkite-test-collector-0.1.6.tar.gz
Algorithm Hash digest
SHA256 f2b43762fd7b1b3f189e76cd35b33c5b3a5d1f396991dc0fdaa6db93eb3aceb0
MD5 f19fdf10c5ab98cfb1dfcb57b01175b5
BLAKE2b-256 4f17a4bddf92d9ffa73f24bb6c23428856e08f912d7e3aeb42fe6f50239040e5

See more details on using hashes here.

File details

Details for the file buildkite_test_collector-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for buildkite_test_collector-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e83a5762b73b2f7a916493c5862223165872a31f33fed202e661af6b27b81dac
MD5 278b28d9c515c624346b98088153bcc8
BLAKE2b-256 4fadaca8c4ee82454eb50532eaac64925e589a07ff27d6571c908aed35241f64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page