Plugin for pytest that automatically publishes coverage and pytest report annotations to BuildKite.
Note: This library was originally re-purposed from
tonybaloney's
pytest-azurepipelines
Just run pytest with this plugin and see your test results in the BuildKite UI!
More details can be found in the Online Documentation.
You can install pytest_buildkite for Python via pip from PyPI.
$ pip install pytest-buildkite
- pipefish
- plumbum
https://pypi.org/project/pytest-buildkite/
- Overloads the
--junit-xml
flag on execution with a default value - Uploads test results automatically, no need for a separate test results upload command
- Displays the number of failed tests if there were failures as an error message in the UI
- Displays summary of code coverage if pytest-cov is installed
To make the buildkite-agent available in docker make sure the agent is bind mounted into the docker image (or installed in the container) and the environment variables are passed down. A sample docker compose configuration is show below.
environment:
- BUILDKITE
- BUILDKITE_AGENT_ACCESS_TOKEN
- BUILDKITE_ARTIFACT_UPLOAD_DESTINATION
- BUILDKITE_BRANCH
- BUILDKITE_BUILD_ID
- BUILDKITE_BUILD_NUMBER
- BUILDKITE_BUILD_URL
- BUILDKITE_COMMIT
- BUILDKITE_ENV_FILE
- BUILDKITE_JOB_ID
- BUILDKITE_LABEL
- BUILDKITE_MESSAGE
- BUILDKITE_ORGANIZATION_SLUG
- BUILDKITE_REPO
- BUILDKITE_S3_ACCESS_KEY_ID
- BUILDKITE_S3_ACCESS_URL
- BUILDKITE_S3_ACL
- BUILDKITE_S3_DEFAULT_REGION
- BUILDKITE_S3_SECRET_ACCESS_KEY
- BUILDKITE_TAG
- CI
volumes:
- type: bind
source: /usr/bin/buildkite-agent
target: /usr/bin/buildkite-agent
- type: bind
source: /usr/bin/buildkite-agent-original
target: /usr/bin/buildkite-agent-original
Contributions are very welcome, consider using the file an issue to discuss the work before beginning, but if you already have a Pull Request ready then this is no problem, please submit it and it will be very gratefully considered. The Contribution Guidelines outlines the pytest-buildkite commitment to ensuring all contributions receive appropriate recognition.
Distributed under the terms of the MIT license, "pytest-buildkite" is free and open source software
If you encounter any problems, please file an issue along with a detailed description.