All the changes has been merged to mistral_tempest_tests.
Also scrits has been changed.
Change-Id: I6c514a3c75f1b6e3b94b0e9b0e542697b68d9a02
Partially-Implements: blueprint mistral-tempest-plugin
NOTE: A tenant can not delete workflows of other tenants.
Partially implements: blueprint use-workflow-id-in-rest-api
Change-Id: Ie3c1304a0ffe5cee49165ad19a976956e24c1ed7
If cron-trigger is created in different tenant
than workflow's tenant, associated cron-trigger
can not be got. So "model_query" has been used
instead of "secure_query".
Change-Id: Ief78f2cad76e6ca16893bff80c5e75c9015e9c74
Closes-bug: #1522286
The state of a workflow execution was not updated even when all task
executions were completed if some tasks finished at the same time as
other tasks.
Because we were using our connections with transaction isolation
level = REPEATABLE_READ - Each process was using a snapshot of the DB
created at the first read statement in that transaction.
When a task finished and evaluated the state of all the other tasks
it did not see the up-to-date state of those tasks - and so, because
not all tasks were completed - the task did not change the workflow
execution state.
Similar behavior happened with multiple action executions under same
task. On completion, each action execution checked the status of the
other action executions and did not see the up-to-date state of these
action execution - causing task execution to stay in RUNNING state.
Change-Id: I12f66134d92b8ed39df9d6128d7de5ee49aa8623
Closes-Bug: #1518012
Closes-Bug: #1513456
* Wf execution is not created when first
task(s) failed.
* Fixed some unit-tests.
Closes-Bug: #1506470
Change-Id: Id34b11efe15fcff0a9360e2966d1a85c29325c62
* Changing the way of getting task spec using polymorphic mechanism,
which is the motivation of this patch.
* Moving the type injection in TaskSpec to WorkflowSpec, the 'type'
param is already there when TaskSpec initializing, and we could also
continue to use that for polymorphic mechanism of TaskSpec, and the
subclasses iteration mechanism can also be removed as well.
* Improving the schema validation for TaskSpec, replace the code logic
of prohibition of co-existance between action and workflow in task spec
with jsonschema restriction.
Change-Id: Ia88ce390298d54afc1ee72ebfb67de9056d9f444
With this patch, users can perform operation as following:
DELETE http://127.0.0.1:8989/v2/action_executions/<action_execution_id>
NOTE:
* Added a new config item 'allow_action_execution_deletion', with default
value 'False'.
* The 'allow_action_execution_deletion' item is set to 'True' for
functional testing.
* Only ad-hoc action-execution can be deleted.
* Only completed action execution can be deleted.
Implements: blueprint mistral-action-execution-deletion
Closes-Bug: #1488157
Change-Id: I3729636911a42c273c5a7b2d7fbdaae0da398e31
* Fixed functional test 'test_create_action_execution'
* Sometimes action execution is still not completed and
response contains no output. Changed that mechanism to
wait for completeness.
Change-Id: I6c27dd87e754e9cffc809922ad963ccebdcf7930
* Fixing custom WSME type for json fields. Making it able to convert
values in both direction (to base type and from base type).
* Changed type of ActionExecution resource fields 'input' and 'output'
to new custom json type.
* Fixed action execution controller where necessary.
* Adjusted and refactored action execution controller tests.
Change-Id: I28d0f3204518a2688cb72acefd910d9d99ada66d
With this patch, users could retrieve workflows only with fields they care
about.
NOTE: 'id' must be included in fields if it's provided, since 'id' will be
used when constructing 'next' link.
This feature is just like we specicy '-c' argument in CLI, but it's
implemented in server side(or more precisely, in db layer).
Partially-Implements: blueprint query-result-column-filtering
Change-Id: If034e7ee96aaecf2d5cebefdc85eaa7b3f6f7d8c
* The returned workflows order of creation is not the same with their
order in definition file.
* Add another workflow definition in wf_v2.yaml using by functional
testing
Change-Id: I81c78580f7365363b5f45b98328f94ae90c65ba1
Exception should be raised for creation of workflow such as:
---
version: '2.0'
name: which_should_not_appear
wf:
type: direct
tasks:
task1: std.echo output='hello, world.'
For jsonschema, If additionalProperties is an object, that object is a
schema that will be used to validate any additional properties not listed
in properties.
Change-Id: I11a0e514f525a1ce278bdbf69d001a6249ef2183
Closes-Bug: #1442128
Add query params for action list REST API:
* limit: return a maximun number of items at a time, default is None, the
query result will include all the resource items, which is backward
compatible.
* marker: the ID of the last item in the previous list.
* sort_keys: columns to sort results by. Default: created_at, which is
backward compatible.
* sort_dirs: directions to sort corresponding to sort_keys, "asc" or
"desc" can be choosed. Default: desc. The length of sort_dirs can
be equal or less than that of sort_keys.
Change-Id: I2fcca2a5589936d24aa52245a686115598fbd858
Partially-Implements: blueprint mistral-pagination-support
Add query params for action list REST API:
* limit: return a maximun number of items at a time, default is None, the
query result will include all the resource items, which is backward
compatible.
* marker: the ID of the last item in the previous list.
* sort_keys: columns to sort results by. Default: name, which is backward
compatible.
* sort_dirs: directions to sort corresponding to sort_keys, "asc" or
"desc" can be choosed. Default: asc. The length of sort_dirs can
be equal or less than that of sort_keys.
Change-Id: Ied5b48244cc94a3039ebafce40f3c2ae25f9a48e
Partially-Implements: blueprint mistral-pagination-support
* The problem comes from JSON serializing. Cookies and
datetime is not JSON serializable, so we need to
preprocess them manually.
Closes-Bug: #1477048
Change-Id: I2dbd1463f1b3549f661c0dba46ab6f949c4fffb4
* Mistral API now enables POST on /action_executions
* 2 ways of work - synchronous and asynchronous:
returns result immediately or saving action_execution
to the DB. it is controlled by 'save_result' option in
'params' key of the request.
* fixed returning error back in executior
TODO (next commit):
- Implementing 'run-action' cmd in python-mistralclient
Implements blueprint mistral-run-individual-action
Change-Id: I365ec8b92e9bed72bb05c618323f18f5ca7b82e5
* Fixed handling wrong using execution-update
* Fixed session hanging in case incorrect using execution update API:
in case of exception neither commit_tx nor rollback_tx has not
been invoked -> session acquired semaphore but didn't release it.
Note: it is related only to sqlite (used in unit tests).
Closes-Bug: #1449557
Change-Id: Ic8874b2d498167cac1a88f6d138e8ac0e1d9a67f
Adds the support of two optionals parameters for the cron-trigger resource:
-first_execution_date : supersedes to the first calculation of
"next_execution_time".
-remaining_occurrences: number of occurrences after which the trigger should
be deleted.
The parameter "pattern" is now optional if first-execution-date only is used.
Implements: blueprint mistral-cron-triggers-start-and-repeat
Change-Id: I55bc28e98f89ffdfdce9cb3daa3848a17d85fd20
* Created a Execution hierarcy mapped on a single table:
- ActionExecution
- WorkflowExecution
- TaskExecution
* Created necessary associations within Execution hierarchy
* Created necessary methods for Execution objects on DB API
* Created Definition hierarchy mapped on separate tables:
- Workbook
- WorkflowDefinition
- ActionDefinition
* Renamed attributes
- 'wf_name' -> 'workflow_name'
- 'wf_spec' -> 'spec'
* Fixed all unit tests
TODO:
* Complete renaming throughout the code
* Further refactoring of workflow engine
Change-Id: I0032bea573d9200025f9f7dd951e93cb6f1661bb
Client sometimes needs to stop the workflow. Most often, when there is
an obvious error and it makes no sense to wait for completion. Or
when execution got to zombie state by any reasons.
Provide an ability to force-stop the workflow, pass SUCCESS or
ERROR, and status message for client message or error info.
- [x] Add public method and tests to default_engine.
- [x] Expose stop_workflow in rpc.
- [x] Expose in API.
- [x] Add a functional test.
Change-Id: I1bee7d9d780c1b1d09bc146843c751802e68f8fc
- Separated v1 and v2 api tests for workbooks and executions;
- Added more tests scenarios;
- Optimize methods realization for v2 tests.
Change-Id: Ic24383bc7e6c059088e98eeeeab28ae7bda2de6a
Closes-Bug: #1384564
- Added API tests which check main api calls to cron-trigger endpoint
- Fixed tearDown method (there was a problem when item array
had a few elements, not all of them were deleted)
Partly implements: blueprint mistral-triggers-functional-tests
Change-Id: Ibba7cd03e6ccdf06c76ea4ea161542b954faee0f
After testing new script run_functional_tests one destructive issue
was discovered that after this script all executions were deleted.
This situation was fixed. Now in all create methods identifier of
created object saves in array and in tearDown methods tests delete
only objects which were saved in appropriate arrays.
Change-Id: I442aecd346c003cd38ce6977e4f69f9bfa32e894
- Added integration tests for API version 2
- Refactor base.py, separate methods for v1 and v2
- Created second endpoint /v2 in keystone in devstack installation
Change-Id: Ibe23971b2335242ed72b837bfc1f861d0a74e395