Open mkanoor opened 7 years ago
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 master
, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions!
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