[asterisk-scf-commits] asterisk-scf/integration/testsuite.git branch "review" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Wed Jun 8 13:51:57 CDT 2011
branch "review" has been updated
via e8bc356207f07ed5ce93e93f8f2d835091aa18f2 (commit)
from ffe9d8885f789b78724c78d876af0f4fd3ae7859 (commit)
Summary of changes:
plugins/sipp.py | 1 -
remote.py | 4 ++--
testsuite.py | 15 ++++++++++++---
3 files changed, 14 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit e8bc356207f07ed5ce93e93f8f2d835091aa18f2
Author: Darren Sessions <dsessions at digium.com>
Date: Wed Jun 8 13:51:55 2011 -0500
modified the testsuite to take the build key and build number from bamboo as arguments which are then turned into a url that can be attached to the bamboo xml error to make finding the artifacts super easy! turned off some debugging on the sipp plugin. modifed the artifact log files in the remote so the file name is appended with console to make them more easily identifiable
diff --git a/plugins/sipp.py b/plugins/sipp.py
index 15b10d4..e054827 100644
--- a/plugins/sipp.py
+++ b/plugins/sipp.py
@@ -38,7 +38,6 @@ class plugin(TestSuite.RemoteBaseClass):
if results['success'] == False:
return results
if mode == 'uac':
- print results
if results['returncode'] == 1:
results['msg'] = 'At least one call failed.'
elif results['returncode'] == 97:
diff --git a/remote.py b/remote.py
index c980da0..1a52b86 100755
--- a/remote.py
+++ b/remote.py
@@ -69,9 +69,9 @@ class RemoteManagement(object):
execCmd[0] = self._which(execCmd[0])
try:
- logArtifactFile = open('%s/tmp/artifacts/%s/%s_%s.log' % (cwd, globalVars['testInfo']['testPath'], self._artifactNameCheck(plugin), self._artifactNameCheck(label)), 'w')
+ logArtifactFile = open('%s/tmp/artifacts/%s/%s_%s_console.log' % (cwd, globalVars['testInfo']['testPath'], self._artifactNameCheck(plugin), self._artifactNameCheck(label)), 'w')
except:
- return {'success':False,'msg':"[run] Unable to open '%s/tmp/artifacts/%s/%s_%s.log' for writing. %s" % (cwd, globalVars['testInfo']['testPath'], plugin, label, sys.exc_info()[1])}
+ return {'success':False,'msg':"[run] Unable to open '%s/tmp/artifacts/%s/%s_%s_console.log' for writing. %s" % (cwd, globalVars['testInfo']['testPath'], plugin, label, sys.exc_info()[1])}
if os.path.exists(execCmd[0]) and os.access(execCmd[0], os.X_OK):
p = subprocess.Popen(
diff --git a/testsuite.py b/testsuite.py
index dd9be24..65ffb30 100755
--- a/testsuite.py
+++ b/testsuite.py
@@ -11,6 +11,7 @@
'''
import os
+import re
import imp
import sys
import shutil
@@ -31,7 +32,7 @@ sys.path.append("%s/plugins" % cwd)
import yaml_parser
class __main__:
- def __init__(self):
+ def __init__(self, argv=None):
if not os.path.exists('%s/tmp' % cwd):
os.makedirs('%s/tmp' % cwd)
if not os.path.exists('%s/tmp/artifacts' % cwd):
@@ -42,6 +43,14 @@ class __main__:
pass
self.globalVars = {'cwd':cwd, 'hostname':hostname, 'testInfo':{}}
+
+ if len(argv) == 3:
+ self.globalVars['bambooBuildKey'] = argv[1]
+ self.globalVars['bambooBuildNum'] = argv[2]
+ self.globalVars['bambooBuildURL'] = 'http://bamboo.asterisk.org/artifact/%s/build-%s/Artifacts/' % (re.sub(r'SUITE-', 'SUITE/', self.globalVars['bambooBuildKey']), self.globalVars['bambooBuildNum'])
+ else:
+ print >> sys.stderr, '\nNOTE: The Bamboo build key and build number are both required to generate artifact link URLs.\n'
+
self.yamlData = yaml_parser.testcases().returnData
self.testsuite()
@@ -125,7 +134,7 @@ class __main__:
if runResults['success'] == False:
print >> sys.stderr, ' |- Test "' + testName + '" - FAILED!\n \- ' + runResults['msg']
- subTestElement, errorMsgs = xml().addFailure(subTestElement, ['%s' % runResults['msg']])
+ subTestElement, errorMsgs = xml().addFailure(subTestElement, ['%s\n%s%s' % (runResults['msg'], self.globalVars['bambooBuildURL'], self.globalVars['testInfo']['testPath'])])
if 'stop_tests_on_failure' in self.globalVars['testInfo']['testOpts']:
if self.globalVars['testInfo']['testOpts']['stop_tests_on_failure'] == True:
stopTests = True
@@ -267,4 +276,4 @@ def sigSetup():
signal.signal(signum, sigHandler)
sigSetup()
-__main__()
+__main__(sys.argv)
-----------------------------------------------------------------------
--
asterisk-scf/integration/testsuite.git
More information about the asterisk-scf-commits
mailing list