Skip to content

Commit 8fe2232

Browse files
author
Codeflash Bot
committed
validate stdout for gen tests
1 parent fa22744 commit 8fe2232

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/scripts/end_to_end_test_utilities.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ def validate_coverage(stdout: str, expectations: list[CoverageExpectation]) -> b
7676

7777
return True
7878

79+
def validate_no_gen_tests(stdout: str) -> bool:
80+
if "Generated '0' tests for" not in stdout:
81+
logging.error("Tests generated even when flag was on")
82+
return False
83+
return True
7984

8085
def run_codeflash_command(
8186
cwd: pathlib.Path, config: TestConfig, expected_improvement_pct: int, expected_in_stdout: list[str] = None
@@ -178,6 +183,9 @@ def validate_output(stdout: str, return_code: int, expected_improvement_pct: int
178183
if config.coverage_expectations:
179184
validate_coverage(stdout, config.coverage_expectations)
180185

186+
if config.no_gen_tests:
187+
validate_no_gen_tests(stdout)
188+
181189
logging.info(f"Success: Performance improvement is {improvement_pct}%")
182190
return True
183191

0 commit comments

Comments
 (0)