Skip to content

Commit 2d9c796

Browse files
Fix integtest.sh security enabled case (#74)
Signed-off-by: bowenlan-amzn <[email protected]>
1 parent 000e96e commit 2d9c796

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

.github/workflows/cypress-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
with:
8484
repository: opensearch-project/OpenSearch-Dashboards
8585
path: OpenSearch-Dashboards
86-
ref: '1.0'
86+
ref: '1.0.0'
8787
- name: Get node and yarn versions
8888
id: versions
8989
run: |

cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"viewportWidth": 1440,
44
"defaultCommandTimeout": 10000,
55
"env": {
6-
"opensearch": "http://localhost:9200",
6+
"opensearch_url": "localhost:9200",
77
"opensearch_dashboards": "http://localhost:5601",
88
"security_enabled": false,
99
"username": "admin",

cypress/support/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,11 @@ Cypress.on("uncaught:exception", (err) => {
5252
return false;
5353
}
5454
});
55+
56+
// Switch the base URL of Opensearch when security enabled in the cluster
57+
// Not doing this for Dashboards because it can still use http when security enabled
58+
if (Cypress.env("security_enabled")) {
59+
Cypress.env("opensearch", `https://${Cypress.env("opensearch_url")}`);
60+
} else {
61+
Cypress.env("opensearch", `http://${Cypress.env("opensearch_url")}`);
62+
}

integtest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ then
7474
fi
7575

7676
yarn osd bootstrap
77-
cypress run --env security_enabled=$SECURITY_ENABLED opensearch=${BIND_ADDRESS}:${BIND_PORT} opensearch_dashboards=${BIND_ADDRESS}:${BIND_PORT}
77+
cypress run --env security_enabled=$SECURITY_ENABLED opensearch_dashboards=${BIND_ADDRESS}:${BIND_PORT}

0 commit comments

Comments
 (0)