Created
December 12, 2013 08:48
Revisions
-
suside created this gist
Dec 12, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import re from subprocess import call import requests from sniffer.api import runnable @runnable def execute_tests(*args): result = call(str(args[1] + ' --verbosity 2 --nologcapture --stop --with-xunit --xunit-file=/run/shm/test_output.xml').split(' ')) == 0 file_content = open('/run/shm/test_output.xml', 'r').read() for filepath, line in reversed(re.findall('File "(.*)", line ([0-9]+)', file_content)): if 'site-packages' not in filepath: parts = filepath.split('/') le = len(parts) url = 'http://10.0.3.1:51235/file?file={}&line={}'.format(parts[le - 2] + '/' + parts[le - 1], line) requests.get(url) break return result