Skip to content

Commit fe910ca

Browse files
committed
parallelize test discovery
1 parent 6867932 commit fe910ca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

codeflash/code_utils/checkpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pathlib import Path
99
from typing import TYPE_CHECKING, Any, Optional
1010

11-
import click
11+
from rich.prompt import Confirm
1212

1313
if TYPE_CHECKING:
1414
import argparse
@@ -137,7 +137,7 @@ def ask_should_use_checkpoint_get_functions(args: argparse.Namespace) -> Optiona
137137
previous_checkpoint_functions = None
138138
if args.all and (sys.platform == "linux" or sys.platform == "darwin") and Path("/tmp").is_dir(): # noqa: S108 #TODO: use the temp dir from codeutils-compat.py
139139
previous_checkpoint_functions = get_all_historical_functions(args.module_root, Path("/tmp")) # noqa: S108
140-
if previous_checkpoint_functions and click.confirm(
140+
if previous_checkpoint_functions and Confirm.ask(
141141
"Previous Checkpoint detected from an incomplete optimization run, shall I continue the optimization from that point?",
142142
default=True,
143143
):

codeflash/optimization/optimizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ def run(self) -> None:
162162

163163
console.rule()
164164
start_time = time.time()
165-
function_to_tests: dict[str, list[FunctionCalledInTest]] = discover_unit_tests(self.test_cfg)
166-
num_discovered_tests: int = sum([len(value) for value in function_to_tests.values()])
165+
function_to_tests: dict[str, list[FunctionCalledInTest]]
166+
function_to_tests, num_discovered_tests = discover_unit_tests(self.test_cfg)
167167
console.rule()
168168
logger.info(
169169
f"Discovered {num_discovered_tests} existing unit tests in {(time.time() - start_time):.1f}s at {self.test_cfg.tests_root}"

0 commit comments

Comments
 (0)