A plugin that allows you to post test runs to BugZilla tickets and create new tickets
Project description
This plugin currently has the following functionality:
posts the results of test runs to be added to existing Bugzilla tickets
create new tickets as part of a pytest test
read bugs given a bug ID
search for bugs given a search
Installation
You can install “pytest-bugzilla-notifier” via pip from PyPI:
$ pip install pytest-bugzilla-notifier
Pre-requisites
To use this plugin you need to have a username and password for a Bugzilla account. First, you need to copy bugzilla.ini-dist to bugzilla.ini and add in the BugZilla API key you will be using to access Bugzilla.
Reporting test runs
You can use the plugin to update a ticket with the results by using the following command:
$ pytest --bug=<bug ID> --config=./bugzilla.ini --bugzilla-url=<server> /path/to/tests
<bug ID> The ID that Bugzilla assigned to the bug you wish to have the test results sent to.
<server> The full URL to the Bugzilla instance you wish to send test results to (eg https://bugzilla.mozilla.com)
Creating new tickets
To create a new ticket in Bugzilla, you need to import the library using:
from pytest_bugzilla_notifier.bugzilla_rest_client import BugzillaRESTClient
and then you can create bugs using code similar to this:
api_details = { 'bugzilla_host': '<bugzilla host you are using>', 'bugzilla_api_key': '<bugzilla API key>' } rest_client = BugzillaRESTClient(api_details) bug_data = { 'product': 'Firefox', 'component': 'Developer Tools', 'summary': 'Test Bug', 'version': 'unspecified' } bug_id = rest_client.bug_create(bug_data)
If everything worked as expected, bug_id will contain the ID BugZilla has assigned to your ticket.
Reading Bug Details
If you know the ID for a bug, you can read in the details:
api_details = { 'bugzilla_host': '<bugzilla host you are using>', 'bugzilla_api_key': '<bugzilla API key>' } rest_client = BugzillaRESTClient(api_details) bug_id = <bug ID> response = rest_client.bug_read(bug_id)
Searching For Bugs
You can follow the outlines for search parameters and then submit your search request:
api_details = { 'bugzilla_host': '<bugzilla host you are using>', 'bugzilla_api_key': '<bugzilla API key>' } rest_client = BugzillaRESTClient(api_details) search_details = { 'product': 'Firefox', 'component': 'Developer Tools', 'summary': 'Test Bug', } bug_id = rest_client.bug_search(search_details)
Contributing
Contributions are very welcome. Tests can be run with tox, please ensure that the test suite passed before submitting a pull request.
License
Distributed under the terms of the Mozilla Public License 2.0 license, “pytest-bugzilla-notifier” is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pytest-bugzilla-notifier-1.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f558e9c39fbe57badd67a772ecfbb6e522ecfe0b18c6291cb40bc070b6131b5 |
|
MD5 | eee876f7b153a4a40a756bbc3866b1fb |
|
BLAKE2b-256 | ec8c61d1fe760b0f993d2a1db5e089bb5873146cf724f477436558bdacd92619 |
Hashes for pytest_bugzilla_notifier-1.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dae87fa76ad2b319f82b4feaef69dc864e7bf03651a3d6c554610528247a9cc |
|
MD5 | 4e0870dad4ab8c4915c609786392a803 |
|
BLAKE2b-256 | c0101aace952f743f81303237b6e86776cb09a21f152879f9debfe9dfccdc581 |
Hashes for pytest_bugzilla_notifier-1.1.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3071be2f433760b4e3ca6da2b92f5ae558ed1fd92f41185082719fdb43beff2 |
|
MD5 | e99edefceed1499b925dec51b7ebaa13 |
|
BLAKE2b-256 | 6b5e9c4adea17e896aab58d06dda763aa0c8c8049e9f85c227df1a4500a5d2ed |