-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathtester.py
36 lines (31 loc) · 1.11 KB
/
tester.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
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: UTF-8 -*-
"""Run a lightweight test set on specific students."""
from codeHelpers import RunCmd
import os
import time
LOCAL = os.path.dirname(os.path.realpath(__file__))
week_number = 4
repos = ["code1161benFork_fully_working_secret_squirel"]
times = []
repos = ["alanw410", "bvn-architecture","alanw410", "bvn-architecture","alanw410", "bvn-architecture","alanw410", "bvn-architecture","alanw410", "bvn-architecture"] # "bvn-architecture"
results = []
for name in repos:
start_time = time.time()
try:
timeout_cap = 25
args = ['python',
'./test_shim.py',
"week{}.tests".format(week_number),
"../code1161StudentRepos/{}".format(name)]
print args
RunCmd(args, timeout_cap).Run()
temp_results = open(os.path.join(LOCAL, 'temp_results.json'), 'r')
results.append(temp_results.read())
temp_results.close()
except Exception as e:
print e
elapsed_time = time.time() - start_time
print "Time to test:", elapsed_time
times.append({"name": name, "time": elapsed_time})
print results
print times