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

Generate report of tests dependent on Jira #104

Open
yoram-s opened this issue Jul 25, 2019 · 2 comments
Open

Generate report of tests dependent on Jira #104

yoram-s opened this issue Jul 25, 2019 · 2 comments

Comments

@yoram-s
Copy link

yoram-s commented Jul 25, 2019

HI,
I'm looking for a nice way to generate a report for all the tests with Jira tickets associated with them
i.e.:
test_one JIRA-234 open
test_two JIRA-342 assigned
test_three JIRA-1 closed

@lukas-bednar
Copy link
Member

Hi thanks for proposal, do you have some certain idea how it should be implemented? So that we can nail it down.

@yoram-s
Copy link
Author

yoram-s commented Jul 29, 2019

Hi,
I would think to add a hook to pytest_runtest_setup in that hook implement something like:

def pytest_runtest_setup(item):
    if item.config.getoption("--jira-doc"):
        dump_test(item)

In the dump_test(item) iterate on the markers looking for the jira issue.
Then populate the info into dictionary with the test-name[arguments] as key and the ticket number and state as values
eventually in pytest_unconfigure(config) hook you should dump the dictionary into json file or any other formatted output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants