The official Python adapter for Buildkite Test Analytics which collects information about your tests.
⚒ Supported test frameworks: pytest.
📦 Supported CI systems: Buildkite, GitHub Actions, CircleCI, and others via the BUILDKITE_ANALYTICS_*
environment variables.
-
Create a test suite, and copy the API token that it gives you.
-
Add
buildkite-test-collector
to your list of dev dependencies insetup.py
extras_require={
"dev": [
"buildkite-test-collector"
]
}
- Set up your API token
Add the BUIDLKITE_ANALYTICS_TOKEN
environment variable to your build system's environment.
- 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
- Verify that it works
If all is well, you should see the test run in the test analytics section of the Buildkite dashboard.
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 💚
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.
Bug reports and pull requests are welcome on GitHub at https://github.com/buildkite/test-collector-python
- Version bump the code, tag and push.
- Publish to the Python Package Index:
python3 -m build
python3 -m twine upload dist/*
- Create a new github release.
The package is available as open source under the terms of the MIT License.
Thanks to the folks at Alembic for building and maintaining this package.