Skip to content

Commit 3a709fd

Browse files
authored
Add cypress test for dashboards assistant feature flag (#1845)
* Add cypress test for dashboards assistant feature flag Signed-off-by: Owen Wang <[email protected]> * Address comments Signed-off-by: Owen Wang <[email protected]> --------- Signed-off-by: Owen Wang <[email protected]>
1 parent 64498a2 commit 3a709fd

File tree

4 files changed

+406
-42
lines changed

4 files changed

+406
-42
lines changed

.github/workflows/assistant-release-e2e-workflow.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
test-name: dashboards assistant
2525
test-command: env CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/*chatbot*.js'
2626
osd-serve-args: --assistant.chat.enabled=true
27-
artifact-name-suffix: "-with-security"
27+
artifact-name-suffix: '-with-security'
2828

2929
tests-without-security:
3030
needs: changes
@@ -35,7 +35,7 @@ jobs:
3535
test-command: env CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true yarn cypress:run-without-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/*chatbot*.js'
3636
osd-serve-args: --assistant.chat.enabled=true
3737
security-enabled: false
38-
artifact-name-suffix: "-without-security"
38+
artifact-name-suffix: '-without-security'
3939
multi-opensearch-enabled: false
4040

4141
tests-with-multiple-data-source-and-disabled-local-cluster:
@@ -47,7 +47,7 @@ jobs:
4747
test-command: env CYPRESS_DISABLE_LOCAL_CLUSTER=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/mds_chatbot*.js'
4848
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --data_source.hideLocalCluster=true --assistant.chat.enabled=true
4949
security-enabled: true
50-
artifact-name-suffix: "-with-security-and-mds"
50+
artifact-name-suffix: '-with-security-and-mds'
5151

5252
tests-with-query-enhancements:
5353
needs: changes
@@ -58,5 +58,15 @@ jobs:
5858
test-command: env CYPRESS_DISABLE_LOCAL_CLUSTER=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true CYPRESS_WORKSPACE_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/mds_query_enhancements*.js'
5959
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --data_source.hideLocalCluster=true --assistant.chat.enabled=true --assistant.alertInsight.enabled=true --assistant.smartAnomalyDetector.enabled=true --queryEnhancements.queryAssist.summary.enabled=true --uiSettings.overrides.home:useNewHomePage=true --uiSettings.overrides.query:enhancements:enabled=true --workspace.enabled=true --savedObjects.permission.enabled=true --assistant.text2viz.enabled=true --opensearchDashboards.dashboardAdmin.users='["admin"]' --opensearch_security.multitenancy.enabled=false
6060
security-enabled: true
61-
artifact-name-suffix: "-with-query-enhancements"
61+
artifact-name-suffix: '-with-query-enhancements'
6262

63+
tests-with-workspace-and-permission-control:
64+
needs: changes
65+
if: ${{ needs.changes.outputs.tests == 'true' }}
66+
uses: ./.github/workflows/release-e2e-workflow-template.yml
67+
with:
68+
test-name: dashboards assistant
69+
test-command: env CYPRESS_DISABLE_LOCAL_CLUSTER=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true CYPRESS_WORKSPACE_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/mds_assistant_feature_flag_spec.js'
70+
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --data_source.hideLocalCluster=true --assistant.chat.enabled=true --assistant.alertInsight.enabled=true --assistant.smartAnomalyDetector.enabled=true --queryEnhancements.queryAssist.summary.enabled=true --uiSettings.overrides.home:useNewHomePage=true --uiSettings.overrides.query:enhancements:enabled=true --uiSettings.overrides.query:enhancements:enabled=true --workspace.enabled=true --savedObjects.permission.enabled=true --assistant.text2viz.enabled=true --opensearchDashboards.dashboardAdmin.users='["admin"]' --opensearch_security.multitenancy.enabled=false
71+
security-enabled: true
72+
artifact-name-suffix: '-with-workspace-and-permission-control'

cypress/fixtures/plugins/dashboards-assistant/flow-templates/chat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
},
121121
"user_inputs": {
122122
"parameters": {
123-
"prompt": "\n\nHuman:\" turn\" You are an AI that only speaks JSON. Do not write normal text. Output should follow example JSON format: \n\n {\"response\": [\"question1\", \"question2\"]}\n\n. \n\nHuman:\" turn\":You will be given a chat history between OpenSearch Assistant and a Human.\nUse the context provided to generate follow up questions the Human would ask to the Assistant.\nThe Assistant can answer general questions about logs, traces and metrics.\nAssistant can access a set of tools listed below to answer questions given by the Human:\nQuestion suggestions generator tool\nHere's the chat history between the human and the Assistant.\n${parameters.AgentTool.output}\nUse the following steps to generate follow up questions Human may ask after the response of the Assistant:\nStep 1. Use the chat history to understand what human is trying to search and explore.\nStep 2. Understand what capabilities the assistant has with the set of tools it has access to.\nStep 3. Use the above context and generate follow up questions.Step4:You are an AI that only speaks JSON. Do not write normal text. Output should follow example JSON format: \n\n {\"response\": [\"question1\", \"question2\"]} \n \n----------------\n\nAssistant:"
123+
"prompt": "You are an AI that only speaks JSON"
124124
},
125125
"description": "A general tool to answer any question.",
126126
"alias": "language_model_tool",

0 commit comments

Comments
 (0)