Skip to content

Commit a6da525

Browse files
Don't display result if INIT_STATE_TEST
1 parent c93a7ca commit a6da525

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

codeflash/github/PrComment.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ class PrComment:
2020
winning_benchmarking_test_results: TestResults
2121

2222
def to_json(self) -> dict[str, Union[dict[str, dict[str, int]], int, str]]:
23+
24+
report_table = {
25+
test_type.to_name(): result
26+
for test_type, result in self.winning_behavioral_test_results.get_test_pass_fail_report_by_type().items()
27+
if test_type.should_display_result()
28+
}
29+
2330
return {
2431
"optimization_explanation": self.optimization_explanation,
2532
"best_runtime": humanize_runtime(self.best_runtime),
@@ -29,10 +36,7 @@ def to_json(self) -> dict[str, Union[dict[str, dict[str, int]], int, str]]:
2936
"speedup_x": self.speedup_x,
3037
"speedup_pct": self.speedup_pct,
3138
"loop_count": self.winning_benchmarking_test_results.number_of_loops(),
32-
"report_table": {
33-
test_type.to_name(): result
34-
for test_type, result in self.winning_behavioral_test_results.get_test_pass_fail_report_by_type().items()
35-
},
39+
"report_table": report_table
3640
}
3741

3842

codeflash/verification/test_results.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class TestType(Enum):
3030
CONCOLIC_COVERAGE_TEST = 5
3131
INIT_STATE_TEST = 6
3232

33+
def should_display(self) -> bool:
34+
return self != TestType.INIT_STATE_TEST
35+
3336
def to_name(self) -> str:
3437
if self == TestType.INIT_STATE_TEST:
3538
return ""

0 commit comments

Comments
 (0)