Skip to content
Snippets Groups Projects
Commit 04e2ddda authored by Tamas Kis's avatar Tamas Kis
Browse files

[master] Nighttly test script is reposrting console output in junit.xml. (Pytest is not

working in test environment)

Signed-off-by: default avatarTamas Levente Kiss <tamas.levente.kiss@ericsson.com>
parent c952913b
No related branches found
No related merge requests found
......@@ -3,9 +3,34 @@
#// terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at //
#// http://www.eclipse.org/legal/epl-v10.html //
#///////////////////////////////////////////////////////////////////////////////////////////////////////
#!/usr/bin/env python
import sys, os
import sys, os, subprocess
os.system('./createOfflineWebGUI.sh');
os.system('cd WebGUI/htdocs/Selenium; ./runTestsWithXvfb.sh');
os.system('cd WebGUI; ./deleteOfflineWebGUI.sh');
gitPath = os.path.dirname(os.path.abspath(sys.argv[3]))
commandStr = 'cd ' + gitPath + '/test/; ./createOfflineWebGUI.sh'
os.system(commandStr);
commandStr = 'cd ' + gitPath + '/test/WebGUI/htdocs/Selenium; ./runTestsWithXvfb.sh'
result = subprocess.check_output(commandStr, stderr = subprocess.STDOUT, shell=True)
commandStr = 'cd ' + gitPath + '/test/WebGUI/; ./deleteOfflineWebGUI.sh'
os.system(commandStr);
lines = result.splitlines()
failstring = '<failure type="Error">Check console output below for more information.</failure>'
nroffailures = 1;
if 'OK' in lines[-1]:
failstring = ''
nroffailures = 0;
with open(sys.argv[3], "w") as text_file:
text_file.write('''
<testsuite tests="1" failures="''' + str(nroffailures) + '''">
<testcase classname="test1" name="test1">
''' + failstring + '''
</testcase>
<system-out>''' + result + '''</system-out>
<system-err>''' + lines[-1] + '''</system-err>
</testsuite>
''')
sys.exit(1) if nroffailures else sys.exit(0)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment