project-koku / nise

A tool for generating sample cost usage data for testing purposes
GNU Affero General Public License v3.0
9 stars 15 forks source link

Add currency support #380

Closed shannon-donahue closed 2 years ago

shannon-donahue commented 2 years ago

Adding the ability to pass in currency argument -c where you can pass in a currency code to get reports in foreign currencies to test MVP currency.

Testing instructions:

  1. checkout and pull branch
  2. Create reports for AWS, Azure, and GCP
    
    AWS report:
    nise report -c jpy aws --static-report-file ./example_aws_static_data.yml --aws-s3-report-name <directory_name> --aws-s3-bucket-name ./

Azure Report: nise report -c nok azure --static-report-file ./example_azure_static_data.yml --azure-report-name --azure-container-name ./

GCP Report: nise report -c jpy gcp -s 2021-01-01 -e 2021-01-02 --gcp-report-prefix --gcp-bucket-name ./

3. check reports for currency to see if it matches in passed in value, valid currency options below

valid_currencies = [ "aud", "cad", "chf", "cny", "dkk", "eur", "gbp", "hkd", "jpy", "nok", "nzd", "sek", "sgd", "usd", "zar", ]

4. If the currency code is not in support list

nise report: error: argument -c/--currency: nkd is an unsupported currency code.


5. If no code is given should default currency to USD
codecov[bot] commented 2 years ago

Codecov Report

Merging #380 (d56d16d) into master (90d5c9a) will decrease coverage by 0.1%. The diff coverage is 94.7%.

@@           Coverage Diff            @@
##           master    #380     +/-   ##
========================================
- Coverage    93.5%   93.4%   -0.1%     
========================================
  Files          50      50             
  Lines        3916    3943     +27     
  Branches      551     555      +4     
========================================
+ Hits         3661    3681     +20     
- Misses        142     146      +4     
- Partials      113     116      +3