Fix the styling of code snippet
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
parent
efafb3e945
commit
1f68b0a202
1 changed files with 34 additions and 29 deletions
|
@ -210,22 +210,26 @@ to waiver more easily, directly from the Bodhi UI).
|
|||
You can submit a waiver for a failing result with specifying the and the
|
||||
:
|
||||
|
||||
` waiverdb-cli -t YOUR_TESTCASE_HERE -s '{"item": "this-is-the-subject", "type": "also-this-is-part-of-the-subject"}' -p "fedora-26" -c "This is fine"`
|
||||
waiverdb-cli -t YOUR_TESTCASE_HERE \
|
||||
-s '{"item": "this-is-the-subject", "type": "also-this-is-part-of-the-subject"}'
|
||||
-p "fedora-26" -c "This is fine"
|
||||
|
||||
Example:
|
||||
|
||||
` waiverdb-cli -t dist.rpmdeplint -s '{"item": "python-requests-1.2.3-1.fc26", "type": "koji_build"}' -p "fedora-26" -c "This is fine"`
|
||||
waiverdb-cli -t dist.rpmdeplint \
|
||||
-s '{"item": "python-requests-1.2.3-1.fc26", "type": "koji_build"}'
|
||||
-p "fedora-26" -c "This is fine"
|
||||
|
||||
You can also waive a failing result by result's id, which you can
|
||||
retrieve from resultsdb with curl. To do that, you'll need the name and
|
||||
the . For example:
|
||||
|
||||
` curl "`https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.python-versions&item=python-alembic-0.9.7-1.fc27[`https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.python-versions&item=python-alembic-0.9.7-1.fc27`]`" | jq ".data[0].id"`
|
||||
curl "https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0/results?testcases=dist.python-versions&item=python-alembic-0.9.7-1.fc27" | jq ".data[0].id"
|
||||
|
||||
This should print out the of the failing result. You can then submit a
|
||||
waiver for this failing result with
|
||||
|
||||
` waiverdb-cli -p fedora-27 -r YOUR_ID_HERE -c "This is fine."`
|
||||
waiverdb-cli -p fedora-27 -r YOUR_ID_HERE -c "This is fine."
|
||||
|
||||
Also, if you enabled automatic stable push at a karma threshold, this
|
||||
will be disabled if any automated test fails. If you have examined the
|
||||
|
@ -245,29 +249,30 @@ If which testcase you should be specified it is not clear/known, it is
|
|||
possible to run this python script, chainging it with the corrects
|
||||
parameter:
|
||||
|
||||
`#!/usr/bin/env python` +
|
||||
`""" Ask a question of greenwave. """` +
|
||||
`# Usage: either modify and set PRODUCT_VERSION and NVR_LIST and run, or pass version as first arg and then NVRs as further args` +
|
||||
`import pprint` +
|
||||
`import requests` +
|
||||
`import sys` +
|
||||
`PRODUCT_VERSION = 'fedora-27' if len(sys.argv) == 1 else sys.argv[1]` +
|
||||
`NVR_LIST = [] or sys.argv[2:] # Insert your NVRs here, or pass them via command line args` +
|
||||
`for nvr in NVR_LIST:` +
|
||||
` url = (` +
|
||||
` '`https://greenwave-web-greenwave.app.os.fedoraproject.org/[`https://greenwave-web-greenwave.app.os.fedoraproject.org/`]`'` +
|
||||
` 'api/v1.0/decision')` +
|
||||
` payload = dict(` +
|
||||
` #verbose=True,` +
|
||||
` decision_context='bodhi_update_push_stable',` +
|
||||
` product_version=PRODUCT_VERSION,` +
|
||||
` subject=[{'item': nvr, 'type': 'koji_build'}],` +
|
||||
` )` +
|
||||
` response = requests.post(url, json=payload)` +
|
||||
` print("-" * 40)` +
|
||||
` print(nvr, response, response.status_code)` +
|
||||
` data = response.json()` +
|
||||
` print(pprint.pformat(data))`
|
||||
#!/usr/bin/env python
|
||||
""" Ask a question of greenwave. """
|
||||
# Usage: either modify and set PRODUCT_VERSION and NVR_LIST and run,
|
||||
# or pass version as first arg and then NVRs as further args
|
||||
import pprint
|
||||
import requests
|
||||
import sys
|
||||
PRODUCT_VERSION = 'fedora-27' if len(sys.argv) == 1 else sys.argv[1]
|
||||
NVR_LIST = [] or sys.argv[2:] # Insert your NVRs here, or pass them via command line args
|
||||
for nvr in NVR_LIST:
|
||||
url = (
|
||||
'https://greenwave-web-greenwave.app.os.fedoraproject.org/'
|
||||
'api/v1.0/decision')
|
||||
payload = dict(
|
||||
#verbose=True,
|
||||
decision_context='bodhi_update_push_stable',
|
||||
product_version=PRODUCT_VERSION,
|
||||
subject=[{'item': nvr, 'type': 'koji_build'}],
|
||||
)
|
||||
response = requests.post(url, json=payload)
|
||||
print("-" * 40)
|
||||
print(nvr, response, response.status_code)
|
||||
data = response.json()
|
||||
print(pprint.pformat(data))
|
||||
|
||||
The output will show that Greenwave is requiring a specific testcase to
|
||||
run, but it cannot find a result for it (neither pass nor failure). So
|
||||
|
@ -279,11 +284,11 @@ output and the subject already known.
|
|||
|
||||
If you run the tool and it gives you the following error:
|
||||
|
||||
` Error: The config option "resultsdb_api_url" is required`
|
||||
Error: The config option "resultsdb_api_url" is required
|
||||
|
||||
Edit and add the following line:
|
||||
|
||||
` resultsdb_api_url=`https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0[`https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0`]
|
||||
resultsdb_api_url=`https://taskotron.fedoraproject.org/resultsdb_api/api/v2.0
|
||||
|
||||
[[branched-milestone-freezes]]
|
||||
=== Branched milestone freezes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue