Records the URL returned from testresults db.
Changes the URL ref from localhost to external and reports in
daily job.
Change-Id: I0068ea963671fb183779ac20592ba6933647eea0
JIRA: STORPERF-104
Signed-off-by: mbeierl <mark.beierl@dell.com>
| awk '/Status/ {print $2}' | cut -d\" -f2`
done
-
echo ==========================================================================
echo Starting full matrix run
echo ==========================================================================
| awk '/Status/ {print $2}' | cut -d\" -f2`
done
+HREF=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \
+ | awk '/TestResultURL/ {print $2}' | cut -d\" -f2 | cut -d/ -f4-`
+
echo "Deleting stack for cleanup"
curl -X DELETE --header 'Accept: application/json' 'http://127.0.0.1:5000/api/v1.0/configurations'
sudo chmod 777 -R $WORKSPACE/ci/job/carbon
+echo "Results published to: http://testresults.opnfv.org/test/$HREF"
+
exit 0
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-from sqlite3 import OperationalError
-from threading import Lock
import calendar
import logging
+from sqlite3 import OperationalError
import sqlite3
+from threading import Lock
import time
import uuid
except OperationalError:
self.logger.debug("Job params table exists")
+ try:
+ cursor.execute('''CREATE TABLE job_summary
+ (job_id text,
+ summary text)''')
+ self.logger.debug("Created job table")
+ except OperationalError:
+ self.logger.debug("Job table exists")
+
cursor.execute('SELECT * FROM jobs')
cursor.execute('SELECT * FROM job_params')
db.commit()
logger.debug(r)
logger.debug(r.status_code)
logger.debug(r.content)
- return True
+ return json.loads(r.content)
except Exception, e:
logger.error("Error [push_results_to_db('%s', '%s', '%s', " +
"'%s', '%s', '%s', '%s', '%s', '%s')]:" %
(db_url, project, case_name, pod_name, version,
scenario, criteria, build_tag, details), e)
- return False
+ return None
self.end_time = None
self.current_workload = None
self.workload_status = {}
+ self.result_url = None
self._queue_depths = [1, 4, 8]
self._block_sizes = [512, 4096, 16384]
self.event_listeners = set()
result['Status'] = status
result['Workloads'] = self.workload_status
+ result['TestResultURL'] = self.result_url
return result
self.logger.info("Completed workload %s" % (workload_name))
self.logger.info("Completed job %s" % (self.job_db.job_id))
+ if self.result_url is not None:
+ self.logger.info("Results can be found at %s" % self.result_url)
+
self.end_time = time.time()
self._terminated = True
self.broadcast_event()
import logging
import os
+from time import sleep
+import time
+
from storperf.db import test_results_db
from storperf.db.graphite_db import GraphiteDB
from storperf.utilities import data_treatment as DataTreatment
from storperf.utilities import dictionary
from storperf.utilities import math as math
from storperf.utilities import steady_state as SteadyState
-from time import sleep
-import time
class DataHandler(object):
if test_db is not None:
self.logger.info("Pushing results to %s" % (test_db))
try:
- test_results_db.push_results_to_db(test_db,
- "storperf",
- test_case,
- start_time,
- end_time,
- self.logger,
- pod_name,
- version,
- scenario,
- criteria,
- build_tag,
- payload)
+ response = test_results_db.push_results_to_db(test_db,
+ "storperf",
+ test_case,
+ start_time,
+ end_time,
+ self.logger,
+ pod_name,
+ version,
+ scenario,
+ criteria,
+ build_tag,
+ payload)
+ executor.result_url = response['href']
except:
self.logger.exception("Error pushing results into Database")
##############################################################################
import os
-from storperf.utilities.data_handler import DataHandler
import unittest
import mock
+from storperf.utilities.data_handler import DataHandler
+
class MockGraphiteDB(object):
def push_results_to_db(self, *args):
self.pushed = True
self.db_results = args
- pass
+ results = {"href": "http://localhost/api/result/uuid-that-is-long"}
+ return results
def terminate(self):
self._terminated = True
'Start time')
self.assertEqual('2017-09-04 21:20:00', self.db_results[4],
'End time')
-