From 793f42ef10946916e390a1bb381ca7a1ddaa11a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 07:35:03 +0000 Subject: [PATCH 1/6] chore(deps-dev): bump @types/node from 20.16.5 to 22.5.5 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.16.5 to 22.5.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 20 ++++++++++++++------ package.json | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index a31b6e4..e2035cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,13 +18,13 @@ "properties-file": "^3.5.7" }, "devDependencies": { - "@aditosoftware/eslint-config-adito-platform": "latest", + "@aditosoftware/eslint-config-adito-platform": "*", "@types/chai": "^4.3.19", "@types/chai-fs": "^2.0.5", "@types/chai-string": "^1.4.5", "@types/download": "^8.0.5", "@types/mocha": "^10.0.8", - "@types/node": "20.x", + "@types/node": "22.x", "@types/sinon": "^17.0.3", "@types/vscode": "^1.84.0", "@vscode/test-cli": "^0.0.10", @@ -1182,11 +1182,10 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz", - "integrity": "sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==", + "version": "22.5.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz", + "integrity": "sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==", "dev": true, - "license": "MIT", "dependencies": { "undici-types": "~6.19.2" } @@ -6705,6 +6704,15 @@ "node": ">= 14" } }, + "node_modules/mariadb/node_modules/@types/node": { + "version": "20.16.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz", + "integrity": "sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } + }, "node_modules/markdown-it": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", diff --git a/package.json b/package.json index 325d1bb..dd13426 100644 --- a/package.json +++ b/package.json @@ -427,7 +427,7 @@ "@types/chai-string": "^1.4.5", "@types/download": "^8.0.5", "@types/mocha": "^10.0.8", - "@types/node": "20.x", + "@types/node": "22.x", "@types/sinon": "^17.0.3", "@types/vscode": "^1.84.0", "@vscode/test-cli": "^0.0.10", From efaefcf28f4bfc89aec91a85cfac1786c9916c21 Mon Sep 17 00:00:00 2001 From: Ramona Hartinger Date: Thu, 19 Sep 2024 13:23:34 +0200 Subject: [PATCH 2/6] chore(deps-dev): bump mariadb from 3.3.1 to 3.3.2 --- package-lock.json | 23 +++++++---------------- package.json | 4 ++-- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index e2035cd..8d66291 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "properties-file": "^3.5.7" }, "devDependencies": { - "@aditosoftware/eslint-config-adito-platform": "*", + "@aditosoftware/eslint-config-adito-platform": "latest", "@types/chai": "^4.3.19", "@types/chai-fs": "^2.0.5", "@types/chai-string": "^1.4.5", @@ -34,7 +34,7 @@ "chai-string": "^1.5.0", "concurrently": "^9.0.1", "copyfiles": "^2.4.1", - "mariadb": "^3.3.1", + "mariadb": "^3.3.2", "mkdirp": "^3.0.1", "rimraf": "^6.0.1", "run-func": "^3.0.0", @@ -6688,31 +6688,22 @@ } }, "node_modules/mariadb": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/mariadb/-/mariadb-3.3.1.tgz", - "integrity": "sha512-L8bh4iuZU3J8H7Co7rQ6OY9FDLItAN1rGy8kPA7Dyxo8AiHADuuONoypKKp1pE09drs6e5LR7UW9luLZ/A4znA==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/mariadb/-/mariadb-3.3.2.tgz", + "integrity": "sha512-kZvRy00thfFxEksfbDWq+77nB2M520PIZ26LLuHbOvyeZ5XQ3OCY/YsDDu+ifYNHIcs+7UCmjm50GiPdogc24w==", "dev": true, "license": "LGPL-2.1-or-later", "dependencies": { "@types/geojson": "^7946.0.14", - "@types/node": "^20.11.17", + "@types/node": "^22.5.4", "denque": "^2.1.0", "iconv-lite": "^0.6.3", - "lru-cache": "^10.2.0" + "lru-cache": "^10.3.0" }, "engines": { "node": ">= 14" } }, - "node_modules/mariadb/node_modules/@types/node": { - "version": "20.16.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz", - "integrity": "sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==", - "dev": true, - "dependencies": { - "undici-types": "~6.19.2" - } - }, "node_modules/markdown-it": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", diff --git a/package.json b/package.json index dd13426..fe6a8ec 100644 --- a/package.json +++ b/package.json @@ -437,7 +437,7 @@ "chai-string": "^1.5.0", "concurrently": "^9.0.1", "copyfiles": "^2.4.1", - "mariadb": "^3.3.1", + "mariadb": "^3.3.2", "mkdirp": "^3.0.1", "rimraf": "^6.0.1", "run-func": "^3.0.0", @@ -450,4 +450,4 @@ "webpack-cli": "^5.1.4", "webpack-shell-plugin-next": "^2.3.2" } -} \ No newline at end of file +} From 5b64f3512d925bdff3154031e1647dd9e6c6d24f Mon Sep 17 00:00:00 2001 From: Ramona Hartinger Date: Thu, 19 Sep 2024 14:03:19 +0200 Subject: [PATCH 3/6] test: added more error output for diff test for more error output during the pipeline --- src/test/e2e/webview/WebviewTestUtils.ts | 8 +++++-- src/test/suite/DockerTestUtils.ts | 30 +++++++++++++++--------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/test/e2e/webview/WebviewTestUtils.ts b/src/test/e2e/webview/WebviewTestUtils.ts index 6fc7803..53e8b46 100644 --- a/src/test/e2e/webview/WebviewTestUtils.ts +++ b/src/test/e2e/webview/WebviewTestUtils.ts @@ -184,8 +184,12 @@ export class WebviewTestUtils { await databaseName.sendKeys(config.databaseName, Key.TAB); const button = await webView.findWebElement(By.id(config.buttonToClick)); - - await button.click(); + try { + await button.click(); + } catch (error) { + await VSBrowser.instance.takeScreenshot(`${randomUUID()}-click-${config.buttonToClick}-${config.databaseType}`); + throw error; + } }); if (config.buttonToClick === "saveButton") { diff --git a/src/test/suite/DockerTestUtils.ts b/src/test/suite/DockerTestUtils.ts index 57de0dc..ab1f12e 100644 --- a/src/test/suite/DockerTestUtils.ts +++ b/src/test/suite/DockerTestUtils.ts @@ -1,6 +1,8 @@ import { exec } from "child_process"; import { isWindows } from "../../utilities/osUtilities"; import mariadb from "mariadb"; +import { VSBrowser } from "vscode-extension-tester"; +import { randomUUID } from "crypto"; /** * Creates and manages a maria docker container for tests. @@ -117,13 +119,9 @@ export class DockerTestUtils { * Checks the status of the specified container and the availability of the database within it. * * @param containerName - The name of the container to check. - * @param dbExecutable - The executable for the database client. * @returns A Promise that resolves when the container status and database availability are checked. */ - static async checkContainerStatus( - containerName: string = "mariadb", - dbExecutable: string = "mysql-client" - ): Promise { + static async checkContainerStatus(containerName: string = "mariadb"): Promise { const fullContainerName = this.containerNamePrefix + containerName; // check if container is running @@ -134,7 +132,7 @@ export class DockerTestUtils { case "mariadb": // install mysql to the container await this.repeatCommand( - `${this.docker} exec ${fullContainerName} sh -c "apt-get update && apt-get install -y ${dbExecutable}"` + `${this.docker} exec ${fullContainerName} sh -c "apt-get update && apt-get install -y mysql-client"` ); // check if database is available @@ -145,12 +143,22 @@ export class DockerTestUtils { // check if database is available case "postgres": - await this.repeatCommand(`${this.docker} exec ${fullContainerName} psql ${this.dbName} -c "SELECT 1;"`); + try { + await this.repeatCommand(`${this.docker} exec ${fullContainerName} psql ${this.dbName} -c "SELECT 1;"`); + } catch (error) { + await VSBrowser.instance.takeScreenshot(`${randomUUID()}-status-check`); + throw error; + } - // - await this.executeCommand( - `${this.docker} exec ${fullContainerName} psql ${this.dbName} -c "CREATE SCHEMA ${this.dbName};"` - ); + // create the needed schema + try { + await this.repeatCommand( + `${this.docker} exec ${fullContainerName} psql ${this.dbName} -c "CREATE SCHEMA ${this.dbName};"` + ); + } catch (error) { + await VSBrowser.instance.takeScreenshot(`${randomUUID()}-create-schema`); + throw error; + } break; default: From bc99df8e75fb157904ec402cae03fcf5bb6dcb1a Mon Sep 17 00:00:00 2001 From: Ramona Hartinger Date: Fri, 20 Sep 2024 06:23:06 +0200 Subject: [PATCH 4/6] test: removed debug screenshots and added enabled check on button --- src/test/e2e/webview/WebviewTestUtils.ts | 6 ++---- src/test/suite/DockerTestUtils.ts | 19 +++++-------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/test/e2e/webview/WebviewTestUtils.ts b/src/test/e2e/webview/WebviewTestUtils.ts index 53e8b46..4e836e8 100644 --- a/src/test/e2e/webview/WebviewTestUtils.ts +++ b/src/test/e2e/webview/WebviewTestUtils.ts @@ -184,11 +184,9 @@ export class WebviewTestUtils { await databaseName.sendKeys(config.databaseName, Key.TAB); const button = await webView.findWebElement(By.id(config.buttonToClick)); - try { + + if (await button.isEnabled()) { await button.click(); - } catch (error) { - await VSBrowser.instance.takeScreenshot(`${randomUUID()}-click-${config.buttonToClick}-${config.databaseType}`); - throw error; } }); diff --git a/src/test/suite/DockerTestUtils.ts b/src/test/suite/DockerTestUtils.ts index ab1f12e..06ac2e8 100644 --- a/src/test/suite/DockerTestUtils.ts +++ b/src/test/suite/DockerTestUtils.ts @@ -143,22 +143,13 @@ export class DockerTestUtils { // check if database is available case "postgres": - try { - await this.repeatCommand(`${this.docker} exec ${fullContainerName} psql ${this.dbName} -c "SELECT 1;"`); - } catch (error) { - await VSBrowser.instance.takeScreenshot(`${randomUUID()}-status-check`); - throw error; - } + await this.repeatCommand(`${this.docker} exec ${fullContainerName} psql ${this.dbName} -c "SELECT 1;"`); // create the needed schema - try { - await this.repeatCommand( - `${this.docker} exec ${fullContainerName} psql ${this.dbName} -c "CREATE SCHEMA ${this.dbName};"` - ); - } catch (error) { - await VSBrowser.instance.takeScreenshot(`${randomUUID()}-create-schema`); - throw error; - } + await this.repeatCommand( + `${this.docker} exec ${fullContainerName} psql ${this.dbName} -c "CREATE SCHEMA ${this.dbName};"` + ); + break; default: From 8260832c388538af2db29829fec78d013eac9998 Mon Sep 17 00:00:00 2001 From: Ramona Hartinger Date: Fri, 20 Sep 2024 06:26:53 +0200 Subject: [PATCH 5/6] chore: removed unused imports --- src/test/suite/DockerTestUtils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/suite/DockerTestUtils.ts b/src/test/suite/DockerTestUtils.ts index 06ac2e8..3d0ba69 100644 --- a/src/test/suite/DockerTestUtils.ts +++ b/src/test/suite/DockerTestUtils.ts @@ -1,8 +1,6 @@ import { exec } from "child_process"; import { isWindows } from "../../utilities/osUtilities"; import mariadb from "mariadb"; -import { VSBrowser } from "vscode-extension-tester"; -import { randomUUID } from "crypto"; /** * Creates and manages a maria docker container for tests. From f94cc9d833387e13df4ab52ab430249f9520725e Mon Sep 17 00:00:00 2001 From: Ramona Hartinger Date: Fri, 20 Sep 2024 07:25:48 +0200 Subject: [PATCH 6/6] test: trying to add some more error handling for clicks --- src/test/e2e/webview/WebviewTestUtils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/e2e/webview/WebviewTestUtils.ts b/src/test/e2e/webview/WebviewTestUtils.ts index 4e836e8..a823380 100644 --- a/src/test/e2e/webview/WebviewTestUtils.ts +++ b/src/test/e2e/webview/WebviewTestUtils.ts @@ -184,9 +184,13 @@ export class WebviewTestUtils { await databaseName.sendKeys(config.databaseName, Key.TAB); const button = await webView.findWebElement(By.id(config.buttonToClick)); + assert.deepStrictEqual(await button.getAttribute("id"), config.buttonToClick, "button id"); - if (await button.isEnabled()) { + try { await button.click(); + } catch { + await webView.switchToFrame(1000); + await webView.getDriver().executeScript("arguments[0].click();", button); } });