[testrail] TC uploading fails: 'ValueError: Environment variable ENV_NAME is not set from shell environment!'

Bug #1521986 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

Tests cases uploading to the TestRail suite fails if some env variable from templates doesn't have default value:

Traceback (most recent call last):
  File "fuelweb_test/testrail/upload_cases_description.py", line 251, in <module>
    main()
  File "fuelweb_test/testrail/upload_cases_description.py", line 242, in main
    default_test_priority=testrail_default_test_priority
  File "fuelweb_test/testrail/upload_cases_description.py", line 74, in get_tests_descriptions
    case_state.instance._load_config()
  File "/home/jenkins/workspace/8.0-test-reports-Testrail/system_test/tests/actions_base.py", line 48, in _load_config
    config = load_yaml(self.config_file)
  File "/home/jenkins/workspace/8.0-test-reports-Testrail/system_test/helpers/utils.py", line 107, in load_yaml
    return yaml.load(open(path))
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 39, in get_single_data
    return self.construct_document(node)
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 48, in construct_document
    for dummy in generator:
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 398, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 208, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 133, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 88, in construct_object
    data = constructor(self, node)
  File "/home/jenkins/workspace/8.0-test-reports-Testrail/system_test/helpers/utils.py", line 78, in yaml_include
    return yaml.load(open(file_name))
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 39, in get_single_data
    return self.construct_document(node)
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 48, in construct_document
    for dummy in generator:
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 398, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 208, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 133, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/home/jenkins/venv-nailgun-tests-2.9/local/lib/python2.7/site-packages/yaml/constructor.py", line 88, in construct_object
    data = constructor(self, node)
  File "/home/jenkins/workspace/8.0-test-reports-Testrail/system_test/helpers/utils.py", line 100, in yaml_get_env_variable
    filename=loader.name))
ValueError: Environment variable ENV_NAME is not set from shell environment! No default value provided in file /home/jenkins/workspace/8.0-test-reports-Testrail/system_test/tests_templates/devops_configs/default.yaml

Dmitry Klenov (dklenov)
Changed in fuel:
status: New → Confirmed
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/252400

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

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

commit df265316a2617f39f962893e36f1d0a7e68fe6f3
Author: Artem Panchenko <email address hidden>
Date: Wed Dec 2 15:48:22 2015 +0200

    Add default values for env variables (TestRail)

    There are commonly used variables ENV_NAME and ISO_PATH
    which are required for template based tests initialization.

    Change-Id: I507afbc58c6c4968e5f023efb690807f565bf5eb
    Closes-bug: #1521986

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