-
Notifications
You must be signed in to change notification settings - Fork 120
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
Convert Automate Methods to new style using classes #8
Labels
Comments
This was referenced Apr 10, 2017
This issue has been automatically marked as stale because it has not been updated for at least 6 months. If you can still reproduce this issue on the current release or on Thank you for all your contributions! |
This was referenced Mar 6, 2018
This was referenced Jun 4, 2018
This was referenced Jun 12, 2018
This was referenced Jul 10, 2018
billfitzgerald0120
added a commit
to billfitzgerald0120/manageiq-content
that referenced
this issue
May 21, 2019
Refactoring Service/Retirement/StateMachines/Methods.class/methods/start_retirement.rb method with spec. This PR is based on the issue below. ManageIQ#8 @miq-bot add_label refactoring
billfitzgerald0120
added a commit
to billfitzgerald0120/manageiq-content
that referenced
this issue
Jun 27, 2019
Refactoring Service/Retirement/StateMachines/Methods.class/methods/start_retirement.rb method with spec. This PR is based on the issue below. ManageIQ#8 @miq-bot add_label refactoring Made labels more descriptive and removed some useless tests as requested
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Convert the Automate methods to new style using classes to facilitate testing outside the Automate Engine.
Notes:
This idea is borrowed from Python, which allows us to source in the file without executing any code. The if block gets executed only when we directly pass in the file to the ruby interpreter. When we test the method script we source in the file in the spec and then instantiate it for testing, it allows us to pass in a mock service for testing.
Good sample of a method
https://github.com/ManageIQ/manageiq-content/blob/master/content/automate/ManageIQ/Cloud/Orchestration/Operations/Methods.class/__methods__/available_availability_zones.rb
Good sample of a spec
https://github.com/ManageIQ/manageiq-content/blob/master/spec/content/automate/ManageIQ/Cloud/Orchestration/Operations/Methods.class/__methods__/available_availability_zones_spec.rb
In the spec the line
require_domain_file
loads the method file from the correct directory
The methods have been categorized based on different lifecycle's
ManageIQ/Cloud/Orchestration/Operations
ManageIQ/Cloud/Orchestration/Provisioning
ManageIQ/Cloud/Orchestration/Reconfiguration
ManageIQ/Cloud/Orchestration/Retirement
ManageIQ/Cloud/VM/Provisioning
ManageIQ/Cloud/VM/Retirement
ManageIQ/ConfigurationManagement/AnsibleTower/Operations
ManageIQ/ConfigurationManagement/AnsibleTower/Service/Provisioning
ManageIQ/Control/
ManageIQ/Deployment/ContainerProvider/System/
ManageIQ/Infrastructure/Cluster/Operations
ManageIQ/Infrastructure/Configured_System/Provisioning
ManageIQ/Infrastructure/Host/Operations
ManageIQ/Infrastructure/Host/Provisioning
ManageIQ/Infrastructure/VM/Migrate
ManageIQ/Infrastructure/VM/Operations
ManageIQ/Infrastructure/VM/Provisioning
ManageIQ/Infrastructure/VM/Reconfigure
ManageIQ/Infrastructure/VM/Retirement
ManageIQ/Service/Provisioning/
ManageIQ/Service/Retirement
ManageIQ/System
ManageIQ/Transformation
The text was updated successfully, but these errors were encountered: