mistral/mistral/tests/unit/api/v2
Dougal Matthews 6356bce814 Add a way to save action executions that run synchronously
When using the command `mistral run-action`, by default it will run the action
synchronously unless the action can only be used asynchronously
(action.is_sync returns False). When it runs synchronously the result of the
action is not saved. When it is ran asynchronously the result is saved, as you
need to retrieve it from Mistral afterwards.

There is a argument on the command `--save-result` that can be used, it causes
the action to be ran asynchronously and the result is saved. There is no way
to have the action run synchronously and have the result be saved.

This patch adds a new API parameter `run_sync` which will be exposed by the
CLI as `--run-sync`. This new argument is intended to be used with `--save-
result` but can be be used independently to ensure an action isn't ran
synchronously by mistake. With the new argument the behaviour of the command
is now as follows:

* `mistral run-action` This behaves as it did before, it runs synchronously if
  it can, or it schedules for later and saves the action.

* `mistral run-action --save-result` Again, this is the same as before, it
  schedules the action to run later and the action is saved.

* `mistral run-action --run-sync` This is similar to having no argument
  passed, however, if you try to run an action that can't be used
  synchronously it will be rejected and an error is returned.

* `mistral run-action --run-sync --save-result` The combination of the two
  arguments runs the actions synchronously and saves the result. If the action
  can't be ran synchronously then an error is returned.

(This commit message uses the CLI to demonstrate the API usage, the new
argument is added in in a mistralclient patch. It can of course be used
directly via the API also.)

Change-Id: I4417750fd5ff47016357655370410e9e7348cc25
(cherry picked from commit 0ed4f05d63)
2016-10-06 07:18:04 +00:00
..
__init__.py Moving all API tests under 'mistral.tests.unit' package 2014-09-11 16:42:11 +07:00
test_action_executions.py Add a way to save action executions that run synchronously 2016-10-06 07:18:04 +00:00
test_actions.py Allow to use both name and id to access action definitions 2016-07-21 03:07:22 +00:00
test_cron_triggers.py Refactoring workflow handler 2016-06-07 18:38:38 +07:00
test_environment.py Move the remainder of REST resources to resources.py 2016-07-21 14:51:50 +07:00
test_event_trigger.py Add event trigger REST API 2016-09-13 22:39:36 +12:00
test_executions.py Optionally include the output when retrieving all executions 2016-09-05 08:11:20 +01:00
test_keycloak_auth.py Add client caching for OpenStack actions 2016-08-29 17:47:50 -04:00
test_members.py Rename base API test class 2016-04-18 08:36:28 +00:00
test_root.py Rename base API test class 2016-04-18 08:36:28 +00:00
test_services.py Rename base API test class 2016-04-18 08:36:28 +00:00
test_tasks.py Remove task result for collection REST requests 2016-07-26 22:40:26 +07:00
test_workbooks.py Refactoring workflow handler 2016-06-07 18:38:38 +07:00
test_workflows.py Refactoring workflow handler 2016-06-07 18:38:38 +07:00