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

Add richer set of errors caught #627

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

mrchrisadams
Copy link
Member

This pull request includes updates to the apps/greencheck module to handle additional ASN-related exceptions and improve the robustness of the domain checker. The most important changes include expanding the list of exceptions handled in the check_for_matching_asn method and updating the corresponding tests to ensure all new exceptions are properly caught and logged.

Exception Handling Improvements:

  • apps/greencheck/domain_check.py: Added new ASN-related exceptions (ASNRegistryError, ASNOriginLookupError, ASNLookupError) to the import list and updated the check_for_matching_asn method to handle these exceptions. [1] [2]

Test Enhancements:

  • apps/greencheck/tests/test_domain_checker.py: Modified the test_asn_from_ip_fails_gracefully_with_bad_asn_lookup test to use pytest.mark.parametrize for testing multiple exception types, ensuring that all new exceptions are properly caught and logged.

@mrchrisadams mrchrisadams merged commit 9698a17 into master Nov 15, 2024
4 checks passed
Copy link

github-actions bot commented Nov 15, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 13.3275 800.424 3.02 265
checkout 7.06 3.52831 1.76 2
pip install uv wheel 7.18 3.52931 1.76 2
pip install requirements 64.278 31.5134 6.30 5
pytest 12.1963 761.853 3.01 253

🌳 CO2 Data:
City: Washington, Lat: 38.7095, Lon: -78.1539
IP: 20.42.106.72
CO₂ from energy is: 0.314566632 g
CO₂ from manufacturing (embodied carbon) is: 0.075608159 g
Carbon Intensity for this location: 393 gCO₂eq/kWh
SCI: 0.390175 gCO₂eq / pipeline run emitted

Copy link

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 13.3446 826.182 3.00 275
checkout 9.65 3.61876 3.62 1
pip install uv wheel 22.94 12.0853 4.03 3
pip install requirements 65.582 31.6526 5.28 6
pytest 12.1317 778.826 2.98 261

🌳 CO2 Data:
City: Boydton, Lat: 36.6676, Lon: -78.3875
IP: 74.249.13.177
CO₂ from energy is: 0.324689526 g
CO₂ from manufacturing (embodied carbon) is: 0.078461297 g
Carbon Intensity for this location: 393 gCO₂eq/kWh
SCI: 0.403151 gCO₂eq / pipeline run emitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant