Skip to content

Commit

Permalink
Updating cypress version and fixing CVE-2024-21538 (#1247)
Browse files Browse the repository at this point in the history
* Updating cypress version

Signed-off-by: Kshitij Tandon <tandonks@amazon.com>

* Fixing CVE-2024-21538

Signed-off-by: Kshitij Tandon <tandonks@amazon.com>

* Testing cypress baselining

Signed-off-by: Kshitij Tandon <tandonks@amazon.com>

* Modifying spec patterns

Signed-off-by: Kshitij Tandon <tandonks@amazon.com>

* Fixing an issue in snpashot e2e test

Signed-off-by: Kshitij Tandon <tandonks@amazon.com>

---------

Signed-off-by: Kshitij Tandon <tandonks@amazon.com>
  • Loading branch information
tandonks authored Jan 30, 2025
1 parent c459af0 commit 3eb1b24
Show file tree
Hide file tree
Showing 24 changed files with 101 additions and 131 deletions.
47 changes: 47 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
specPattern: "cypress/e2e/plugins/index-management-dashboards-plugin/*.{js,jsx,ts,tsx}",
defaultCommandTimeout: 60000,
requestTimeout: 60000,
responseTimeout: 60000,
baseUrl: "http://localhost:5601",
viewportWidth: 2000,
viewportHeight: 1320,
env: {
openSearchUrl: "http://localhost:9200",
SECURITY_ENABLED: false,
username: "admin",
password: "admin",
},
clientCertificates: [
{
url: "https://localhost:9200/.opendistro-ism*",
ca: ["cypress/resources/root-ca.pem"],
certs: [
{
cert: "cypress/resources/kirk.pem",
key: "cypress/resources/kirk-key.pem",
passphrase: "",
},
],
},
{
url: "https://localhost:9200/.opendistro-ism-config/_update_by_query/",
ca: ["cypress/resources/root-ca.pem"],
certs: [
{
cert: "cypress/resources/kirk.pem",
key: "cypress/resources/kirk-key.pem",
passphrase: "",
},
],
},
],
setupNodeEvents(on, config) {
// implement node event listeners here
return config;
},
},
});
48 changes: 0 additions & 48 deletions cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ describe("Rollups", () => {
cy.wait("@getRollup").wait(2000);

// Click Disable button
cy.get(`[data-test-subj="disableButton"]`)
.should("not.be.disabled")
.click({ force: true });
cy.get(`[data-test-subj="disableButton"]`).should("not.be.disabled").click({ force: true });

cy.wait("@stopRollup");
cy.wait("@getRollup");
Expand All @@ -270,9 +268,7 @@ describe("Rollups", () => {
cy.wait(2000);

// Click Enable button
cy.get(`[data-test-subj="enableButton"]`)
.should("not.be.disabled")
.click({ force: true });
cy.get(`[data-test-subj="enableButton"]`).should("not.be.disabled").click({ force: true });

// Confirm we get toaster saying rollup job is enabled
cy.contains(`${ROLLUP_ID} is enabled`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ describe("Snapshots", () => {

describe("Snapshot can be restored", () => {
it("Successfully restores indexes from snapshot", () => {
cy.visit(`${BASE_PATH}/app/${IM_PLUGIN_NAME}#/snapshots`);
// Wait for snapshot to be created successfully with a 12sec timeout
cy.get(`[data-test-subj="refreshButton"]`, { timeout: 12000 })
.should("be.visible")
Expand Down Expand Up @@ -124,6 +125,7 @@ describe("Snapshots", () => {

describe("Snapshot can be deleted", () => {
it("deletes snapshot successfully", () => {
cy.visit(`${BASE_PATH}/app/${IM_PLUGIN_NAME}#/snapshots`);
// Select test snapshot
cy.get(`[data-test-subj="checkboxSelectRow-test_repo:test_snapshot"]`).check({ force: true });

Expand Down
45 changes: 0 additions & 45 deletions cypress/plugins/index.js

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion cypress/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Cypress.Commands.add("login", () => {

Cypress.Commands.add("deleteAllIndices", () => {
cy.log("Deleting all indexes");
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/index*,sample*,opensearch_dashboards*`);
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/test_index_*,index*,sample*,opensearch_dashboards*`);
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/.opendistro-ism*?expand_wildcards=all`);
});

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"@cypress/request": "^3.0.0",
"**/ansi-regex": "^5.0.1",
"**/loader-utils": "^2.0.4",
"**/typescript": "4.0.2"
"**/typescript": "4.0.2",
"**/eslint/cross-spawn": "^7.0.5"
},
"devDependencies": {
"@elastic/elastic-eslint-config-kibana": "link:../../packages/opensearch-eslint-config-opensearch-dashboards",
Expand All @@ -47,7 +48,7 @@
"@types/json-schema": "^7.0.11",
"@types/react-dom": "^16.9.8",
"@types/react-router-dom": "^5.3.2",
"cypress": "9.5.4",
"cypress": "12.17.4",
"diff": "^4.0.1",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "^1.2.1",
Expand Down
75 changes: 46 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==

"@cypress/request@^2.88.10", "@cypress/request@^3.0.0":
"@cypress/request@2.88.12", "@cypress/request@^3.0.0":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@cypress/request/-/request-3.0.1.tgz#72d7d5425236a2413bd3d8bb66d02d9dc3168960"
integrity sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==
Expand Down Expand Up @@ -268,10 +268,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.23.tgz#75c580983846181ebe5f4abc40fe9dfb2d65665f"
integrity sha512-DWNcCHolDq0ZKGizjx2DZjR/PqsYwAcYUJmfMWqtVU2MBMG5Mo+xFZrhGId5r/O5HOuMPyQEcM6KUBp5lBZZBg==

"@types/node@^14.14.31":
version "14.18.63"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.63.tgz#1788fa8da838dbb5f9ea994b834278205db6ca2b"
integrity sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==
"@types/node@^16.18.39":
version "16.18.125"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.125.tgz#c2bfb73222c573e5906843a13db24714c21ba556"
integrity sha512-w7U5ojboSPfZP4zD98d+/cjcN2BDW6lKH2M0ubipt8L8vUC7qUAC6ENKGSJL4tEktH2Saw2K4y1uwSjyRGKMhw==

"@types/normalize-package-data@^2.4.0":
version "2.4.1"
Expand Down Expand Up @@ -1229,12 +1229,7 @@ commander@^2.20.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==

commander@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==

commander@^6.2.0:
commander@^6.2.0, commander@^6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c"
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==
Expand Down Expand Up @@ -1378,6 +1373,15 @@ cross-spawn@^7.0.0:
shebang-command "^2.0.0"
which "^2.0.1"

cross-spawn@^7.0.5:
version "7.0.6"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==
dependencies:
path-key "^3.1.0"
shebang-command "^2.0.0"
which "^2.0.1"

crypto-browserify@^3.11.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec"
Expand Down Expand Up @@ -1405,14 +1409,14 @@ cyclist@^1.0.1:
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.2.tgz#673b5f233bf34d8e602b949429f8171d9121bea3"
integrity sha512-0sVXIohTfLqVIW3kb/0n6IiWF3Ifj5nm2XaSrLq2DI6fKIGa2fYAZdk917rUneaeLVpYfFcyXE2ft0fe3remsA==

cypress@9.5.4:
version "9.5.4"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.5.4.tgz#49d9272f62eba12f2314faf29c2a865610e87550"
integrity sha512-6AyJAD8phe7IMvOL4oBsI9puRNOWxZjl8z1lgixJMcgJ85JJmyKeP6uqNA0dI1z14lmJ7Qklf2MOgP/xdAqJ/Q==
cypress@12.17.4:
version "12.17.4"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.4.tgz#b4dadf41673058493fa0d2362faa3da1f6ae2e6c"
integrity sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ==
dependencies:
"@cypress/request" "^2.88.10"
"@cypress/request" "2.88.12"
"@cypress/xvfb" "^1.2.4"
"@types/node" "^14.14.31"
"@types/node" "^16.18.39"
"@types/sinonjs__fake-timers" "8.1.1"
"@types/sizzle" "^2.3.2"
arch "^2.2.0"
Expand All @@ -1424,12 +1428,12 @@ cypress@9.5.4:
check-more-types "^2.24.0"
cli-cursor "^3.1.0"
cli-table3 "~0.6.1"
commander "^5.1.0"
commander "^6.2.1"
common-tags "^1.8.0"
dayjs "^1.10.4"
debug "^4.3.2"
debug "^4.3.4"
enquirer "^2.3.6"
eventemitter2 "^6.4.3"
eventemitter2 "6.4.7"
execa "4.1.0"
executable "^4.1.1"
extract-zip "2.0.1"
Expand All @@ -1442,12 +1446,13 @@ cypress@9.5.4:
listr2 "^3.8.3"
lodash "^4.17.21"
log-symbols "^4.0.0"
minimist "^1.2.6"
minimist "^1.2.8"
ospath "^1.2.2"
pretty-bytes "^5.6.0"
process "^0.11.10"
proxy-from-env "1.0.0"
request-progress "^3.0.0"
semver "^7.3.2"
semver "^7.5.3"
supports-color "^8.1.1"
tmp "~0.2.1"
untildify "^4.0.0"
Expand Down Expand Up @@ -1506,13 +1511,20 @@ debug@^3.1.0, debug@^3.2.7:
dependencies:
ms "^2.1.1"

debug@^4.1.1, debug@^4.2.0, debug@^4.3.2:
debug@^4.1.1, debug@^4.2.0:
version "4.3.5"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e"
integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==
dependencies:
ms "2.1.2"

debug@^4.3.4:
version "4.4.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a"
integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==
dependencies:
ms "^2.1.3"

decamelize@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
Expand Down Expand Up @@ -1868,10 +1880,10 @@ estraverse@^5.2.0:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==

eventemitter2@^6.4.3:
version "6.4.9"
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.9.tgz#41f2750781b4230ed58827bc119d293471ecb125"
integrity sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==
eventemitter2@6.4.7:
version "6.4.7"
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.7.tgz#a7f6c4d7abf28a14c1ef3442f21cb306a054271d"
integrity sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==

events@^3.0.0:
version "3.3.0"
Expand Down Expand Up @@ -3248,6 +3260,11 @@ minimist@^1.2.6:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==

minimist@^1.2.8:
version "1.2.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==

mississippi@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022"
Expand Down Expand Up @@ -3301,7 +3318,7 @@ ms@2.1.2:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==

ms@^2.1.1:
ms@^2.1.1, ms@^2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
Expand Down Expand Up @@ -4102,7 +4119,7 @@ semver-compare@^1.0.0:
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==

"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0, semver@^5.7.2, semver@^6.0.0, semver@^7.3.2, semver@^7.5.3:
"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0, semver@^5.7.2, semver@^6.0.0, semver@^7.5.3:
version "7.5.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e"
integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==
Expand Down

0 comments on commit 3eb1b24

Please sign in to comment.