Signed-off-by: Valerij Maljulin vmaljuli@redhat.com
This comment doesn't really seem related to the code. You mention a failed result waived, but then you create a PASSED result and no waiver. Maybe copy/paste?
The issue is here: this function (functional-tests/conftest.py) creates by default a result with subject type "koji_build", but you want to create a result with subject type "group". So when you check for the decision, greenwave doesn't find any result with subject type "group", because the one you created has type "koji_build". This function also takes an additional parameter "_type" that you can use to specify the subject type ("group" in this case).
You need to add here also "verbose": True as parameter. Otherwise you're not going to get the info about the result that you are checking later in the "assert" part.
If you add "verbose" True as parameter that's what you're going to get as res_data:
{'applicable_policies': ['compose-test-scenario-group'], 'policies_satisfied': True, 'results': [{'data': {'item': ['sha256:fe6e893b8b1b9a56df1d1f4909e4a1c2e31963d06afc1de477c34841e523f8fe'], 'type': ['group']}, 'groups': [], 'href': 'http://resultsdb:5001/api/v2.0/results/326', 'id': 326, 'note': None, 'outcome': 'PASSED', 'ref_url': None, 'submit_time': '2019-10-24T09:43:38.873338', 'testcase': {'href': 'http://resultsdb:5001/api/v2.0/testcases/testcase_name', 'name': 'testcase_name', 'ref_url': None}}], 'satisfied_requirements': [{'result_id': 326, 'testcase': 'testcase_name', 'type': 'test-result-passed'}], 'summary': 'All required tests passed', 'unsatisfied_requirements': [], 'waivers': []}
You need then to change later to get the right info from there.
oh, my bad. that was just copy-pasted :)
See it. Thank you!
rebased onto da6fe520c90d79cc3613ea7b4777a518942c6d2e
Comments were addressed
optional: can you put this all in one line? To make it look like the other ones. It shouldn't be too long, so flake8 shouldn't complain about it.
can you remove the print?
The bad comment is still here :D
Flake8 complains about this line... could you check it?
As a side note: when you think you're done with the PR, remove the WIP so we are sure it can be merged :)
rebased onto 8ce3ded749860b573c571a7a14d912aae7a483da
Addressed
Awesome +1 \o/
Use a fixed string instead.
rebased onto 1311962ddb33c11007c995206c0731683e65b4fe
I think there should be a list of artifacts/items in the group result data and it should be listed in the decision.
artifacts
items
@gnaponie Is that correct? I'm still working on the details: https://pagure.io/fedora-ci/messages/pull-request/87
@lholecek I think there shouldn't be the details about the single results in the decision. Only about the "group" result (item == the hash of ids). @lucarval what do you think?
I'm not sure... there is FACTORY-5347 that might be connected. But it regards results, I'm not sure this should be included in the decision itself. (Anyhow it would automatically get added if verbose=True, it would need changes on the greenwave side).
Consider using the json= parameter instead of data=. This has two benefits:
json=
data=
json.dumps
Content-Type
https://requests.kennethreitz.org/en/master/user/quickstart/#more-complicated-post-requests
I agree. At least for now, Greenwave is agnostic to what's actually in the group.
rebased onto dd5f28ac654f9617704a95827ec157e805493fca
Consider using the json= parameter instead of data=. This has two benefits: No need to call json.dumps Content-Type header is automatically set. https://requests.kennethreitz.org/en/master/user/quickstart/#more-complicated-post-requests
No need to call json.dumps Content-Type header is automatically set.
Refactored all functional tests for it
+1
Pull-Request has been merged by vmaljulin
Signed-off-by: Valerij Maljulin vmaljuli@redhat.com