This repository has been archived by the owner on Apr 7, 2022. It is now read-only.
[1LP][RFR] Chargeback resource allocation fixes #10183
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes several changes to the resource allocation chargeback tests. Important changes of note:
chargeback_vm
fixture to return the name of the chargeback VM from the provider data, instead of looking it up each time in the various fixtures / tests.pytest.yield_fixture
decorators withpytest.fixture
.vim_performance_states
table before capturing metrics data. Failure to do so could result in metrics data with the wrong provider id (if the provider previously existed on the appliance with one id then was deleted and re-created prior to these tests running).None
(i.e., no value exists for that column), then change it to zero before callingfloat()
, to avoidTypeError
exceptions.cfme/fixtures/
so that they can be shared with other chargeback test modules.num_hours = 1
. But if the VM already existed in the db and has a 'State Changed On' field earlier than that hourly rollup's timestamp, thennum_hours
should be the number of hours since that time. If 'State Changed On' is earlier than the report time period (i.e., the beginning of the day), then the number of hours since midnight should instead be used.{{ pytest: -vv --use-provider complete --long-running cfme/tests/intelligence/chargeback/test_resource_allocation.py }}