| |
@@ -83,9 +83,6 @@
|
| |
'dist.upgradepath',
|
| |
]
|
| |
|
| |
- OPENQA_TASKS = [
|
| |
- 'compose.install_no_user',
|
| |
- ]
|
| |
OPENQA_SCENARIOS = [
|
| |
'scenario1',
|
| |
'scenario2',
|
| |
@@ -193,6 +190,7 @@
|
| |
'product_version': 'rhel-7',
|
| |
'subject': [{'item': nvr, 'type': 'koji_build'}]
|
| |
}
|
| |
+
|
| |
r = requests_session.post(greenwave_server.url + 'api/v1.0/decision',
|
| |
headers={'Content-Type': 'application/json'},
|
| |
data=json.dumps(data))
|
| |
@@ -211,7 +209,9 @@
|
| |
result = testdatabuilder.create_result(item=nvr,
|
| |
testcase_name=all_rpmdiff_testcase_names[0],
|
| |
outcome='FAILED')
|
| |
- testdatabuilder.create_waiver(result_id=result['id'], product_version='rhel-7')
|
| |
+ waiver = testdatabuilder.create_waiver(result={ # noqa
|
| |
+ "subject": dict([(key, value[0]) for key, value in result['data'].items()]),
|
| |
+ "testcase": all_rpmdiff_testcase_names[0]}, product_version='rhel-7')
|
| |
# The rest passed
|
| |
for testcase_name in all_rpmdiff_testcase_names[1:]:
|
| |
testdatabuilder.create_result(item=nvr,
|
| |
@@ -440,12 +440,13 @@
|
| |
If we require two scenarios to pass, and both pass, then we pass.
|
| |
"""
|
| |
compose_id = testdatabuilder.unique_compose_id()
|
| |
- for testcase_name in OPENQA_TASKS:
|
| |
- for scenario in OPENQA_SCENARIOS:
|
| |
- testdatabuilder.create_result(item=compose_id,
|
| |
- testcase_name=testcase_name,
|
| |
- scenario=scenario,
|
| |
- outcome='PASSED')
|
| |
+ testcase_name = 'compose.install_no_user'
|
| |
+ for scenario in OPENQA_SCENARIOS:
|
| |
+ testdatabuilder.create_result(
|
| |
+ item=compose_id,
|
| |
+ testcase_name=testcase_name,
|
| |
+ scenario=scenario,
|
| |
+ outcome='PASSED')
|
| |
data = {
|
| |
'decision_context': 'rawhide_compose_sync_to_mirrors',
|
| |
'product_version': 'fedora-rawhide',
|
| |
@@ -469,17 +470,19 @@
|
| |
"""
|
| |
|
| |
compose_id = testdatabuilder.unique_compose_id()
|
| |
- for testcase_name in OPENQA_TASKS:
|
| |
- # Scenario 1 passes..
|
| |
- testdatabuilder.create_result(item=compose_id,
|
| |
- testcase_name=testcase_name,
|
| |
- scenario='scenario1',
|
| |
- outcome='PASSED')
|
| |
- # But scenario 2 fails!
|
| |
- testdatabuilder.create_result(item=compose_id,
|
| |
- testcase_name=testcase_name,
|
| |
- scenario='scenario2',
|
| |
- outcome='FAILED')
|
| |
+ testcase_name = 'compose.install_no_user'
|
| |
+ # Scenario 1 passes..
|
| |
+ testdatabuilder.create_result(
|
| |
+ item=compose_id,
|
| |
+ testcase_name=testcase_name,
|
| |
+ scenario='scenario1',
|
| |
+ outcome='PASSED')
|
| |
+ # But scenario 2 fails!
|
| |
+ result = testdatabuilder.create_result(
|
| |
+ item=compose_id,
|
| |
+ testcase_name=testcase_name,
|
| |
+ scenario='scenario2',
|
| |
+ outcome='FAILED')
|
| |
data = {
|
| |
'decision_context': 'rawhide_compose_sync_to_mirrors',
|
| |
'product_version': 'fedora-rawhide',
|
| |
@@ -494,6 +497,14 @@
|
| |
assert res_data['applicable_policies'] == ['openqa_important_stuff_for_rawhide']
|
| |
expected_summary = '1 of 2 required tests failed'
|
| |
assert res_data['summary'] == expected_summary
|
| |
+ expected_unsatisfied_requirements = [{
|
| |
+ u'item': {u'item': compose_id},
|
| |
+ u'result_id': result['id'],
|
| |
+ u'testcase': testcase_name,
|
| |
+ u'type': u'test-result-failed',
|
| |
+ u'scenario': u'scenario2',
|
| |
+ }]
|
| |
+ assert res_data['unsatisfied_requirements'] == expected_unsatisfied_requirements
|
| |
|
| |
|
| |
def test_ignore_waiver(requests_session, greenwave_server, testdatabuilder):
|
| |
@@ -504,7 +515,9 @@
|
| |
result = testdatabuilder.create_result(item=nvr,
|
| |
testcase_name=all_rpmdiff_testcase_names[0],
|
| |
outcome='FAILED')
|
| |
- waiver = testdatabuilder.create_waiver(result_id=result['id'], product_version='rhel-7')
|
| |
+ waiver = testdatabuilder.create_waiver(result={
|
| |
+ "subject": dict([(key, value[0]) for key, value in result['data'].items()]),
|
| |
+ "testcase": all_rpmdiff_testcase_names[0]}, product_version='rhel-7')
|
| |
# The rest passed
|
| |
for testcase_name in all_rpmdiff_testcase_names[1:]:
|
| |
testdatabuilder.create_result(item=nvr,
|
| |
@@ -515,21 +528,21 @@
|
| |
'product_version': 'rhel-7',
|
| |
'subject': [{'item': nvr, 'type': 'koji_build'}]
|
| |
}
|
| |
- r = requests_session.post(greenwave_server.url + 'api/v1.0/decision',
|
| |
- headers={'Content-Type': 'application/json'},
|
| |
- data=json.dumps(data))
|
| |
- assert r.status_code == 200
|
| |
- res_data = r.json()
|
| |
+ r_ = requests_session.post(greenwave_server.url + 'api/v1.0/decision',
|
| |
+ headers={'Content-Type': 'application/json'},
|
| |
+ data=json.dumps(data))
|
| |
+ assert r_.status_code == 200
|
| |
+ res_data = r_.json()
|
| |
assert res_data['policies_satisfied'] is True
|
| |
# Ignore the waiver
|
| |
data.update({
|
| |
'ignore_waiver': [waiver['id']]
|
| |
})
|
| |
- r = requests_session.post(greenwave_server.url + 'api/v1.0/decision',
|
| |
- headers={'Content-Type': 'application/json'},
|
| |
- data=json.dumps(data))
|
| |
- assert r.status_code == 200
|
| |
- res_data = r.json()
|
| |
+ r_ = requests_session.post(greenwave_server.url + 'api/v1.0/decision',
|
| |
+ headers={'Content-Type': 'application/json'},
|
| |
+ data=json.dumps(data))
|
| |
+ assert r_.status_code == 200
|
| |
+ res_data = r_.json()
|
| |
expected_unsatisfied_requirements = [
|
| |
{
|
| |
'item': {'item': nvr, 'type': 'koji_build'},
|
| |
Changed Greenwave for submition of waiver in Waiverdb, not anymore with the result_id, but with subject and testcase