From 7f17e2f84280ec345d05a263211714749d05bf0e Mon Sep 17 00:00:00 2001 From: Sanket Dharwadkar Date: Fri, 10 Nov 2023 12:45:49 -0800 Subject: [PATCH] fix: e2etest cleanup --- main/end-to-end-tests/checkConnection.js | 29 ------------------- .../appstream-egress-enabled/workspaces.cy.js | 15 ++-------- main/end-to-end-tests/package-lock.json | 8 +---- main/end-to-end-tests/package.json | 1 - pnpm-lock.yaml | 7 ----- 5 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 main/end-to-end-tests/checkConnection.js diff --git a/main/end-to-end-tests/checkConnection.js b/main/end-to-end-tests/checkConnection.js deleted file mode 100644 index 270b7bea80..0000000000 --- a/main/end-to-end-tests/checkConnection.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file 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 file is used for checking whether an IP Address is reachable on a particular port -// eslint-disable-next-line import/no-extraneous-dependencies -const tcpp = require('tcp-ping'); - -const [ipAddress, port] = process.argv.slice(2); -(async () => { - const tcpPingPromise = (ipAddr, portForIp) => - new Promise((resolve, reject) => tcpp.probe(ipAddr, portForIp, (err, data) => (err ? reject(err) : resolve(data)))); - const response = await tcpPingPromise(ipAddress, port); - // If the ping was successful the exit code should be 0 - if (response) { - process.exit(0); - } - process.exit(1); -})(); diff --git a/main/end-to-end-tests/cypress/e2e/appstream-egress-enabled/workspaces.cy.js b/main/end-to-end-tests/cypress/e2e/appstream-egress-enabled/workspaces.cy.js index 5562b49f4e..ad1459404b 100644 --- a/main/end-to-end-tests/cypress/e2e/appstream-egress-enabled/workspaces.cy.js +++ b/main/end-to-end-tests/cypress/e2e/appstream-egress-enabled/workspaces.cy.js @@ -27,9 +27,6 @@ describe('Launch new workspaces', () => { navigateToWorkspaces(); terminateWorkspaces(); }); - after(() => { - terminateWorkspaces(); - }); let expectedNumberOfNewlyOpenBrowserWindows = 0; @@ -50,6 +47,8 @@ describe('Launch new workspaces', () => { cy.window() .its('open') .should('have.callCount', expectedNumberOfNewlyOpenBrowserWindows); + + terminateWorkspaces(); }); function checkWindows(workspaceName) { @@ -136,14 +135,4 @@ describe('Launch new workspaces', () => { .find('[data-testid=sc-environment-generate-url-button]', { timeout: 60000 }) .click(); } - - /** - * This test checks that the connection library we're using works correctly. - */ - it('checkConnection should work correctly', () => { - // 8.8.8.8 is Google's DNS server - cy.exec(`node checkConnection.js 8.8.8.8 443`) - .its('code') - .should('equal', 0); - }); }); diff --git a/main/end-to-end-tests/package-lock.json b/main/end-to-end-tests/package-lock.json index 1c91fff030..be928b7283 100644 --- a/main/end-to-end-tests/package-lock.json +++ b/main/end-to-end-tests/package-lock.json @@ -26,8 +26,7 @@ "husky": "^3.1.0", "lodash": "^4.17.21", "prettier": "^1.19.1", - "pretty-quick": "^1.11.1", - "tcp-ping": "^0.1.1" + "pretty-quick": "^1.11.1" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -5899,11 +5898,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tcp-ping": { - "version": "0.1.1", - "integrity": "sha512-7Ed10Ds0hYnF+O1lfiZ2iSZ1bCAj+96Madctebmq7Y1ALPWlBY4YI8C6pCL+UTlshFY5YogixKLpgDP/4BlHrw==", - "dev": true - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", diff --git a/main/end-to-end-tests/package.json b/main/end-to-end-tests/package.json index 1ed36683f6..46b3e849e7 100644 --- a/main/end-to-end-tests/package.json +++ b/main/end-to-end-tests/package.json @@ -41,7 +41,6 @@ "lodash": "^4.17.21", "prettier": "^1.19.1", "pretty-quick": "^1.11.1", - "tcp-ping": "^0.1.1", "eslint-plugin-react-hooks": "^4.3.0", "eslint-plugin-react": "^7.28.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e13523b79d..7e34e8cea5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3439,9 +3439,6 @@ importers: pretty-quick: specifier: ^1.11.1 version: 1.11.1(prettier@1.19.1) - tcp-ping: - specifier: ^0.1.1 - version: 0.1.1 main/infrastructure-tests: dependencies: @@ -23813,10 +23810,6 @@ packages: yallist: 4.0.0 dev: true - /tcp-ping@0.1.1: - resolution: {integrity: sha512-7Ed10Ds0hYnF+O1lfiZ2iSZ1bCAj+96Madctebmq7Y1ALPWlBY4YI8C6pCL+UTlshFY5YogixKLpgDP/4BlHrw==} - dev: true - /terminal-link@2.1.1: resolution: {integrity: sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==} engines: {node: '>=8'}