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

[COST-4391] Test to check provider map units. #4822

Closed
wants to merge 3 commits into from

Conversation

bacciotti
Copy link
Contributor

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

  1. Checkout Branch
  2. Restart Koku
  3. Run test 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.

@bacciotti bacciotti added the smoke-tests pr_check will build the image and run minimal required smokes label Dec 5, 2023
@bacciotti bacciotti requested review from a team as code owners December 5, 2023 14:33
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Merging #4822 (da6a3e4) into main (9999949) will increase coverage by 0.0%.
The diff coverage is n/a.

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     

Copy link

sonarcloud bot commented Dec 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bacciotti bacciotti enabled auto-merge (squash) December 12, 2023 10:04
def test_units_consistency(self):
"""Test if provider map used units match the report."""
file = "November-2023-None"
file_name = f"{file}.csv"
Copy link
Contributor

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
Copy link
Contributor

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 = [
Copy link
Contributor

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?

@maskarb
Copy link
Member

maskarb commented Jan 10, 2024

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.

@bacciotti
Copy link
Contributor Author

Right! Closing this.

@bacciotti bacciotti closed this Jan 15, 2024
auto-merge was automatically disabled January 15, 2024 10:30

Pull request was closed

@maskarb maskarb deleted the COST-4391-aws-units-consistency branch July 12, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-skip-smokes smoke-tests pr_check will build the image and run minimal required smokes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants