Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 34 additions & 8 deletions .github/workflows/assistant-release-e2e-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ jobs:
- 'cypress/**/dashboards-assistant/**'
- 'cypress/support/assistant-dummy-llm.js'
- '.github/workflows/release-e2e-workflow-template.yml'
- '.github/workflows/release-e2e-workflow-template-windows.yml'

tests-with-security:
tests-with-security-linux:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template.yml
with:
test-name: dashboards assistant
test-command: env CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/*chatbot*.js'
osd-serve-args: --assistant.chat.enabled=true --home.disableExperienceModal=true --home.disableWelcomeScreen=true
artifact-name-suffix: '-with-security'
artifact-name-suffix: '-linux-with-security'
multi-opensearch-enabled: false

tests-without-security:
tests-without-security-linux:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template.yml
Expand All @@ -36,10 +38,10 @@ jobs:
test-command: env CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true yarn cypress:run-without-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/*chatbot*.js'
osd-serve-args: --assistant.chat.enabled=true --home.disableExperienceModal=true --home.disableWelcomeScreen=true
security-enabled: false
artifact-name-suffix: '-without-security'
artifact-name-suffix: '-linux-without-security'
multi-opensearch-enabled: false

tests-with-multiple-data-source-and-disabled-local-cluster:
tests-with-multiple-data-source-and-disabled-local-cluster-linux:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template.yml
Expand All @@ -48,9 +50,9 @@ jobs:
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'
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --data_source.hideLocalCluster=true --assistant.chat.enabled=true --home.disableExperienceModal=true --home.disableWelcomeScreen=true
security-enabled: true
artifact-name-suffix: '-with-security-and-mds'
artifact-name-suffix: '-linux-with-security-and-mds'

tests-with-query-enhancements:
tests-with-query-enhancements-linux:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template.yml
Expand All @@ -59,4 +61,28 @@ jobs:
test-command: env CYPRESS_DISABLE_LOCAL_CLUSTER=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true CYPRESS_WORKSPACE_ENABLED=true CYPRESS_SKIP_HEAVY_DISCOVER_TESTS=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/mds_query_enhancements*.js'
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 --home.disableExperienceModal=true --home.disableWelcomeScreen=true
security-enabled: true
artifact-name-suffix: '-with-query-enhancements'
artifact-name-suffix: '-linux-with-query-enhancements'

tests-with-security-windows:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template-windows.yml
with:
test-name: dashboards assistant
test-command: env CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true yarn cypress:run-with-security --browser chrome --spec 'cypress/integration/plugins/dashboards-assistant/*chatbot*.js'
osd-serve-args: --assistant.chat.enabled=true --home.disableExperienceModal=true --home.disableWelcomeScreen=true
security-enabled: true
artifact-name-suffix: '-windows-with-security'
multi-opensearch-enabled: false

tests-without-security-windows:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template-windows.yml
with:
test-name: dashboards assistant
test-command: env CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true yarn cypress:run-without-security --browser chrome --spec 'cypress/integration/plugins/dashboards-assistant/*chatbot*.js'
osd-serve-args: --assistant.chat.enabled=true --home.disableExperienceModal=true --home.disableWelcomeScreen=true
security-enabled: false
artifact-name-suffix: '-windows-without-security'
multi-opensearch-enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ jobs:
with:
test-name: Core Dashboards using Bundle Snapshot
test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true CYPRESS_BANNER_ENABLED=true yarn cypress:run-with-security --browser chrome --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js'
# not useful now as the windows e2e template currently do not allow serving parameters
#osd-serve-args: --data_source.enabled=true --vis_builder.enabled=true
osd-serve-args: --data_source.enabled=true --vis_builder.enabled=true --banner.enabled=true

tests-without-security:
uses: ./.github/workflows/release-e2e-workflow-template-windows.yml
with:
test-name: Core Dashboards using Bundle Snapshot
test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true CYPRESS_BANNER_ENABLED=true yarn cypress:run-without-security --browser chrome --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js'
# not useful now as the windows e2e template currently do not allow serving parameters
#osd-serve-args: --data_source.enabled=true --vis_builder.enabled=true
osd-serve-args: --data_source.enabled=true --vis_builder.enabled=true --banner.enabled=true
security-enabled: false
20 changes: 18 additions & 2 deletions .github/workflows/investigation-release-e2e-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ jobs:
filters: |
tests:
- 'cypress/**/dashboards-investigation/**'
- '.github/workflows/release-e2e-workflow-template.yml'
- '.github/workflows/release-e2e-workflow-template-windows.yml'
- '.github/workflows/investigation-release-e2e-workflow.yml'

tests-with-workspace:
tests-with-workspace-linux:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template.yml
Expand All @@ -24,4 +27,17 @@ jobs:
test-command: env CYPRESS_DISABLE_LOCAL_CLUSTER=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true CYPRESS_DASHBOARDS_INVESTIGATION_ENABLED=true CYPRESS_WORKSPACE_ENABLED=true yarn cypress:run-with-security --browser electron --spec 'cypress/integration/plugins/dashboards-investigation/*'
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --data_source.hideLocalCluster=true --investigation.enabled=true --investigation.agenticFeaturesEnabled=true --uiSettings.overrides.home:useNewHomePage=true --workspace.enabled=true --savedObjects.permission.enabled=true --opensearchDashboards.dashboardAdmin.users='["admin"]' --opensearch_security.multitenancy.enabled=false --explore.enabled=true
security-enabled: true
artifact-name-suffix: '-with-workspace'
artifact-name-suffix: '-linux-with-workspace'
multi-opensearch-enabled: false

tests-with-workspace-windows:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template-windows.yml
with:
test-name: dashboards investigation
test-command: env CYPRESS_DISABLE_LOCAL_CLUSTER=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true CYPRESS_DASHBOARDS_INVESTIGATION_ENABLED=true CYPRESS_WORKSPACE_ENABLED=true yarn cypress:run-with-security --browser chrome --spec 'cypress/integration/plugins/dashboards-investigation/*'
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --data_source.hideLocalCluster=true --investigation.enabled=true --investigation.agenticFeaturesEnabled=true --uiSettings.overrides.home:useNewHomePage=true --workspace.enabled=true --savedObjects.permission.enabled=true --opensearchDashboards.dashboardAdmin.users='["admin"]' --opensearch_security.multitenancy.enabled=false --explore.enabled=true
security-enabled: true
artifact-name-suffix: '-windows-with-workspace'
multi-opensearch-enabled: false
47 changes: 33 additions & 14 deletions .github/workflows/release-e2e-workflow-template-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ on:
test-command:
required: true
type: string
osd-serve-args:
required: false
type: string
security-enabled:
required: false
type: string
artifact-name-suffix:
required: false
type: string
multi-opensearch-enabled:
required: false
type: boolean
default: true
jobs:
tests:
name: Run Cypress E2E tests for ${{ inputs.test-name }} (Windows)
Expand Down Expand Up @@ -72,15 +82,17 @@ jobs:
netstat -anP tcp | grep LISTEN | grep 9200 || netstat -ntlp | grep 9200
shell: bash
- uses: ./.github/actions/start-opensearch
if: ${{ inputs.multi-opensearch-enabled }}
with:
opensearch-version: ${{ env.VERSION }}
security-enabled: false
port: 9201
- uses: ./.github/actions/start-opensearch
if: ${{ inputs.multi-opensearch-enabled }}
with:
opensearch-version: ${{ env.VERSION }}
security-enabled: true
admin-password: admin
admin-password: myStrongPassword123!
port: 9202
- name: Get and run OpenSearch-Dashboards
run: |
Expand All @@ -96,20 +108,27 @@ jobs:
with:
node-version: ${{ env.node_version }}
registry-url: 'https://registry.npmjs.org'
- name: Apply OSD serve args to config
if: ${{ inputs.osd-serve-args != '' }}
run: |
cd opensearch-dashboards-${{ env.VERSION }}
# Convert CLI --key=value args to opensearch_dashboards.yml entries
for arg in ${{ inputs.osd-serve-args }}; do
# Strip leading dashes
arg="${arg#--}"
key="${arg%%=*}"
value="${arg#*=}"
# Remove any existing line with the same key to avoid duplicated mapping key errors
sed -i "/^${key}:/d" config/opensearch_dashboards.yml
echo "${key}: ${value}" >> config/opensearch_dashboards.yml
done
shell: bash
- name: Run OpenSearch-Dashboards server
run: |
netstat -anP tcp | grep LISTEN | grep 9200 || netstat -ntlp | grep 9200
cd opensearch-dashboards-${{ env.VERSION }}
# Temporary solution to add vis_builder and data_source enabled parameters
echo "vis_builder.enabled: true" >> config/opensearch_dashboards.yml
echo "data_source.enabled: true" >> config/opensearch_dashboards.yml
echo "banner.enabled: true" >> config/opensearch_dashboards.yml
echo 'banner.content: "This is an important announcement for all users. [Learn more](http://opensearch.org) about OpenSearch."' >> config/opensearch_dashboards.yml
# echo "data_source.encryption.wrappingKeyName: 'changeme'" >> config/opensearch_dashboards.yml
# echo "data_source.encryption.wrappingKeyNamespace: 'changeme'" >> config/opensearch_dashboards.yml
# echo "data_source.encryption.wrappingKey: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]" >> config/opensearch_dashboards.yml
# Not useful now as error shows when trying to force a background run with parameters on Windows
# bin/opensearch-dashboards.bat serve ${{ inputs.osd-serve-args }} &
# No hardcoded plugin settings here — each workflow passes what it needs
# via osd-serve-args (e.g. --data_source.enabled=true --vis_builder.enabled=true)
if [ "$SECURITY_ENABLED" = 'false' ]; then
echo "Remove Dashboards Security"
./bin/opensearch-dashboards-plugin.bat remove securityDashboards
Expand Down Expand Up @@ -141,17 +160,17 @@ jobs:
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: failure()
with:
name: cypress-screenshots
name: cypress-screenshots${{ inputs.artifact-name-suffix }}
path: cypress-test/cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: cypress-videos
name: cypress-videos${{ inputs.artifact-name-suffix }}
path: cypress-test/cypress/videos
# Test reports was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: cypress-results
name: cypress-results${{ inputs.artifact-name-suffix }}
path: cypress-test/cypress/results
20 changes: 13 additions & 7 deletions cypress/utils/plugins/dashboards-assistant/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,12 @@ Cypress.Commands.add('putAgentIdConfig', ({ type, agentName, agentId }) => {
// The .plugins-ml-config index is a system index and need to call the API by using certificate file
if (Cypress.platform === 'win32') {
return cy.exec(
`curl -k --cert "${Cypress.env(
`bash -c "curl -k --cert '${Cypress.env(
'SECURITY_CERT_PATH'
)}" --key "${Cypress.env(
)}' --key '${Cypress.env(
'SECURITY_KEY_PATH'
)}" -XPUT "${endpoint}" -H "Content-Type: application/json" -d "{\\"type\\":\\"os_chat_root_agent\\",\\"configuration\\":{\\"agent_id\\":\\"${agentId}\\"}}"`
)}' -XPUT '${endpoint}' -H 'Content-Type: application/json' -d '{\\"type\\":\\"os_chat_root_agent\\",\\"configuration\\":{\\"agent_id\\":\\"${agentId}\\"}}'"`,
{ timeout: 30000 }
);
} else {
return cy.exec(
Expand Down Expand Up @@ -253,19 +254,24 @@ Cypress.Commands.add('deleteAgentConfig', ({ agentName }) => {
// The .plugins-ml-config index is a system index and need to call the API by using certificate file
if (Cypress.platform === 'win32') {
return cy.exec(
`curl -k --cert "${Cypress.env(
`bash -c "curl -k --cert '${Cypress.env(
'SECURITY_CERT_PATH'
)}" --key "${Cypress.env(
)}' --key '${Cypress.env(
'SECURITY_KEY_PATH'
)}" -XDELETE "${endpoint}" -H "Content-Type: application/json"`
)}' -XDELETE '${endpoint}' -H 'Content-Type: application/json'"`,
{ timeout: 30000, failOnNonZeroExit: false }
);
} else {
return cy.exec(
`curl -k --cert <(cat <<EOF \n${certPublicKeyContent}\nEOF\n) --key <(cat <<EOF\n${certPrivateKeyContent}\nEOF\n) -XDELETE '${endpoint}' -H 'Content-Type: application/json'`
);
}
} else {
return cy.request('DELETE', endpoint);
return cy.request({
method: 'DELETE',
url: endpoint,
failOnStatusCode: false,
});
}
});

Expand Down
15 changes: 8 additions & 7 deletions cypress/utils/plugins/dashboards-investigation/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,12 @@ Cypress.Commands.add(
if (BACKEND_BASE_PATH.startsWith('https')) {
if (Cypress.platform === 'win32') {
return cy.exec(
`curl -k --cert "${Cypress.env(
`bash -c "curl -k --cert '${Cypress.env(
'SECURITY_CERT_PATH'
)}" --key "${Cypress.env(
)}' --key '${Cypress.env(
'SECURITY_KEY_PATH'
)}" -XPUT "${endpoint}" -H "Content-Type: application/json" -d "{\\"type\\":\\"${type}\\",\\"configuration\\":{\\"agent_id\\":\\"${agentId}\\"}}"`
)}' -XPUT '${endpoint}' -H 'Content-Type: application/json' -d '{\\"type\\":\\"${type}\\",\\"configuration\\":{\\"agent_id\\":\\"${agentId}\\"}}'"`,
{ timeout: 30000 }
);
} else {
return cy.exec(
Expand All @@ -267,12 +268,12 @@ Cypress.Commands.add('deleteInvestigationAgentConfig', ({ agentName }) => {
if (BACKEND_BASE_PATH.startsWith('https')) {
if (Cypress.platform === 'win32') {
return cy.exec(
`curl -k --cert "${Cypress.env(
`bash -c "curl -k --cert '${Cypress.env(
'SECURITY_CERT_PATH'
)}" --key "${Cypress.env(
)}' --key '${Cypress.env(
'SECURITY_KEY_PATH'
)}" -XDELETE "${endpoint}" -H "Content-Type: application/json"`,
{ failOnNonZeroExit: false }
)}' -XDELETE '${endpoint}' -H 'Content-Type: application/json'"`,
{ timeout: 30000, failOnNonZeroExit: false }
);
} else {
return cy.exec(
Expand Down
Loading