Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Automated test to validate chargeback report #2792

Merged
merged 1 commit into from
Aug 12, 2016

Conversation

nachandr
Copy link
Contributor

No description provided.

@nachandr nachandr changed the title [WIP}Automated test to validate chargeback report [WIP]Automated test to validate chargeback report Mar 18, 2016
def cleanup_report(report):
return lambda: _cleanup_report(report)

request.addfinalizer(cleanup_report(report))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@request.addfinalizer
def cleanup():
    _cleanup_report(report)

@dajoRH dajoRH added needs-lint and removed lint-ok labels May 6, 2016
enterprise.storageassign()


class cost:
Copy link
Contributor

@psav psav May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things here,
(1 Why use a class for this? Wouldn't a dict do?
(2 Is it supposed to be instantiated and used at the module level?

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 251b168 on nachandr:validate_chargeback_report into 40e256d on RedHatQE:master.

@nachandr nachandr force-pushed the validate_chargeback_report branch 2 times, most recently from 10079d9 to 794dcc2 Compare June 13, 2016 13:09
@nachandr nachandr changed the title [WIP]Automated test to validate chargeback report Automated test to validate chargeback report Jun 13, 2016
@dajoRH dajoRH removed the WIP label Jun 13, 2016
@nachandr nachandr force-pushed the validate_chargeback_report branch 2 times, most recently from d901b3f to 4393f80 Compare June 14, 2016 10:55
for i, argvalue_tuple in enumerate(argvalues):
args = dict(zip(argnames, argvalue_tuple))

try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section shouldn't be needed as you have the required fields above on line 20

@nachandr nachandr force-pushed the validate_chargeback_report branch 3 times, most recently from 09e5997 to 680ab4d Compare June 22, 2016 12:21
@mfalesni
Copy link
Contributor

@nachandr The tests are missing tier marker, also maybe the test comments (descriptions) could be more elaborate with steps.

@nachandr nachandr force-pushed the validate_chargeback_report branch 2 times, most recently from 229578d to 7c6e76c Compare June 29, 2016 15:15
average_network_io = resource_usage['average_network_io']
average_disk_io = resource_usage['average_disk_io']

# Estimate Chargeback costs using default Chargeback rate and resource usage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def calc_rate(rate_name, description, type)
    with db.transaction:
        providers = (
            db.session.query(details.id)
            .join(rates, details.chargeback_rate_id == rates.id)
            .filter(details.metric == rate_name, rates.description == description,
                rates.rate_type == type)
        )
        cpu_rate = db.session.query(details).filter(details.id.in_(
            providers.subquery())).first().rate

cpu_rate = calc_rate('cpu_usagemhz_rate_average', 'Default', 'Compute')
cpu_used_cost = average_cpu_used_in_mhz * float(cpu_rate) / 24

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psav Done.Taken care of that.

@nachandr nachandr force-pushed the validate_chargeback_report branch from 1512c9a to ac88ac9 Compare July 7, 2016 10:51
@nachandr nachandr changed the title Automated test to validate chargeback report [WIP]Automated test to validate chargeback report Jul 13, 2016
@dajoRH dajoRH added the WIP label Jul 15, 2016
@nachandr nachandr changed the title [WIP]Automated test to validate chargeback report Automated test to validate chargeback report Jul 15, 2016
@dajoRH dajoRH removed the WIP label Jul 15, 2016
@nachandr nachandr force-pushed the validate_chargeback_report branch 6 times, most recently from 87cc170 to 0b7d2ed Compare July 21, 2016 09:37
cb_group = ac.Group(description='EvmGroup-super_administrator')
user = ac.User(name=provider.name + fauxfactory.gen_alphanumeric(),
credential=new_credential(),
email='[email protected]',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@example.com for example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@nachandr nachandr force-pushed the validate_chargeback_report branch 3 times, most recently from 9510eb6 to 3c8417a Compare July 21, 2016 12:20
@nachandr nachandr force-pushed the validate_chargeback_report branch 6 times, most recently from 31a043c to 21d3faf Compare August 11, 2016 19:10
@dajoRH dajoRH removed the reviewed label Aug 12, 2016
@dajoRH
Copy link
Contributor

dajoRH commented Aug 12, 2016

Lint report for commit 7093bf5:

Everything seems all right 😄 .
CFME QE Bot

@dajohnso dajohnso merged commit 26aca56 into ManageIQ:master Aug 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants