зеркало из https://github.com/mozilla/gecko-dev.git
Bug 818738 - Write all results to resultfile, not just most recent one, a=test-only
This commit is contained in:
Родитель
b8f7251de3
Коммит
baf2934865
|
@ -71,7 +71,9 @@ def main():
|
|||
config = json.loads(configcontent)
|
||||
|
||||
rlock = RLock()
|
||||
|
||||
|
||||
print 'using result file', options.resultfile
|
||||
|
||||
extensionDir = config.get("extensiondir")
|
||||
if not extensionDir or extensionDir == '__EXTENSIONDIR__':
|
||||
extensionDir = os.path.join(os.getcwd(), "..", "..", "services", "sync", "tps")
|
||||
|
|
|
@ -132,8 +132,16 @@ class TPSTestRunner(object):
|
|||
print msg
|
||||
|
||||
def writeToResultFile(self, postdata, body=None,
|
||||
sendTo='crossweave@mozilla.com'):
|
||||
sendTo=['crossweave@mozilla.com']):
|
||||
"""Writes results to test file"""
|
||||
|
||||
results = {'results': []}
|
||||
|
||||
if os.access(self.resultfile, os.F_OK):
|
||||
f = open(self.resultfile, 'r')
|
||||
results = json.loads(f.read())
|
||||
f.close()
|
||||
|
||||
f = open(self.resultfile, 'w')
|
||||
if body is not None:
|
||||
postdata['body'] = body
|
||||
|
@ -145,8 +153,7 @@ class TPSTestRunner(object):
|
|||
postdata['firefoxrunnerurl'] = self.firefoxRunner.url
|
||||
|
||||
postdata['sendTo'] = sendTo
|
||||
results = {}
|
||||
results['results'] = postdata
|
||||
results['results'].append(postdata)
|
||||
f.write(json.dumps(results, indent=2))
|
||||
f.close()
|
||||
|
||||
|
@ -339,7 +346,13 @@ class TPSTestRunner(object):
|
|||
traceback.print_exc()
|
||||
else:
|
||||
try:
|
||||
self.writeToResultFile(self.postdata)
|
||||
|
||||
if self.numfailed > 0 or self.numpassed == 0:
|
||||
To = self.config['email'].get('notificationlist')
|
||||
else:
|
||||
To = self.config['email'].get('passednotificationlist')
|
||||
self.writeToResultFile(self.postdata,
|
||||
sendTo=To)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
try:
|
||||
|
|
Загрузка…
Ссылка в новой задаче