File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from dataclasses import dataclass , asdict
1010import warnings
1111import json
12+ import os
1213
1314TEST_RESULT_PATH = Path ("/var/test_result" )
1415DEFAULT_TASK_NAME = 'default'
@@ -119,6 +120,11 @@ def run_tests() -> None:
119120 has_multiple_tasks = len (__registered_tasks ) > 1
120121 task_test_results : ty .List [_TestResult ] = []
121122
123+ # This is set by task.py if the user only wants to run a subset of tests.
124+ only_run_these_tasks = os .environ .get ("ONLY_RUN_THESE_TASKS" )
125+ if only_run_these_tasks :
126+ only_run_these_tasks = only_run_these_tasks .split (":" )
127+
122128 # Run all sub-tasks one after another.
123129 for task_name , tests in __registered_tasks .items ():
124130 task_passed = True
@@ -127,6 +133,9 @@ def run_tests() -> None:
127133
128134 if has_multiple_tasks :
129135 print_ok (f'[+] *** Running tests for task \" { task_name } \" ***' )
136+ if only_run_these_tasks and task_name not in only_run_these_tasks :
137+ print_ok (f"[+] User requested to exclude task, skipping..." )
138+ continue
130139
131140 if tests .env_tests and not tests .submission_test and not tests .extended_submission_test :
132141 raise RefUtilsError ("Using @environment_test without @submission_test or @extended_submission_test is not allowed" )
You can’t perform that action at this time.
0 commit comments