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

[wip] Collect variable tower data #79

Closed
wants to merge 4 commits into from

Conversation

Glutexo
Copy link
Member

@Glutexo Glutexo commented May 2, 2018

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.

* Do not use removed credential kinds: Azure (Classic) and Rackspace.

Additional touches include:

* Rename Satelite6 credential variable.
* Fix code style by removing unnecessary spaces.
@Glutexo Glutexo changed the title Collect variable tower data [WIP] Collect variable tower data May 2, 2018
@miq-bot miq-bot added the wip label May 2, 2018
@Glutexo Glutexo force-pushed the collect_variable_tower_data branch 4 times, most recently from 42bffd1 to 5b7c2c0 Compare May 3, 2018 06:30
@Glutexo
Copy link
Member Author

Glutexo commented May 3, 2018

Fixed newly introduced RuboCop and Codeclimate offenses and rebased.

@Glutexo Glutexo changed the title [WIP] Collect variable tower data Collect variable tower data May 3, 2018
@miq-bot miq-bot removed the wip label May 3, 2018
@Glutexo Glutexo force-pushed the collect_variable_tower_data branch 4 times, most recently from ee24722 to e53e694 Compare May 3, 2018 13:25
@Glutexo Glutexo force-pushed the collect_variable_tower_data branch from e53e694 to fc948d7 Compare May 10, 2018 17:17
@Glutexo
Copy link
Member Author

Glutexo commented May 10, 2018

Added .utc to datetimes loaded from the YAML file, this makes the time comparisons safe as they were before my changes.

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.
@Glutexo Glutexo force-pushed the collect_variable_tower_data branch from fc948d7 to 11bafce Compare May 22, 2018 05:12
@miq-bot
Copy link
Member

miq-bot commented May 22, 2018

Some comments on commits Glutexo/manageiq-providers-ansible_tower@940342b~...11bafce

lib/tasks_private/spec_helper.rake

  • ⚠️ - 276 - Detected puts. Remove all debugging statements.
  • ⚠️ - 313 - Detected puts. Remove all debugging statements.
  • ⚠️ - 317 - Detected puts. Remove all debugging statements.

@miq-bot
Copy link
Member

miq-bot commented May 22, 2018

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
7 files checked, 5 offenses detected

lib/tasks_private/spec_helper.rake

@Glutexo Glutexo changed the title Collect variable tower data [wip] Collect variable tower data May 24, 2018
@miq-bot miq-bot added the wip label May 24, 2018
@Glutexo Glutexo closed this May 29, 2018
@Glutexo Glutexo deleted the collect_variable_tower_data branch May 29, 2018 10:50
@Glutexo
Copy link
Member Author

Glutexo commented May 29, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants