diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-06-01 15:36:17 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-06-01 16:21:46 +0800 |
commit | a55651eb098da2e1aa90c93294a59857711b48c1 (patch) | |
tree | 654e3adace1e4ae1690d9612c5d7b1704a607a5e /utils/test/result_collection_api/dashboard/dashboard_utils.py | |
parent | e0d66ea067ea59724c1dc300abe8052d4dcf88d1 (diff) |
project-ize testAPI
JIRA: FUNCTEST-284
Change-Id: I219e934bb11f50de84df2aa0345ecc7885223491
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/result_collection_api/dashboard/dashboard_utils.py')
-rw-r--r-- | utils/test/result_collection_api/dashboard/dashboard_utils.py | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/utils/test/result_collection_api/dashboard/dashboard_utils.py b/utils/test/result_collection_api/dashboard/dashboard_utils.py deleted file mode 100644 index 9de5b191c..000000000 --- a/utils/test/result_collection_api/dashboard/dashboard_utils.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2015 Orange -# morgan.richomme@orange.com -# -# 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 -# -# This script is used to retieve data from test DB -# and format them into a json format adapted for a dashboard -# -# v0.1: basic example -# -import os -import re -import sys -from functest2Dashboard import format_functest_for_dashboard, \ - check_functest_case_exist -from yardstick2Dashboard import format_yardstick_for_dashboard, \ - check_yardstick_case_exist -from vsperf2Dashboard import format_vsperf_for_dashboard, \ - check_vsperf_case_exist -from bottlenecks2Dashboard import format_bottlenecks_for_dashboard, \ - check_bottlenecks_case_exist -from qtip2Dashboard import format_qtip_for_dashboard, \ - check_qtip_case_exist -from promise2Dashboard import format_promise_for_dashboard, \ - check_promise_case_exist -from doctor2Dashboard import format_doctor_for_dashboard, \ - check_doctor_case_exist - -# any project test project wishing to provide dashboard ready values -# must include at least 2 methods -# - format_<Project>_for_dashboard -# - check_<Project>_case_exist - - -def check_dashboard_ready_project(test_project): - # Check that the first param corresponds to a project - # for whoch dashboard processing is available - # print("test_project: %s" % test_project) - project_module = 'dashboard.'+test_project + '2Dashboard' - return True if project_module in sys.modules else False - - -def check_dashboard_ready_case(project, case): - cmd = "check_" + project + "_case_exist(case)" - return eval(cmd) - - -def get_dashboard_cases(): - # Retrieve all the test cases that could provide - # Dashboard ready graphs - # look in the releng repo - # search all the project2Dashboard.py files - # we assume that dashboard processing of project <Project> - # is performed in the <Project>2Dashboard.py file - modules = [] - cp = re.compile('dashboard.*2Dashboard') - for module in sys.modules: - if re.match(cp, module): - modules.append(module) - - return modules - - -def get_dashboard_result(project, case, results=None): - # get the dashboard ready results - # paramters are: - # project: project name - # results: array of raw results pre-filterded - # according to the parameters of the request - cmd = "format_" + project + "_for_dashboard(case,results)" - res = eval(cmd) - return res |