diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-06-10 17:15:28 +0200 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2016-06-10 17:53:56 +0200 |
commit | 80d33f2c7d9dfb238de1d32540e6968215def2b6 (patch) | |
tree | c22839ddc72888fcbb9397ff6168cdabbc9abb78 /reporting/functest/reportingUtils.py | |
parent | e3c312c23b45f50b583f42dadfa15f60a7544359 (diff) |
Adapt automatic reporting to new Test API
JIRA: FUNCTEST-303
Change-Id: Ie9cb7151301ab2c26a72746683c35305ba560bbc
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'reporting/functest/reportingUtils.py')
-rw-r--r-- | reporting/functest/reportingUtils.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/reporting/functest/reportingUtils.py b/reporting/functest/reportingUtils.py index f8d64aa..7170b83 100644 --- a/reporting/functest/reportingUtils.py +++ b/reporting/functest/reportingUtils.py @@ -19,7 +19,7 @@ def getApiResults(case, installer, scenario, version): # urllib2.install_opener(opener) # url = "http://127.0.0.1:8000/results?case=" + case + \ # "&period=30&installer=" + installer - url = ("http://testresults.opnfv.org/testapi/results?case=" + case + + url = ("http://testresults.opnfv.org/test/api/v1/results?case=" + case + "&period=" + str(reportingConf.PERIOD) + "&installer=" + installer + "&scenario=" + scenario + "&version=" + version) request = Request(url) @@ -37,7 +37,8 @@ def getApiResults(case, installer, scenario, version): def getScenarios(case, installer, version): case = case.getName() - url = ("http://testresults.opnfv.org/testapi/results?case=" + case + + print case + url = ("http://testresults.opnfv.org/test/api/v1/results?case=" + case + "&period=" + str(reportingConf.PERIOD) + "&installer=" + installer + "&version=" + version) request = Request(url) @@ -46,11 +47,10 @@ def getScenarios(case, installer, version): response = urlopen(request) k = response.read() results = json.loads(k) + test_results = results['results'] except URLError, e: print 'Got an error code:', e - test_results = results['test_results'] - if test_results is not None: test_results.reverse() @@ -78,7 +78,7 @@ def getNbtestOk(results): for r in results: for k, v in r.iteritems(): try: - if "passed" in v: + if "PASS" in v: nb_test_ok += 1 except: print "Cannot retrieve test status" @@ -90,7 +90,7 @@ def getResult(testCase, installer, scenario, version): # retrieve raw results results = getApiResults(testCase, installer, scenario, version) # let's concentrate on test results only - test_results = results['test_results'] + test_results = results['results'] # if results found, analyze them if test_results is not None: @@ -106,7 +106,7 @@ def getResult(testCase, installer, scenario, version): for r in test_results: # print r["creation_date"] # print r["criteria"] - scenario_results.append({r["creation_date"]: r["criteria"]}) + scenario_results.append({r["start_date"]: r["criteria"]}) # sort results scenario_results.sort() # 4 levels for the results |