-
Notifications
You must be signed in to change notification settings - Fork 55
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
[wip] Collect variable tower data #79
Conversation
* Do not use removed credential kinds: Azure (Classic) and Rackspace. Additional touches include: * Rename Satelite6 credential variable. * Fix code style by removing unnecessary spaces.
42bffd1
to
5b7c2c0
Compare
Fixed newly introduced RuboCop and Codeclimate offenses and rebased. |
ee24722
to
e53e694
Compare
e53e694
to
fc948d7
Compare
Added |
There is a rake task that populates Tower with test data. This data is used to record VCR cassettes. Unfortunately some specs used some other unknown Tower entities instead of the created ones. Unify the specs to use the entities created by the populate Rake task. Re-record cassettes using a non-blank Tower 3.2.2 test instance.
It may not be possible to create a job template right after creating a project that the template uses. Add a try-wait loop that ensures that the project has been created in Tower and it successfully finished cloning. In case of clone failure, raise an error. If the project is not ready yet, wait a bit and try again. The number of tries is limited, raising an error on depletion. Extract the del_object sleep as a class constant for symmetry.
Each time objects are populated in a Tower instance, some of their properties (ids, timestamps…) change. The same applies to objects counts that can differ from the previous state. This required manual update of expectation in specs when re-recording VCR cassettes. Collect these changing data during their population in Tower instance to a YAML file. Use this information in specs instead of magic literals. This allows to re-record the cassettes without breaking the tests and removes the need to manually edit the expectations in the specs.
fc948d7
to
11bafce
Compare
Some comments on commits Glutexo/manageiq-providers-ansible_tower@940342b~...11bafce lib/tasks_private/spec_helper.rake
|
Checked commits Glutexo/manageiq-providers-ansible_tower@940342b~...11bafce with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 lib/tasks_private/spec_helper.rake
|
Broken down to smaller parts to make review easier:
This does not completely replace the original PR as some merges will be required. There are however only few missing bits that will come in further PRs after merging. |
Each time objects are populated in a Tower instance, some of their properties (ids, timestamps…) change. The same applies to objects counts that can differ from the previous state. This required manual update of expectation in specs when re-recording VCR cassettes.
Collect these changing data during their population in Tower instance to a YAML file. Use this information in specs instead of magic literals. This allows to re-record the cassettes without breaking the tests and removes the need to manually edit the expectations in the specs.
This PR is based on #73 and requires it to be merged before. The referenced PR fixes the specs so their expectations do not requirer other objects in Tower instance than those populated by the Rake task.
CC @jameswnl for review.