-
Notifications
You must be signed in to change notification settings - Fork 92
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
[COST-4391] Test to check provider map units. #4822
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4822 +/- ##
=====================================
Coverage 93.9% 93.9%
=====================================
Files 361 361
Lines 29900 29900
Branches 3562 3562
=====================================
+ Hits 28076 28081 +5
+ Misses 1162 1160 -2
+ Partials 662 659 -3 |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
def test_units_consistency(self): | ||
"""Test if provider map used units match the report.""" | ||
file = "November-2023-None" | ||
file_name = f"{file}.csv" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker, but a separate var here here seems a bit redundant when you could just add the file extension to the file_path:
file_path = f"./koku/masu/test/data/aws/{file}.csv"
@@ -4,6 +4,7 @@ | |||
# | |||
"""Test the AWS Report views.""" | |||
import copy | |||
import csv as csv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, a nitpick and not a blocker at all but this alias seems unnecessary.
csv_units = set() | ||
file_path = f"./koku/masu/test/data/aws/{file_name}" # noqa: E501 | ||
|
||
provider_map_units = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I think it may be better to attempt to get these units directly from the provider map itself. Otherwise it just kind of feels like this test is just checking that the csv you created has these units in it?
I think we are better off with the information that is provided in the JIRA as opposed to adding a unit test. I don't think this unit test will be beneficial, especially if units change in actual AWS reports. I would prefer that we close this issue and rely on the JIRA to track this work. |
Right! Closing this. |
Jira Ticket
COST-4391
Description
This change will test if the units used in the provider_map for AWS file match the units in the downloaded CSV file.
Testing
tox -e py39 -- api.report.test.aws.test_views.AWSReportViewTest.test_units_consistency
Notes
This is merely an accessory test. The main part of the analysis is explained in the JIRA task linked above.