adding post worker script
This commit is contained in:
@@ -20,17 +20,22 @@ with tarfile.open(output_filename, "w:gz") as tar:
|
||||
|
||||
tar.close()
|
||||
|
||||
file_dest = os.environ['HOME'] + '/results/' + os.environ['TDDIUM_SESSION_ID'] + '/session/reports.tar.gz'
|
||||
session_path = os.environ['HOME'] + '/results/' + os.environ['TDDIUM_SESSION_ID'] + '/session/'
|
||||
file_dest = session_path + 'reports.tar.gz'
|
||||
|
||||
# if the tar file is not empty, copy it to the proper place
|
||||
if count > 0:
|
||||
shutil.copyfile(output_filename, file_dest)
|
||||
print "done copying file"
|
||||
print 'done copying file'
|
||||
|
||||
# TODO: fold the remaining bash script into the Python script
|
||||
# finding if there is any screenshots
|
||||
# print "checking for screenshots"
|
||||
# for (path, dirs, files) in os.walk('test_root/log'):
|
||||
# print files
|
||||
# finding if there is any screenshot or log file
|
||||
print 'attaching failed screenshots and logs (if any)'
|
||||
for (path, dirs, files) in os.walk('test_root/log'):
|
||||
for filename in files:
|
||||
if filename.find('png') != -1 or filename.find('log') != -1:
|
||||
filepath = path + filename
|
||||
print 'copying file:', filepath
|
||||
destpath = session_path + filename
|
||||
shutil.copyfile(filepath, destpath)
|
||||
|
||||
print "TDDIUM_SESSION_ID:", os.environ['TDDIUM_SESSION_ID']
|
||||
print 'TDDIUM_SESSION_ID:', os.environ['TDDIUM_SESSION_ID']
|
||||
@@ -8,7 +8,7 @@ tddium:
|
||||
:hooks:
|
||||
:pre_setup: "virtualenv $HOME/python-env && $HOME/python-env/bin/pip install -r requirements/edx/paver.txt && $HOME/python-env/bin/pip install -r requirements/edx/pre.txt && $HOME/python-env/bin/pip install -r requirements/edx/base.txt && $HOME/python-env/bin/pip install -r requirements/edx/github.txt && $HOME/python-env/bin/pip install -r requirements/edx/local.txt && $HOME/python-env/bin/pip install -r requirements/edx/post.txt"
|
||||
# :post_build: "paver coverage; paver bokchoy_coverage; for i in $(find reports -name cover); do cp -R $i $HOME/results/$TDDIUM_SESSION_ID/session/; done"
|
||||
:post_worker: 'python ./scripts/post_worker.py; echo "attaching failed screenshots (if any)"; for i in $(find test_root/log -name *.png); do cp -R $i $HOME/results/$TDDIUM_SESSION_ID/session/; echo "copying file $i"; done'
|
||||
:post_worker: 'python ./scripts/post_worker.py'
|
||||
:cache:
|
||||
:key_paths:
|
||||
- requirements/edx/paver.txt
|
||||
|
||||
Reference in New Issue
Block a user