Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export support --bugzilla to link case #808

Merged
merged 2 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ directory::
url: https://github.com/psss/tmt.git
Test case 'TC#0603489' successfully exported to nitrate.

Use the ``--bugzilla`` option together with ``--nitrate`` to link
bugs marked as ``verifies`` in the :ref:`/spec/core/link`
attribute with the corresponding Nitrate test case.


Test Libraries
------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'docs': ['sphinx', 'sphinx_rtd_theme', 'mock'],
'tests': ['pytest', 'python-coveralls', 'mock', 'requre', 'pre-commit'],
'provision': ['testcloud>=0.6.1'],
'convert': ['nitrate', 'markdown'],
'convert': ['nitrate', 'markdown', 'python-bugzilla'],
'report-html': ['jinja2'],
'report-junit': ['junit_xml'],
}
Expand Down Expand Up @@ -78,6 +78,7 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Utilities',
],
keywords=['metadata', 'testing'],
Expand Down
12 changes: 12 additions & 0 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import xmlrpc.client

import nitrate
from bugzilla._backendxmlrpc import _BugzillaXMLRPCTransport
from requests import sessions
from requre import cassette
from requre.cassette import StorageKeysInspectSimple
from requre.helpers.guess_object import Guess
from requre.helpers.requests_response import RequestResponseHandling

# decorate functions what communicates with nitrate
nitrate.xmlrpc_driver.GSSAPITransport.single_request = Guess.decorator_plain()(
nitrate.xmlrpc_driver.GSSAPITransport.single_request)
nitrate.xmlrpc_driver.GSSAPITransport.single_request_with_cookies = Guess.decorator_plain()(
nitrate.xmlrpc_driver.GSSAPITransport.single_request_with_cookies)

# decorate functions that communicate with bugzilla (xmlrpc)
_BugzillaXMLRPCTransport.single_request = Guess.decorator_plain()(
_BugzillaXMLRPCTransport.single_request)
sessions.Session.send = RequestResponseHandling.decorator(
item_list=[1])(
sessions.Session.send)

# use storage simple strategy to avoid use full stack info for keys
cassette.StorageKeysInspectDefault = StorageKeysInspectSimple
3 changes: 3 additions & 0 deletions tests/integration/data/nitrate/existing_testcase/main.fmf
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
summary: This is case what already exists inside nitrate
extra-nitrate: TC#0609686
link:
- verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1925518
- https://bugzilla.redhat.com/show_bug.cgi?id=1923314
7 changes: 6 additions & 1 deletion tests/integration/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ description: |
cd tests/integration
sudo unshare -n sudo -u `whoami` pytest -v test_nitrate.py

test: "python3 -m pytest -v"
environment:
REQURE_MODE: read
framework: shell
Expand All @@ -44,3 +43,9 @@ require:
tag: [integration]
tier: null
link: https://github.com/packit/requre

/coverage_bugzilla:
test: "python3 -m pytest -v -k 'test_coverage_bugzilla'"

/the_rest:
test: "python3 -m pytest -v -k 'not test_coverage_bugzilla'"
Loading