Skip to content

Plugin for pytest that automatically publishes coverage and pytest report annotations to Buildkite

License

Notifications You must be signed in to change notification settings

urbint/pytest-buildkite

 
 

Repository files navigation

pytest-buildkite

Azure Status Travis Status Appveyor Status PyPI version Python Versions PyPI downloads per month Documentation Status Coverage Status Black

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!

Screenshot

More details can be found in the Online Documentation.

Installation

You can install pytest_buildkite for Python via pip from PyPI.

$ pip install pytest-buildkite

Prerequisites:

  • pipefish
  • plumbum

Download from PyPI.org

https://pypi.org/project/pytest-buildkite/

Features:

  • 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

Running in Docker

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

Contributing

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.

License

Distributed under the terms of the MIT license, "pytest-buildkite" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Additional Documentation:

About

Plugin for pytest that automatically publishes coverage and pytest report annotations to Buildkite

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 55.3%
  • Shell 43.4%
  • Dockerfile 1.3%