Bug 1204028 - Better error for non-existent run
Summary: Better error for non-existent run
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-nitrate
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Petr Šplíchal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 906448 1011402 1121198 1181629 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-20 08:07 UTC by Lukáš Zachar
Modified: 2016-06-01 01:47 UTC (History)
5 users (show)

Fixed In Version: python-nitrate-1.3-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-22 07:56:23 UTC


Attachments (Terms of Use)
proposed patch (2.12 KB, patch)
2016-01-29 15:03 UTC, Iveta Wiedermann
no flags Details | Diff

Description Lukáš Zachar 2015-03-20 08:07:02 UTC
Description of problem:

If one asks for non-existent run python-nitrate tracebacks with KeyError.
IMHO it should return more user friendly error / exception.


Version-Release number of selected component (if applicable):
python-nitrate-1.2-2

How reproducible:
always

Steps to Reproduce:
1. python -c 'import nitrate; print nitrate.TestRun(999999999)'

Actual results:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/nitrate/base.py", line 352, in __str__
    return utils.ascii(unicode(self))
  File "/usr/lib/python2.7/site-packages/nitrate/mutable.py", line 507, in __unicode__
    return u"{0} - {1}".format(self.identifier, self.summary)
  File "/usr/lib/python2.7/site-packages/nitrate/base.py", line 64, in getter
    self._fetch()
  File "/usr/lib/python2.7/site-packages/nitrate/mutable.py", line 619, in _fetch
    self._build = Build(inject["build_id"])
KeyError: 'build_id'

Expected results:
NitrateError saying no data fetched OR non-existent run

Additional info:
In log ones sees that empty dictionary was retrieved, but one suspects error on server instead of PEBKAC in run number.

Comment 1 Jan Kurik 2015-07-15 14:23:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 2 Iveta Wiedermann 2016-01-22 17:42:44 UTC
We discussed with Petr Splichal that better error could be provided generally for these objects - that means for TestPlan, TestRun and TestCase so it's unified.

Comment 3 Iveta Wiedermann 2016-01-29 15:03:43 UTC
Created attachment 1119448 [details]
proposed patch

Lukas, let me know if you find the patch reasonable or if you have any comments.
Thank you.

Comment 4 Iveta Wiedermann 2016-02-09 15:26:28 UTC
*** Bug 906448 has been marked as a duplicate of this bug. ***

Comment 5 Iveta Wiedermann 2016-02-09 15:27:58 UTC
*** Bug 1011402 has been marked as a duplicate of this bug. ***

Comment 6 Lukáš Zachar 2016-02-09 15:49:14 UTC
I like the attached patch.

Comment 7 Petr Šplíchal 2016-02-09 17:20:42 UTC
Thanks for the patch, Iveta. Merged into master:
https://github.com/psss/python-nitrate/commit/5d9c41f

With a couple of adjustments and tests:
https://github.com/psss/python-nitrate/commit/05b6e34

Comment 8 Petr Šplíchal 2016-02-09 17:57:06 UTC
*** Bug 1181629 has been marked as a duplicate of this bug. ***

Comment 9 Fedora Update System 2016-02-10 11:51:40 UTC
python-nitrate-1.3-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-687d19409b

Comment 10 Fedora Update System 2016-02-10 11:55:47 UTC
python-nitrate-1.3-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-35a106d076

Comment 11 Fedora Update System 2016-02-10 11:57:28 UTC
python-nitrate-1.3-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-2bb9364c32

Comment 12 Fedora Update System 2016-02-10 11:58:17 UTC
python-nitrate-1.3-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7474e957a9

Comment 13 Petr Šplíchal 2016-02-10 12:48:52 UTC
Latest packages for testing available in the copr repository:
https://copr.fedorainfracloud.org/coprs/psss/python-nitrate/

Comment 14 Fedora Update System 2016-02-10 17:19:58 UTC
python-nitrate-1.3-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-687d19409b

Comment 15 Fedora Update System 2016-02-10 18:22:34 UTC
python-nitrate-1.3-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-2bb9364c32

Comment 16 Fedora Update System 2016-02-10 18:50:34 UTC
python-nitrate-1.3-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-7474e957a9

Comment 17 Fedora Update System 2016-02-10 23:54:05 UTC
python-nitrate-1.3-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-35a106d076

Comment 18 Fedora Update System 2016-02-21 02:21:59 UTC
python-nitrate-1.3-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2016-02-21 16:27:14 UTC
python-nitrate-1.3-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 20 Iveta Wiedermann 2016-02-22 11:35:48 UTC
*** Bug 1121198 has been marked as a duplicate of this bug. ***

Comment 21 Fedora Update System 2016-02-27 02:01:00 UTC
python-nitrate-1.3-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2016-02-27 02:07:47 UTC
python-nitrate-1.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.