Skip to content

Commit 1a476be

Browse files
committed
Displaying progress during compiles.
. all good F for compile failure at least in one board O for open failure E for error (exception thrown) during compile U for unsupported sketch/example (its required boards list is an empty list at boards_db.json The last compile that failed some way, affects the status of the indicator.
1 parent ce4d105 commit 1a476be

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

codebender_testing/utils.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import random
88
import os
99
import re
10+
import sys
1011
import shutil
1112
import tempfile
1213
import simplejson
@@ -516,6 +517,7 @@ def compile_sketches(self, sketches, iframe=False, logfile=None, compile_type='s
516517
if sketch not in log_entry:
517518
log_entry[sketch] = {}
518519

520+
test_status = '.'
519521
# Log the compilation results
520522
openFailFlag = False
521523
for result in results:
@@ -526,16 +528,20 @@ def compile_sketches(self, sketches, iframe=False, logfile=None, compile_type='s
526528
log_entry[sketch]['success'].append(result['board'])
527529
elif result['status'] == 'fail':
528530
log_entry[sketch]['fail'].append(result['board'])
531+
test_status = 'F'
529532
elif result['status'] == 'open_fail':
530533
log_entry[sketch]['open_fail'] = True
531534
openFailFlag = True
535+
test_status = 'O'
532536
elif result['status'] == 'error':
533537
log_entry[sketch]['error'].append({
534538
'board': result['board'],
535539
'error': result['message']
536540
})
541+
test_status = 'E'
537542
elif result['status'] == 'unsupported':
538543
log_entry[sketch]['unsupported'] = True
544+
test_status = 'U'
539545

540546
# Update Disqus comments
541547
if compile_type == 'library' and comment:
@@ -545,7 +551,9 @@ def compile_sketches(self, sketches, iframe=False, logfile=None, compile_type='s
545551
with open(log_file, 'w') as f:
546552
f.write(jsondump(log_entry))
547553

548-
print '.',
554+
# Display progress
555+
sys.stdout.write(test_status)
556+
sys.stdout.flush()
549557

550558
toc = time.time()
551559
if toc - tic >= SAUCELABS_TIMEOUT_SECONDS:

0 commit comments

Comments
 (0)