Uploading test cases to TestRail fails if some jobs were aborted

Bug #1500609 reported by Artem Panchenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Artem Panchenko

Bug Description

Uploading of test cases to TestRail may fail if some CI jobs were aborted or not started, for example:

{ "abort":false,
  "buildNumber":0,
  "duration":"not built",
  "icon":"nobuilt.png",
  "jobName":"8.0.system_test.ubuntu.zabbix",
  "parentBuildNumber":2,
  "parentJobName":"8.0.swarm.runner",
  "phaseName":"Run system tests",
  "result":null,
  "retry":false,
  "url":"" }

2015-09-28 22:42:46,465 - DEBUG - Request build data from https://product-ci.infra.mirantis.net//job/8.0.system_test.ubuntu.zabbix/0/api/json?depth=0
Traceback (most recent call last):
  File "fuelweb_test/testrail/upload_cases_description.py", line 216, in <module>
    main()
  File "fuelweb_test/testrail/upload_cases_description.py", line 195, in main
    distros) if options.job_name else []
  File "fuelweb_test/testrail/upload_cases_description.py", line 123, in get_tests_groups_from_jenkins
    z = Build(b['jobName'], b['buildNumber'])
  File "/home/apanchenko/fuel/fuel-qa/fuelweb_test/testrail/builds.py", line 95, in __init__
    self.build_data = self.get_build_data(depth=0)
  File "/home/apanchenko/fuel/fuel-qa/fuelweb_test/testrail/builds.py", line 116, in get_build_data
    return json.load(urllib2.urlopen(build_url))
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

We need to check that job build result is not null before trying to get its properties. We perform such check in reporter script:

https://github.com/stackforge/fuel-qa/blob/master/fuelweb_test/testrail/report.py#L464

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-qa (master)

Fix proposed to branch: master
Review: https://review.openstack.org/228614

Changed in fuel:
assignee: Fuel QA Team (fuel-qa) → Artem Panchenko (apanchenko-8)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-qa (master)

Reviewed: https://review.openstack.org/228614
Committed: https://git.openstack.org/cgit/stackforge/fuel-qa/commit/?id=6649806bb9106a3b20e7fd3b950e133095c8f95e
Submitter: Jenkins
Branch: master

commit 6649806bb9106a3b20e7fd3b950e133095c8f95e
Author: Artem Panchenko <email address hidden>
Date: Mon Sep 28 23:36:18 2015 +0300

    Skip Jenkins job build if its result is null

    Change-Id: I6842311f09cf4bdb2e3f9fca74f427c937aa1908
    Closes-bug: #1500609

Changed in fuel:
status: In Progress → Fix Committed
Changed in fuel:
status: Fix Committed → Fix Released
Dmitry Pyzhov (dpyzhov)
tags: added: area-qa
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.