Skip to content

Commit

Permalink
Removing bad reference to self.last_coverage_percentages causing nece…
Browse files Browse the repository at this point in the history
…ssary failure logs (#262)
  • Loading branch information
kelper-hub authored Jan 9, 2025
1 parent 5c8ca2c commit 1b1a9ad
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cover_agent/UnitTestValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ def validate_test(self, generated_test: dict):
if exit_code != 0:
break


# Step 3: Check for pass/fail from the Runner object
if exit_code != 0:
# Test failed, roll back the test file to its original content
Expand Down Expand Up @@ -571,13 +570,13 @@ def validate_test(self, generated_test: dict):
old_v: CoverageData = self.current_coverage_report.file_coverage[key]
if new_v.coverage > old_v.coverage and key == self.source_file_path.split("/")[-1]:
self.logger.info(
f"Coverage for provided source file: {key} increased from {round(self.last_coverage_percentages[key] * 100, 2)} to {round(new_v.coverage * 100, 2)}"
f"Coverage for provided source file: {key} increased to {round(new_v.coverage * 100, 2)}"
)
elif new_v.coverage > old_v.coverage:
self.logger.info(
f"Coverage for non-source file: {key} increased from {round(self.last_coverage_percentages[key] * 100, 2)} to {round(new_v.coverage * 100, 2)}"
f"Coverage for non-source file: {key} increased to {round(new_v.coverage * 100, 2)}"
)

self.logger.info(
f"Test passed and coverage increased. Current coverage: {round(new_coverage_report.total_coverage * 100, 2)}%"
)
Expand Down

0 comments on commit 1b1a9ad

Please sign in to comment.