-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtester.py
More file actions
43 lines (37 loc) · 1.04 KB
/
tester.py
File metadata and controls
43 lines (37 loc) · 1.04 KB
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
37
38
39
40
41
42
43
# -*- coding: UTF-8 -*-
"""Run a lightweight test set on specific students."""
import os
import time
from mark_functions import RunCmd
LOCAL = os.path.dirname(os.path.realpath(__file__))
week_number = 1
repos = ["code1161benFork_fully_working_secret_squirel"]
times = []
repos = ["YUHA0JIANG"]
results = []
for name in repos:
timeout_cap = 25
args = [
"python",
"test_shim.py", # if this breaks, it might need ./ on the front
f"../course/set{week_number}/tests.py",
f"../StudentRepos/{name}",
name,
]
print(args)
start_time = time.time()
try:
RunCmd(args, timeout_cap).Run()
with open(
os.path.abspath(os.path.join("temp", "temp_results.json")),
"r",
encoding="utf-8",
) as trf:
results.append(trf.read())
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)