diff options
author | 2016-06-13 07:26:01 +0000 | |
---|---|---|
committer | 2016-06-13 07:26:01 +0000 | |
commit | 3c539f888e8e7db4a39aa65ede339174388fe2f9 (patch) | |
tree | 2b1e8a58910e881c04e8737e32c79b7402a6b74d /utils | |
parent | db8efbd6858867124e775a96ddc4f520fe0a772d (diff) | |
parent | 8652c7157689f524e7c25f6fd5c85ed9391cfd73 (diff) |
Merge "Adapt automatic reporting to new Test API"
Diffstat (limited to 'utils')
-rw-r--r-- | utils/test/reporting/functest/reporting-tempest.py | 12 | ||||
-rw-r--r-- | utils/test/reporting/functest/reporting-vims.py | 8 | ||||
-rw-r--r-- | utils/test/reporting/functest/reportingConf.py | 4 | ||||
-rw-r--r-- | utils/test/reporting/functest/reportingUtils.py | 14 |
4 files changed, 20 insertions, 18 deletions
diff --git a/utils/test/reporting/functest/reporting-tempest.py b/utils/test/reporting/functest/reporting-tempest.py index 70fb57702..e9662d5c2 100644 --- a/utils/test/reporting/functest/reporting-tempest.py +++ b/utils/test/reporting/functest/reporting-tempest.py @@ -7,10 +7,10 @@ installers = ["apex", "compass", "fuel", "joid"] items = ["tests", "Success rate", "duration"] PERIOD = 7 - +print "Generate Tempest automatic reporting" for installer in installers: # we consider the Tempest results of the last PERIOD days - url = "http://testresults.opnfv.org/testapi/results?case=Tempest" + url = "http://testresults.opnfv.org/test/api/v1/results?case=Tempest" request = Request(url + '&period=' + str(PERIOD) + '&installer=' + installer + '&version=master') @@ -21,7 +21,7 @@ for installer in installers: except URLError, e: print 'No kittez. Got an error code:', e - test_results = results['test_results'] + test_results = results['results'] test_results.reverse() scenario_results = {} @@ -41,7 +41,7 @@ for installer in installers: # For each scenario, we build a result object to deal with # results, criteria and error handling for result in scenario_results[s]: - result["creation_date"] = result["creation_date"].split(".")[0] + result["start_date"] = result["start_date"].split(".")[0] # retrieve results # **************** @@ -96,5 +96,7 @@ for installer in installers: items=items, installer=installer) - with open("./release/index-tempest-" + installer + ".html", "wb") as fh: + with open("./release/master/index-tempest-" + + installer + ".html", "wb") as fh: fh.write(outputText) +print "Tempest automatic reporting Done" diff --git a/utils/test/reporting/functest/reporting-vims.py b/utils/test/reporting/functest/reporting-vims.py index 78ca9f5b3..5ba92d6c3 100644 --- a/utils/test/reporting/functest/reporting-vims.py +++ b/utils/test/reporting/functest/reporting-vims.py @@ -24,7 +24,7 @@ installers = ["fuel", "compass", "joid", "apex"] step_order = ["initialisation", "orchestrator", "vIMS", "sig_test"] for installer in installers: - request = Request('http://testresults.opnfv.org/testapi/results?case=vIMS&installer=' + installer) + request = Request('http://testresults.opnfv.org/test/api/v1/results?case=vIMS&installer=' + installer) try: response = urlopen(request) @@ -33,7 +33,7 @@ for installer in installers: except URLError, e: print 'No kittez. Got an error code:', e - test_results = results['test_results'] + test_results = results['results'] test_results.reverse() scenario_results = {} @@ -45,7 +45,7 @@ for installer in installers: for s, s_result in scenario_results.items(): scenario_results[s] = s_result[0:5] for result in scenario_results[s]: - result["creation_date"] = result["creation_date"].split(".")[0] + result["start_date"] = result["start_date"].split(".")[0] sig_test = result['details']['sig_test']['result'] if not sig_test == "" and isinstance(sig_test, list): format_result = sig_test_format(sig_test) @@ -77,7 +77,7 @@ for installer in installers: outputText = template.render( scenario_results = scenario_results, step_order = step_order, installer = installer) - with open("./release/index-vims" + installer + ".html", "wb") as fh: + with open("./release/master/index-vims-" + installer + ".html", "wb") as fh: fh.write(outputText) diff --git a/utils/test/reporting/functest/reportingConf.py b/utils/test/reporting/functest/reportingConf.py index e4c4548c8..e390a18d2 100644 --- a/utils/test/reporting/functest/reportingConf.py +++ b/utils/test/reporting/functest/reportingConf.py @@ -11,7 +11,7 @@ # **************************************************** installers = ["apex", "compass", "fuel", "joid"] # installers = ["compass"] -versions = ["brahmaputra", "master"] -# versions = ["master"] +# versions = ["brahmaputra", "master"] +versions = ["master"] PERIOD = 10 MAX_SCENARIO_CRITERIA = 18 diff --git a/utils/test/reporting/functest/reportingUtils.py b/utils/test/reporting/functest/reportingUtils.py index f8d64aa88..7170b8398 100644 --- a/utils/test/reporting/functest/reportingUtils.py +++ b/utils/test/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 |