Fix the upload test cases mechanism to work with pytest tests and to be more stable

Bug #1614985 reported by Alexander Kurenyshev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Alexander Kurenyshev

Bug Description

As we can see here [1] an updating test case fields in test rail fails with:
Traceback (most recent call last):
  File "fuelweb_test/testrail/upload_cases_description.py", line 497, in <module>
    main()
  File "fuelweb_test/testrail/upload_cases_description.py", line 494, in main
    check_all_sections=not options.check_one_section)
  File "fuelweb_test/testrail/upload_cases_description.py", line 172, in upload_tests_descriptions
    fields_to_update = _get_fields_to_update(test_case, testrail_case)
  File "fuelweb_test/testrail/upload_cases_description.py", line 397, in _get_fields_to_update
    if test_case[field] and \
KeyError: u'custom_job_settings'

The only one reason for it could be pytest tests which haven't field `custom_job_settings` in their test_case structure [2]. Need to add this field to fix the error above.

Second error is related to the api call to `injectedEnvVars`. For example [3]. For some reason we failed on the step with a decoding json. To make code more stable we should avoid this errors.

[1] https://product-ci.infra.mirantis.net/job/10.0.system_test.test-reports/8041/console
[2] https://github.com/openstack/fuel-qa/blob/0f50e7606a5b717b480f937d81e5663068c3bc9d/fuelweb_test/testrail/upload_cases_description.py#L91-L101
[3] https://product-ci.infra.mirantis.net/job/10.0.swarm.failures_report/2195/console

Tags: area-qa
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/357915

Changed in fuel:
status: New → In Progress
Changed in fuel:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-qa (master)

Reviewed: https://review.openstack.org/357915
Committed: https://git.openstack.org/cgit/openstack/fuel-qa/commit/?id=332d1ba30f57de65a311f04568fccc9939dac39f
Submitter: Jenkins
Branch: master

commit 332d1ba30f57de65a311f04568fccc9939dac39f
Author: Alexander Kurenyshev <email address hidden>
Date: Fri Aug 19 17:23:16 2016 +0300

    Fix upload test rail cases mechanism

    1. Fix an error with abcent of `custom_job_settings` field
    for the pytest tests.
    2. Add try/except block for a getting injected vars from several jobs

    See an attached bug for more info.

    Change-Id: I0aa95fa602a8965376fb20b3a6c2f1b3d9a2ebd7
    Closes-Bug:1614985

Changed in fuel:
status: In Progress → Fix Committed
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.