diff options
author | Thibault Saunier <thibault.saunier@collabora.com> | 2012-06-19 12:06:39 -0400 |
---|---|---|
committer | Thibault Saunier <thibault.saunier@collabora.com> | 2012-06-21 10:00:09 -0400 |
commit | bb858e6f7616984b20371ebb47e95992d1af953f (patch) | |
tree | 266cf31548f566ad9c899a67d8dd8ee6d90ecdeb | |
parent | 66843256362040aea26d4e6055d09b2cc5b381e7 (diff) |
insanity: Store monitor for each iteration of start/stop
We were only storing it once for all at the end of the test and thus it was only avalaible
for the last iteration of start/stop of the test, we need it to be visible for user for each
iteration.
-rw-r--r-- | insanity/storage/dbstorage.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/insanity/storage/dbstorage.py b/insanity/storage/dbstorage.py index b4a3367..40e7651 100644 --- a/insanity/storage/dbstorage.py +++ b/insanity/storage/dbstorage.py @@ -962,6 +962,9 @@ class DBStorage(DataStorage, AsyncStorage): test.getTestName()) self.__storeTestErrorExplanationDict(tid, test.getErrorExplanations(), test.getTestName()) + # store monitor results + for monitor in test._monitorinstances: + self.__storeMonitor(monitor, tid, self.__testruns[testrun], iteration=iteration) # finally update the test updatestr = "UPDATE test SET resultpercentage=?, parentid=? WHERE id=?" @@ -992,18 +995,26 @@ class DBStorage(DataStorage, AsyncStorage): self.__storeTestExtraInfoDict(mid, extras, monitorname) self.__storeTestOutputFileDict(mid, outputfiles, monitorname) - def __storeMonitor(self, monitor, testid, testrunid): + def __storeMonitor(self, monitor, testid, testrunid, iteration=-1): debug("monitor:%r:%d", monitor, testid) # store monitor self.__storeMonitorClassInfo(monitor) monitortype = self._getTestTypeID(monitor.__monitor_name__) + if iteration != -1: + outputfiles = monitor.getIterationOutputFiles(iteration) + else: + outputfiles = monitor.getOutputFiles() + + if outputfiles is None: + outputfiles = {} + self.__rawStoreMonitor(testid, monitortype, monitor.__monitor_name__, monitor.getSuccessPercentage(), monitor.getArguments(), monitor.getCheckList(), monitor.getExtraInfo(), - monitor.getOutputFiles(), + outputfiles, testrunid) def __newTestFinished(self, testrun, test, parentid=None): @@ -1016,11 +1027,6 @@ class DBStorage(DataStorage, AsyncStorage): resultpercentage = test.getSuccessPercentage() self._ExecuteCommit(updatestr, (resultpercentage, parentid, tid)) - # store monitor results - for monitor in test._monitorinstances: - self.__storeMonitor(monitor, tid, self.__testruns[testrun]) - pass - def __getTestClassMapping(self, testtype, dictname): debug("testtype:%r, dictname:%r", testtype, dictname) |