From 5888913ce3a7456bae7ca10df803c49f303d5114 Mon Sep 17 00:00:00 2001 From: Elizabeth Thompson Date: Thu, 12 Sep 2024 16:18:43 -0700 Subject: [PATCH 1/2] add memory management to cypress config --- superset-frontend/cypress-base/cypress.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/cypress-base/cypress.config.ts b/superset-frontend/cypress-base/cypress.config.ts index 4d31f4d0982f5..bcdf6f67a8025 100644 --- a/superset-frontend/cypress-base/cypress.config.ts +++ b/superset-frontend/cypress-base/cypress.config.ts @@ -26,9 +26,9 @@ export default eyesPlugin( defaultCommandTimeout: 8000, numTestsKeptInMemory: 0, experimentalFetchPolyfill: true, + experimentalMemoryManagement: true, requestTimeout: 10000, video: false, - videoUploadOnPasses: false, viewportWidth: 1280, viewportHeight: 1024, projectId: 'ud5x2f', From a959afe9274245005ff84b06c9539f739a57fe2c Mon Sep 17 00:00:00 2001 From: Elizabeth Thompson Date: Thu, 12 Sep 2024 16:51:05 -0700 Subject: [PATCH 2/2] bump cypress --- .../cypress-base/cypress.config.ts | 8 +++-- .../cypress-base/cypress/plugins/index.js | 31 ------------------- .../cypress-base/package-lock.json | 28 ++++++++--------- superset-frontend/cypress-base/package.json | 4 +-- 4 files changed, 22 insertions(+), 49 deletions(-) delete mode 100644 superset-frontend/cypress-base/cypress/plugins/index.js diff --git a/superset-frontend/cypress-base/cypress.config.ts b/superset-frontend/cypress-base/cypress.config.ts index bcdf6f67a8025..07aefdf677e07 100644 --- a/superset-frontend/cypress-base/cypress.config.ts +++ b/superset-frontend/cypress-base/cypress.config.ts @@ -20,6 +20,8 @@ import { defineConfig } from 'cypress'; import eyesPlugin from '@applitools/eyes-cypress'; +const { verifyDownloadTasks } = require('cy-verify-downloads'); + export default eyesPlugin( defineConfig({ chromeWebSecurity: false, @@ -60,9 +62,11 @@ export default eyesPlugin( } return launchOptions; }); - + // eslint-disable-next-line global-require + require('@cypress/code-coverage/task')(on, config); + on('task', verifyDownloadTasks); // eslint-disable-next-line global-require,import/extensions - return require('./cypress/plugins/index.js')(on, config); + return config; }, baseUrl: 'http://localhost:8088', excludeSpecPattern: [], diff --git a/superset-frontend/cypress-base/cypress/plugins/index.js b/superset-frontend/cypress-base/cypress/plugins/index.js deleted file mode 100644 index 02ee1971c6f1d..0000000000000 --- a/superset-frontend/cypress-base/cypress/plugins/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -const { isFileExist, findFiles } = require('cy-verify-downloads'); - -module.exports = (on, config) => { - // eslint-disable-next-line global-require - require('@cypress/code-coverage/task')(on, config); - on('task', { isFileExist, findFiles }); - return config; -}; - -require('@applitools/eyes-cypress')(module); diff --git a/superset-frontend/cypress-base/package-lock.json b/superset-frontend/cypress-base/package-lock.json index 82320db22b29c..0827c87ba92cd 100644 --- a/superset-frontend/cypress-base/package-lock.json +++ b/superset-frontend/cypress-base/package-lock.json @@ -13,7 +13,7 @@ "@cypress/code-coverage": "^3.10.4", "@superset-ui/core": "^2.1.0", "brace": "^0.11.1", - "cy-verify-downloads": "^0.1.6", + "cy-verify-downloads": "^0.2.5", "cypress-fail-on-console-error": "^4.0.3", "nanoid": "^5.0.7", "querystringify": "^2.2.0", @@ -22,7 +22,7 @@ }, "devDependencies": { "@types/querystringify": "^2.0.0", - "cypress": "^10.11.0", + "cypress": "^11.2.0", "eslint-plugin-cypress": "^3.5.0" } }, @@ -4810,14 +4810,14 @@ "integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==" }, "node_modules/cy-verify-downloads": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/cy-verify-downloads/-/cy-verify-downloads-0.1.6.tgz", - "integrity": "sha512-oYeAgL/ncAAfeh3bjCQlrD125cHzwlTQ+20hgMeQw64oBQp95DOcji7epPOADtzuRXu72P8j3DkZYlaY8gINtA==" + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/cy-verify-downloads/-/cy-verify-downloads-0.2.5.tgz", + "integrity": "sha512-HiFsVlHOm0EStSZKaeKUgWbIzEahm9vNV0ggavr++q5fdqhJnc/8NXsTl0VzIHLgIXnBN6b9Y7Hfy1BAmuwlZQ==" }, "node_modules/cypress": { - "version": "10.11.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-10.11.0.tgz", - "integrity": "sha512-lsaE7dprw5DoXM00skni6W5ElVVLGAdRUUdZjX2dYsGjbY/QnpzWZ95Zom1mkGg0hAaO/QVTZoFVS7Jgr/GUPA==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", + "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", "hasInstallScript": true, "dependencies": { "@cypress/request": "^2.88.10", @@ -14168,14 +14168,14 @@ "integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==" }, "cy-verify-downloads": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/cy-verify-downloads/-/cy-verify-downloads-0.1.6.tgz", - "integrity": "sha512-oYeAgL/ncAAfeh3bjCQlrD125cHzwlTQ+20hgMeQw64oBQp95DOcji7epPOADtzuRXu72P8j3DkZYlaY8gINtA==" + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/cy-verify-downloads/-/cy-verify-downloads-0.2.5.tgz", + "integrity": "sha512-HiFsVlHOm0EStSZKaeKUgWbIzEahm9vNV0ggavr++q5fdqhJnc/8NXsTl0VzIHLgIXnBN6b9Y7Hfy1BAmuwlZQ==" }, "cypress": { - "version": "10.11.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-10.11.0.tgz", - "integrity": "sha512-lsaE7dprw5DoXM00skni6W5ElVVLGAdRUUdZjX2dYsGjbY/QnpzWZ95Zom1mkGg0hAaO/QVTZoFVS7Jgr/GUPA==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", + "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", "requires": { "@cypress/request": "^2.88.10", "@cypress/xvfb": "^1.2.4", diff --git a/superset-frontend/cypress-base/package.json b/superset-frontend/cypress-base/package.json index b24c424c7900d..031b28bb5c2c5 100644 --- a/superset-frontend/cypress-base/package.json +++ b/superset-frontend/cypress-base/package.json @@ -20,7 +20,7 @@ "@cypress/code-coverage": "^3.10.4", "@superset-ui/core": "^2.1.0", "brace": "^0.11.1", - "cy-verify-downloads": "^0.1.6", + "cy-verify-downloads": "^0.2.5", "cypress-fail-on-console-error": "^4.0.3", "querystringify": "^2.2.0", "react-dom": "^16.13.0", @@ -29,7 +29,7 @@ }, "devDependencies": { "@types/querystringify": "^2.0.0", - "cypress": "^10.11.0", + "cypress": "^11.2.0", "eslint-plugin-cypress": "^3.5.0" } }