Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing bad reference to self.last_coverage_percentages #262

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading