Skip to content

Commit 1eeec8b

Browse files
committed
don't skip for our tests
1 parent 8b2b37a commit 1eeec8b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

codeflash/discovery/functions_to_optimize.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from codeflash.telemetry.posthog_cf import ph
3131

3232
if TYPE_CHECKING:
33+
from argparse import Namespace
34+
3335
from libcst import CSTNode
3436
from libcst.metadata import CodeRange
3537

@@ -423,7 +425,7 @@ def inspect_top_level_functions_or_methods(
423425

424426

425427
def was_function_previously_optimized(
426-
function_to_optimize: FunctionToOptimize, code_context: CodeOptimizationContext
428+
function_to_optimize: FunctionToOptimize, code_context: CodeOptimizationContext, args: Namespace
427429
) -> bool:
428430
"""Check which functions have already been optimized and filter them out.
429431
@@ -445,7 +447,7 @@ def was_function_previously_optimized(
445447
owner, repo = None, None
446448
pr_number = get_pr_number()
447449

448-
if not owner or not repo or pr_number is None:
450+
if not owner or not repo or pr_number is None or args.no_pr:
449451
return False
450452

451453
code_contexts = []

codeflash/optimization/function_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def optimize_function(self) -> Result[BestOptimization, str]: # noqa: PLR0911
167167
# last time we could not find an optimization, maybe this time we do.
168168
# Random is before as a performance optimization, swapping the two 'and' statements has the same effect
169169
if random.random() > REPEAT_OPTIMIZATION_PROBABILITY and was_function_previously_optimized( # noqa: S311
170-
self.function_to_optimize, code_context
170+
self.function_to_optimize, code_context, self.args
171171
):
172172
return Failure("Function optimization previously attempted, skipping.")
173173

0 commit comments

Comments
 (0)