allure.issue and allure.testcase require both url and name params contradicting documentation
I'm submitting a ...
- [x] bug report
- [ ] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.
What is the current behavior?
Implementation of allure.issue and allure.testcase decorators in pytest-allure-adaptor only required one argument e.g. the URL or name of test/issue.
In allure-pytest this behavior has changed and now requires both arguments url and name supplied. On top of that name argument from function declaration seems to be optional which is not entirely true.
def testcase(url, name=None):
return link(url, link_type=LinkType.TEST_CASE, name=name)
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Non-working example with allure-pytest (works fine with pytest-allure-adaptor)
import allure
@allure.issue('http://localhost/JIRA-001')
@allure.testcase('http://localhost/TC-001')
def test_first():
pass
Resulting report has missing issue and testcase links in report Links section.
What is the expected behavior?
Issue and test case links are available in report as specified in decorators.
What is the motivation / use case for changing the behavior?
As I see it there are 2 options to approach this:
-
If the new behavior was intended then this has to be documented and
nameargument should be made mandatory. -
Change behavior to match what is docuemnted and matches behavior in
pytest-allure-adaptor.
Please tell us about your environment:
- Allure version: 2.4.1
- Test framework: [email protected]
- Allure adaptor: [email protected]
Other information
Can not reproduce.
@allure.testcase(TEST_CASE)
def test_single_test_case():
"""
>>> allure_report = getfixture('allure_report')
>>> assert_that(allure_report,
... has_test_case('test_single_test_case',
... has_test_case_link(TEST_CASE)
... ))
"""
pass
"name": "test_single_test_case",
"links": [
{
"url": "https://github.com/qameta/allure-integrations/issues/8#issuecomment-268313637",
"type": "test_case"
}
],
Fill free to reopen this issue with additional information.
@sseliverstov Not sure how you can say you are not able to reproduce if you did not even try my example.
So here are the grandma instructions on how to reproduce the issue step by step.
# Create clean virtualenv
$ python3 -m venv allure_venv
$ . allure_venv/bin/activate
# Install packages (bare minimum, just pytest and allure-pytest)
$ pip install pytest
$ pip install allure-pytest
$ pip freeze
allure-pytest==2.3.1b1
allure-python-commons==2.3.1b1
attrs==17.4.0
enum34==1.1.6
pkg-resources==0.0.0
pluggy==0.6.0
py==1.5.2
pytest==3.3.2
# Create example test file
$ cat > test_allure_issue.py << EOF
import allure
@allure.issue('http://localhost/JIRA-001')
@allure.testcase('http://localhost/TC-001')
def test_first():
pass
EOF
# Run test
$ pytest --alluredir=allure-results -v test_allure_issue.py
# Allure results
$ allure serve
Attaching screenshot of generated report where it is clearly visible that links are missing.

Hi! Can you show json result file for 'test_first'?
JFYI https://github.com/allure-framework/allure2/issues/473
Hi! Can you show json result file for 'test_first'?
{
"status": "passed",
"name": "test_first",
"historyId": "a25eff06ab40fca4773261e40c06c6bc",
"uuid": "e09764e7-c608-47b7-8423-85b226549183",
"stop": 1516118520208,
"links": [
{
"url": "http://localhost/JIRA-001",
"type": "issue"
},
{
"url": "http://localhost/TC-001",
"type": "test_case"
}
],
"fullName": "test_allure_issue#test_first",
"start": 1516118520208,
"labels": [
{
"value": "darkhorse",
"name": "host"
},
{
"value": "23532-MainThread",
"name": "thread"
},
{
"value": "pytest",
"name": "framework"
},
{
"value": "cpython3",
"name": "language"
},
{
"value": "test_allure_issue",
"name": "package"
}
]
}
Hi!
Any progress on this? It looks like a fix is as trivial as adding check if just argument passed then name = url. Please correct me if there are some hidden complexities.
Will this be fixed at some point of time?
FYI: https://github.com/allure-framework/allure-python/pull/365
Can be closed I guess
Fixed in #365