summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting/functest/testCase.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-07-04 17:23:33 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2017-08-09 16:45:43 +0200
commit354afd448cefc348f185b9adc4b5e6d38f96a3b0 (patch)
tree57c77cd4aec995f4142b24a0c1bb004ae99199cb /utils/test/reporting/functest/testCase.py
parent6b8f885df235649608e70a9a4337e8493705a32a (diff)
Initiate packetization of Testing reporting
Testing reporting provides - static reporting pages [1] (jinja2) - landing pages including test case catalogue [2] (angular) It consumes the Test API to build web pages providing status for the testing projects (so far functest, yardstick, storperf and qtip). Dockerization has been initiated [3]. The goal is to replace the static page hosted on testresults.opnfv.org by a docker regenerated and redeployed when reporting code is changed But the docker and more generally the testing reporting directory must be refactored to - manage dependencies properly - leverage tox (py27, docs, pylint, pep8) This patch - setups tox (py27, pep8, pylint, docs) - integrate the requirement management - fix pep8 errors - introduce 1 dummy unit test This patch does not - fix pylint errors - create any doc [1]: http://testresults.opnfv.org/reporting2/display/index.html [2]: http://testresults.opnfv.org/reporting2/reporting/index.html [3]: https://gerrit.opnfv.org/gerrit/#/c/36735/ Change-Id: I4613de7ca7036d6c6bbb8f58ade492b1d673599b Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'utils/test/reporting/functest/testCase.py')
-rw-r--r--utils/test/reporting/functest/testCase.py125
1 files changed, 0 insertions, 125 deletions
diff --git a/utils/test/reporting/functest/testCase.py b/utils/test/reporting/functest/testCase.py
deleted file mode 100644
index 9834f0753..000000000
--- a/utils/test/reporting/functest/testCase.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-#
-# 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 re
-
-
-class TestCase(object):
-
- def __init__(self, name, project, constraints,
- criteria=-1, isRunnable=True, tier=-1):
- self.name = name
- self.project = project
- self.constraints = constraints
- self.criteria = criteria
- self.isRunnable = isRunnable
- self.tier = tier
- display_name_matrix = {'healthcheck': 'healthcheck',
- 'vping_ssh': 'vPing (ssh)',
- 'vping_userdata': 'vPing (userdata)',
- 'odl': 'ODL',
- 'onos': 'ONOS',
- 'ocl': 'OCL',
- 'tempest_smoke_serial': 'Tempest (smoke)',
- 'tempest_full_parallel': 'Tempest (full)',
- 'tempest_defcore': 'Tempest (Defcore)',
- 'refstack_defcore': 'Refstack',
- 'rally_sanity': 'Rally (smoke)',
- 'bgpvpn': 'bgpvpn',
- 'rally_full': 'Rally (full)',
- 'vims': 'vIMS',
- 'doctor-notification': 'Doctor',
- 'promise': 'Promise',
- 'moon': 'Moon',
- 'copper': 'Copper',
- 'security_scan': 'Security',
- 'multisite': 'Multisite',
- 'domino-multinode': 'Domino',
- 'functest-odl-sfc': 'SFC',
- 'onos_sfc': 'SFC',
- 'parser-basics': 'Parser',
- 'connection_check': 'Health (connection)',
- 'api_check': 'Health (api)',
- 'snaps_smoke': 'SNAPS',
- 'snaps_health_check': 'Health (dhcp)',
- 'gluon_vping': 'Netready',
- 'fds': 'FDS',
- 'cloudify_ims': 'vIMS (Cloudify)',
- 'orchestra_ims': 'OpenIMS (OpenBaton)',
- 'opera_ims': 'vIMS (Open-O)',
- 'vyos_vrouter': 'vyos',
- 'barometercollectd': 'Barometer',
- 'odl_netvirt': 'Netvirt',
- 'security_scan': 'Security'}
- try:
- self.displayName = display_name_matrix[self.name]
- except:
- self.displayName = "unknown"
-
- def getName(self):
- return self.name
-
- def getProject(self):
- return self.project
-
- def getConstraints(self):
- return self.constraints
-
- def getCriteria(self):
- return self.criteria
-
- def getTier(self):
- return self.tier
-
- def setCriteria(self, criteria):
- self.criteria = criteria
-
- def setIsRunnable(self, isRunnable):
- self.isRunnable = isRunnable
-
- def checkRunnable(self, installer, scenario, config):
- # Re-use Functest declaration
- # Retrieve Functest configuration file functest_config.yaml
- is_runnable = True
- config_test = config
- # print " *********************** "
- # print TEST_ENV
- # print " ---------------------- "
- # print "case = " + self.name
- # print "installer = " + installer
- # print "scenario = " + scenario
- # print "project = " + self.project
-
- # Retrieve test constraints
- # Retrieve test execution param
- test_execution_context = {"installer": installer,
- "scenario": scenario}
-
- # By default we assume that all the tests are always runnable...
- # if test_env not empty => dependencies to be checked
- if config_test is not None and len(config_test) > 0:
- # possible criteria = ["installer", "scenario"]
- # consider test criteria from config file
- # compare towards CI env through CI en variable
- for criteria in config_test:
- if re.search(config_test[criteria],
- test_execution_context[criteria]) is None:
- # print "Test "+ test + " cannot be run on the environment"
- is_runnable = False
- # print is_runnable
- self.isRunnable = is_runnable
-
- def toString(self):
- testcase = ("Name=" + self.name + ";Criteria=" +
- str(self.criteria) + ";Project=" + self.project +
- ";Constraints=" + str(self.constraints) +
- ";IsRunnable" + str(self.isRunnable))
- return testcase
-
- def getDisplayName(self):
- return self.displayName