#!/usr/bin/env python
+
+# Copyright (c) 2016 Ericsson AB and others.
#
-# jose.lausuch@ericsson.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
-#
-import tier_handler as th
+"""TierBuilder class to parse testcases config file"""
+
import yaml
+import functest.ci.tier_handler as th
+
class TierBuilder(object):
+ # pylint: disable=missing-docstring
def __init__(self, ci_installer, ci_scenario, testcases_file):
self.ci_installer = ci_installer
self.generate_tiers()
def read_test_yaml(self):
- with open(self.testcases_file) as f:
- self.testcases_yaml = yaml.safe_load(f)
+ with open(self.testcases_file) as tc_file:
+ self.testcases_yaml = yaml.safe_load(tc_file)
self.dic_tier_array = []
for tier in self.testcases_yaml.get("tiers"):
dependency=dep,
criteria=dic_testcase['criteria'],
blocking=dic_testcase['blocking'],
- clean_flag=dic_testcase['clean_flag'],
- description=dic_testcase['description'])
- if (testcase.is_compatible(self.ci_installer, self.ci_scenario)
- and testcase.is_enabled()):
+ description=dic_testcase['description'],
+ project=dic_testcase['project_name'])
+ if (testcase.is_compatible(self.ci_installer,
+ self.ci_scenario) and
+ testcase.is_enabled()):
tier.add_test(testcase)
+ else:
+ tier.skip_test(testcase)
self.tier_objects.append(tier)