forked from zenoss/ZenPacks.zenoss.MySqlMonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CI.py
25 lines (21 loc) · 694 Bytes
/
CI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
import time
def main():
while True:
run_time = time.time()
status = os.system('make test')
run_time = time.time() - run_time
print '!' * 100, run_time
if status == 2:
print 'Looks like Ctrl+C. Stopping.'
return
if status == 0:
os.system('notify-send -t 1000 OK "all tests passed. '
'Run time: %s s"' % int(run_time))
print '\n'*5, 'Now wait a minute...'
time.sleep(60)
else:
os.system('notify-send -t %s FAIL "something wrong with the code"'
% int(run_time * 1000))
if __name__ == '__main__':
main()