-
Notifications
You must be signed in to change notification settings - Fork 47
no-wait option in tests.yaml #688
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -173,6 +173,38 @@ In the above case, focal-ussuri will be deployed using the --force parameter. | |||||||||
| i.e. the `tests_options.force_deploy['focal-ussuri']` option applies to the | ||||||||||
| `focal-ussuri` bundle whether it appears in any of the bundle sections. | ||||||||||
|
|
||||||||||
| Skipping the post-deploy wait | ||||||||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||||||
|
|
||||||||||
| By default, after deploying a bundle zaza waits for all applications to reach | ||||||||||
| the states specified in ``target_deploy_status`` (or active/idle if not | ||||||||||
| configured). This wait can be skipped on a per-bundle basis using the | ||||||||||
| ``tests_options.no_wait_deploy`` option. | ||||||||||
|
|
||||||||||
| This is useful when a charm requires post-deploy configuration before it can | ||||||||||
| reach its target state, or when you want to proceed immediately to the | ||||||||||
| configure step without waiting. | ||||||||||
|
|
||||||||||
| In the ``tests.yaml`` the option is added as a list item:: | ||||||||||
|
|
||||||||||
| charm_name: vault | ||||||||||
| gate_bundles: | ||||||||||
| - focal-ussuri | ||||||||||
|
|
||||||||||
| target_deploy_status: | ||||||||||
| vault: | ||||||||||
| workload-status: blocked | ||||||||||
| workload-status-message: Vault needs to be initialized | ||||||||||
|
|
||||||||||
| tests_options: | ||||||||||
| no_wait_deploy: | ||||||||||
| - focal-ussuri | ||||||||||
|
|
||||||||||
|
Comment on lines
+188
to
+202
|
||||||||||
| In the above case, zaza will deploy the ``focal-ussuri`` bundle and immediately | ||||||||||
| proceed to the configure step without waiting for vault to enter the blocked | ||||||||||
| state. This is equivalent to passing ``--no-wait`` directly to | ||||||||||
| ``functest-deploy``. | ||||||||||
|
Comment on lines
+205
to
+206
|
||||||||||
| state. This is equivalent to passing ``--no-wait`` directly to | |
| ``functest-deploy``. | |
| state or for the model to settle (the additional post-deploy | |
| ``block_until_all_units_idle`` wait is also skipped). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,21 +142,29 @@ def run_env_deployment(env_deployment, keep_model=DESTROY_MODEL, force=False, | |
| deployment.bundle) | ||
| errors_ = (ignore_hard_deploy_errors or | ||
| utils.ignore_hard_deploy_errors(deployment.bundle)) | ||
| no_wait_ = utils.no_wait_deploy(deployment.bundle) | ||
| deploy.deploy( | ||
| os.path.join( | ||
| utils.get_bundle_dir(), | ||
| '{}.yaml'.format(deployment.bundle)), | ||
| deployment.model_name, | ||
| model_ctxt=model_aliases, | ||
| wait=not no_wait_, | ||
| force=force_, | ||
| trust=trust_, | ||
| test_directory=test_directory, | ||
| ignore_hard_deploy_errors=errors_) | ||
|
|
||
| # When deploying bundles with cross model relations, hooks may be | ||
| # triggered in already deployedi models so wait for all models to | ||
| # triggered in already deployed models so wait for all models to | ||
| # settle. | ||
| for deployment in env_deployment.model_deploys: | ||
| if utils.no_wait_deploy(deployment.bundle): | ||
| logging.info( | ||
| "Skipping post-deploy wait for {} " | ||
| "(no_wait_deploy is set)".format( | ||
| deployment.model_name)) | ||
| continue | ||
|
Comment on lines
158
to
+167
|
||
| logging.info("Waiting for {} to settle".format( | ||
| deployment.model_name)) | ||
| errors_ = (ignore_hard_deploy_errors or | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -526,6 +526,39 @@ def ignore_hard_deploy_errors( | |||||||||||||||||||||||
| return False | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| def no_wait_deploy( | ||||||||||||||||||||||||
| bundle_name, yaml_file=None, fatal=True): | ||||||||||||||||||||||||
| """Ask if the wait step should be skipped after deploying bundle. | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Setting no_wait_deploy for a bundle means that zaza will not wait for | ||||||||||||||||||||||||
| the applications to reach the states defined in target_deploy_status (or | ||||||||||||||||||||||||
| active/idle) after deploying the bundle. | ||||||||||||||||||||||||
|
Comment on lines
+531
to
+535
|
||||||||||||||||||||||||
| """Ask if the wait step should be skipped after deploying bundle. | |
| Setting no_wait_deploy for a bundle means that zaza will not wait for | |
| the applications to reach the states defined in target_deploy_status (or | |
| active/idle) after deploying the bundle. | |
| """Ask if the deploy wait/settle steps should be skipped for a bundle. | |
| Setting no_wait_deploy for a bundle means that zaza will not: | |
| * wait for the applications to reach the states defined in | |
| target_deploy_status (or active/idle) after deploying the bundle; or | |
| * perform the post-deploy block_until_all_units_idle "settle" wait. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zaza supports adding a bundle with a prefix , e.g. https://github.com/openstack-charmers/charmed-openstack-tester/blob/master/tests/distro-regression/tests/tests.yaml#L5 , will this option honor it?
in a tests.yaml like this ^, the no-wait should only match the second bundle and not
security:focal-ussuri