Spaces:
Sleeping
Sleeping
Commit
·
1aaf3fc
1
Parent(s):
73b05ec
Added tests for all interview types
Browse files- tests/test_e2e.py +19 -7
tests/test_e2e.py
CHANGED
|
@@ -1,12 +1,24 @@
|
|
| 1 |
from tests.candidate import complete_interview
|
| 2 |
from tests.grader import grade
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
def test_complete_interview():
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from tests.candidate import complete_interview
|
| 2 |
from tests.grader import grade
|
| 3 |
+
from concurrent.futures import ThreadPoolExecutor
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def complete_and_grade_interview(interview_type):
|
| 7 |
+
file_path, _ = complete_interview(interview_type, "test", model="gpt-3.5-turbo")
|
| 8 |
+
feedback = grade(file_path, model="gpt-4-turbo")
|
| 9 |
+
assert feedback["overall_score"] > 0.4
|
| 10 |
+
return feedback["overall_score"]
|
| 11 |
|
| 12 |
|
| 13 |
def test_complete_interview():
|
| 14 |
+
interview_types = ["ml_design", "math", "ml_theory", "system_design", "sql", "coding"]
|
| 15 |
+
scores = []
|
| 16 |
+
|
| 17 |
+
with ThreadPoolExecutor(max_workers=3) as executor:
|
| 18 |
+
futures = [executor.submit(complete_and_grade_interview, it) for it in interview_types]
|
| 19 |
+
|
| 20 |
+
for future in futures:
|
| 21 |
+
score = future.result()
|
| 22 |
+
scores.append(score)
|
| 23 |
+
|
| 24 |
+
assert sum(scores) / len(scores) > 0.6
|