#
# v0.1: basic example
#
-import os
import re
import sys
from functest2Dashboard import format_functest_for_dashboard, \
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
+ cmd = "check_" + project + "_case_exist"
+ return globals()[cmd](case)
def get_dashboard_projects():
# 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
+ cmd = "format_" + project + "_for_dashboard"
+ return globals()[cmd](case, results)