Skip to content

Commit

Permalink
Added tests for /_plugins/_flow_framework/workflow/_search and state/…
Browse files Browse the repository at this point in the history
…_search.

Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Nov 26, 2024
1 parent 5b54d24 commit 4e5454b
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 68 deletions.
10 changes: 5 additions & 5 deletions tests/default/flow_framework/deprovision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Test flow_framework provision endpoints.
version: '>= 2.12'
prologues:
- path: /_plugins/_flow_framework/workflow
id: create_flow_framework
id: workflow
method: POST
parameters:
use_case: semantic_search_with_cohere_embedding_query_enricher
Expand All @@ -12,24 +12,24 @@ prologues:
payload:
create_connector.credential.key: test_api_key
output:
test_workflow_id: payload.workflow_id
workflow_id: payload.workflow_id
epilogues:
- path: /_plugins/_flow_framework/workflow/{workflow_id}/_deprovision
method: POST
status: [200, 404]
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
- path: /_plugins/_flow_framework/workflow/{workflow_id}
method: DELETE
status: [200, 404]
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
chapters:
- synopsis: Deprovision workflow.
path: /_plugins/_flow_framework/workflow/{workflow_id}/_deprovision
method: POST
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
response:
status: 200
- synopsis: Deprovision workflow using an invalid ID.
Expand Down
10 changes: 5 additions & 5 deletions tests/default/flow_framework/provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ description: Test flow_framework provision endpoints.
version: '>= 2.12'
prologues:
- path: /_plugins/_flow_framework/workflow
id: create_flow_framework
id: workflow
method: POST
parameters:
use_case: semantic_search_with_cohere_embedding_query_enricher
request:
payload:
create_connector.credential.key: test_api_key
output:
test_workflow_id: payload.workflow_id
workflow_id: payload.workflow_id
epilogues:
- path: /_plugins/_flow_framework/workflow/{workflow_id}/_deprovision
method: POST
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
- path: /_plugins/_flow_framework/workflow/{workflow_id}
method: DELETE
status: [200, 404]
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
chapters:
- synopsis: Provision workflow.
path: /_plugins/_flow_framework/workflow/{workflow_id}/_provision
method: POST
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
request:
payload:
openai_key: '1234556'
Expand Down
6 changes: 3 additions & 3 deletions tests/default/flow_framework/search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ description: Test flow_framework provision endpoints.
version: '>= 2.12'
prologues:
- path: /_plugins/_flow_framework/workflow
id: create_flow_framework
id: workflow
method: POST
parameters:
use_case: semantic_search_with_cohere_embedding_query_enricher
request:
payload:
create_connector.credential.key: test_api_key
output:
test_workflow_id: payload.workflow_id
workflow_id: payload.workflow_id
epilogues:
- path: /_plugins/_flow_framework/workflow/{workflow_id}
method: DELETE
status: [200, 404]
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
chapters:
- synopsis: Search workflow match the name.
path: /_plugins/_flow_framework/workflow/_search
Expand Down
6 changes: 3 additions & 3 deletions tests/default/flow_framework/search_state.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ description: Test flow_framework provision endpoints.
version: '>= 2.12'
prologues:
- path: /_plugins/_flow_framework/workflow
id: create_flow_framework
id: workflow
method: POST
parameters:
use_case: semantic_search_with_cohere_embedding_query_enricher
request:
payload:
create_connector.credential.key: test_api_key
output:
test_workflow_id: payload.workflow_id
workflow_id: payload.workflow_id
epilogues:
- path: /_plugins/_flow_framework/workflow/{workflow_id}
method: DELETE
status: [200, 404]
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
chapters:
- synopsis: Search workflow state.
path: /_plugins/_flow_framework/workflow/state/_search
Expand Down
8 changes: 4 additions & 4 deletions tests/default/flow_framework/status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ description: Test flow_framework provision endpoints.
version: '>= 2.12'
prologues:
- path: /_plugins/_flow_framework/workflow
id: create_flow_framework
id: workflow
method: POST
parameters:
use_case: semantic_search_with_cohere_embedding_query_enricher
request:
payload:
create_connector.credential.key: test_api_key
output:
test_workflow_id: payload.workflow_id
workflow_id: payload.workflow_id
epilogues:
- path: /_plugins/_flow_framework/workflow/{workflow_id}
method: DELETE
status: [200, 404]
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
chapters:
- synopsis: Get workflow status.
path: /_plugins/_flow_framework/workflow/{workflow_id}/_status
method: GET
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
response:
status: 200
payload:
Expand Down
8 changes: 4 additions & 4 deletions tests/default/flow_framework/steps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ description: Test flow_framework provision endpoints.
version: '>= 2.12'
prologues:
- path: /_plugins/_flow_framework/workflow
id: create_flow_framework
id: workflow
method: POST
parameters:
use_case: semantic_search_with_cohere_embedding_query_enricher
request:
payload:
create_connector.credential.key: test_api_key
output:
test_workflow_id: payload.workflow_id
workflow_id: payload.workflow_id
epilogues:
- path: /_plugins/_flow_framework/workflow/{workflow_id}
method: DELETE
status: [200, 404]
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
chapters:
- synopsis: Get workflow steps.
path: /_plugins/_flow_framework/workflow/_steps
method: GET
response:
status: 200
- synopsis: Get workflow steps with invalid query parameter.
- synopsis: Get workflow steps with an invalid query parameter.
path: /_plugins/_flow_framework/workflow/_steps
method: GET
parameters:
Expand Down
44 changes: 22 additions & 22 deletions tests/default/flow_framework/template.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
$schema: ../../../json_schemas/test_story.schema.yaml
description: Test flow_framework endpoints using sample template.
description: Test flow_framework endpoints using a sample template.
version: '>= 2.12'
epilogues:
- path: /_plugins/_flow_framework/workflow/{workflow_id}
method: DELETE
status: [200, 404]
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
warnings:
multiple-paths-detected: false
chapters:
- synopsis: Create workflow with openAI model.
id: create_flow_framework
id: workflow
path: /_plugins/_flow_framework/workflow
method: POST
request:
payload:
name: Deploy OpenAI Model
description: Deploy a model using a connector to OpenAI
description: Deploy a model using a connector to OpenAI.
use_case: PROVISION
version:
template: 1.0.0
Expand All @@ -31,7 +31,7 @@ chapters:
type: create_connector
user_inputs:
name: OpenAI Chat Connector
description: The connector to public OpenAI model service for GPT 3.5
description: The connector to public OpenAI model service for GPT 3.5.
version: '1'
protocol: http
parameters:
Expand All @@ -57,12 +57,12 @@ chapters:
response:
status: 201
output:
test_workflow_id: payload.workflow_id
workflow_id: payload.workflow_id
- synopsis: Update workflow.
path: /_plugins/_flow_framework/workflow/{workflow_id}
method: PUT
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
update_fields: true
request:
payload:
Expand All @@ -73,7 +73,7 @@ chapters:
path: /_plugins/_flow_framework/workflow/{workflow_id}
method: PUT
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
update_fields: true
request:
payload:
Expand All @@ -85,11 +85,11 @@ chapters:
path: /_plugins/_flow_framework/workflow/{workflow_id}
method: PUT
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
request:
payload:
name: Deploy OpenAI Model
description: Deploy a model using a connector to OpenAI
description: Deploy a model using a connector to OpenAI.
use_case: PROVISION
version:
template: 1.0.0
Expand All @@ -103,7 +103,7 @@ chapters:
type: create_connector
user_inputs:
name: OpenAI Chat Connector
description: The connector to public OpenAI model service for GPT 3.5 update
description: The connector to public OpenAI model service for GPT 3.5 update.
version: '1'
protocol: http
parameters:
Expand Down Expand Up @@ -132,35 +132,35 @@ chapters:
path: /_plugins/_flow_framework/workflow/{workflow_id}/_provision
method: POST
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
response:
status: 200
- synopsis: Update workflow fail With provision and update_fields set true.
- synopsis: Update workflow fail with `provision` and `update_fields` set to `true`.
path: /_plugins/_flow_framework/workflow/{workflow_id}
method: PUT
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
provision: true
update_fields: true
request:
payload:
name: test_create_work_flow
response:
status: 400
- synopsis: Update workflow fail With Reprovision and updateFields set true.
- synopsis: Update workflow fail with `reprovision` and `update_fields` set to `true`.
version: '>= 2.17'
path: /_plugins/_flow_framework/workflow/{workflow_id}
method: PUT
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
reprovision: true
update_fields: true
request:
payload:
name: test_create_work_flow
response:
status: 400
- synopsis: Create workflow fail With Reprovision set true.
- synopsis: Create workflow fail with `reprovision` set to `true`.
version: '>= 2.17'
path: /_plugins/_flow_framework/workflow
method: POST
Expand All @@ -171,7 +171,7 @@ chapters:
name: test_create_work_flow
response:
status: 400
- synopsis: Create workflow fail With Reprovision set true and UseCase Not null.
- synopsis: Create workflow fail with `reprovision` set to `true` and `use_case` not `null`.
version: '>= 2.17'
path: /_plugins/_flow_framework/workflow
method: POST
Expand All @@ -183,12 +183,12 @@ chapters:
name: test_create_work_flow
response:
status: 400
- synopsis: Update workflow fail With Reprovision set true and UseCase Not null.
- synopsis: Update workflow fail with `reprovision` set to `true` and `use_case` not `null`.
version: '>= 2.17'
path: /_plugins/_flow_framework/workflow/{workflow_id}
method: PUT
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
reprovision: true
use_case: test_use_case
request:
Expand All @@ -200,7 +200,7 @@ chapters:
path: /_plugins/_flow_framework/workflow/{workflow_id}
method: GET
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
response:
status: 200
- synopsis: Get workflow fail.
Expand Down Expand Up @@ -234,6 +234,6 @@ chapters:
path: /_plugins/_flow_framework/workflow/{workflow_id}
method: DELETE
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
workflow_id: ${workflow.workflow_id}
response:
status: 200
Loading

0 comments on commit 4e5454b

Please sign in to comment.