From c9960f9cee75ccddb3883f347bf5dad6d315b691 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 22 Jan 2022 13:07:14 +0100 Subject: [PATCH] Cleanup package.json test scripts (#141210) * tests - remove `yarn test` * fix smoke test * readme * :lipstick: * ci - do not install playwright --- .github/workflows/ci.yml | 6 +++--- build/azure-pipelines/darwin/product-build-darwin.yml | 2 +- build/azure-pipelines/linux/product-build-linux.yml | 2 +- build/azure-pipelines/win32/product-build-win32.yml | 2 +- package.json | 7 ++++--- test/README.md | 1 - test/smoke/README.md | 6 ------ 7 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b06ac2e1a4..229a1ddf6dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: run: yarn test-node - name: Run Unit Tests (Browser, Chromium) - run: yarn test-browser --browser chromium + run: yarn test-browser-no-install --browser chromium - name: Run Integration Tests (Electron) run: .\scripts\test-integration.bat @@ -159,7 +159,7 @@ jobs: - name: Run Unit Tests (Browser, Chromium) id: browser-unit-tests - run: DISPLAY=:10 yarn test-browser --browser chromium + run: DISPLAY=:10 yarn test-browser-no-install --browser chromium - name: Run Integration Tests (Electron) id: electron-integration-tests @@ -236,7 +236,7 @@ jobs: run: yarn test-node - name: Run Unit Tests (Browser, Chromium) - run: DISPLAY=:10 yarn test-browser --browser chromium + run: DISPLAY=:10 yarn test-browser-no-install --browser chromium - name: Run Integration Tests (Electron) run: DISPLAY=:10 ./scripts/test-integration.sh diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index a878dd4b1be..f47777b1fb1 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -186,7 +186,7 @@ steps: - script: | set -e - DEBUG=*browser* yarn test-browser --sequential --build --browser chromium --browser webkit --tfs "Browser Unit Tests" + DEBUG=*browser* yarn test-browser-no-install --sequential --build --browser chromium --browser webkit --tfs "Browser Unit Tests" displayName: Run unit tests (Browser, Chromium & Webkit) timeoutInMinutes: 30 condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index b158bc5761d..1cbb1d563fa 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -182,7 +182,7 @@ steps: - script: | set -e - DEBUG=*browser* yarn test-browser --build --browser chromium --tfs "Browser Unit Tests" + DEBUG=*browser* yarn test-browser-no-install --build --browser chromium --tfs "Browser Unit Tests" displayName: Run unit tests (Browser, Chromium) timeoutInMinutes: 7 condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) diff --git a/build/azure-pipelines/win32/product-build-win32.yml b/build/azure-pipelines/win32/product-build-win32.yml index c3db4e58f4c..782c1cd1f7a 100644 --- a/build/azure-pipelines/win32/product-build-win32.yml +++ b/build/azure-pipelines/win32/product-build-win32.yml @@ -167,7 +167,7 @@ steps: - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - exec { yarn test-browser --sequential --build --browser chromium --browser firefox --tfs "Browser Unit Tests" } + exec { yarn test-browser-no-install --sequential --build --browser chromium --browser firefox --tfs "Browser Unit Tests" } displayName: Run unit tests (Browser, Chromium & Firefox) timeoutInMinutes: 20 condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64')) diff --git a/package.json b/package.json index c9e46e9bb45..8d96d5ae347 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,9 @@ "main": "./out/main", "private": true, "scripts": { - "test": "mocha", - "test-browser": "node test/unit/browser/index.js", + "test": "echo Please run any of the test scripts from the scripts folder.", + "test-browser": "npx playwright install && node test/unit/browser/index.js", + "test-browser-no-install": "node test/unit/browser/index.js", "test-node": "mocha test/unit/node/index.js --delay --ui=tdd --exit", "preinstall": "node build/npm/preinstall.js", "postinstall": "node build/npm/postinstall.js", @@ -34,7 +35,7 @@ "7z": "7z", "update-grammars": "node build/npm/update-all-grammars.js", "update-localization-extension": "node build/npm/update-localization-extension.js", - "smoketest": "cd test/smoke && yarn compile && node test/index.js", + "smoketest": "node build/lib/preLaunch.js && cd test/smoke && yarn compile && node test/index.js", "smoketest-no-compile": "cd test/smoke && node test/index.js", "download-builtin-extensions": "node build/lib/builtInExtensions.js", "download-builtin-extensions-cg": "node build/lib/builtInExtensionsCG.js", diff --git a/test/README.md b/test/README.md index 445945d7c9e..80cf9d92912 100644 --- a/test/README.md +++ b/test/README.md @@ -6,4 +6,3 @@ This folder contains the various test runners for VSCode. Please refer to the do * `unit`: our suite of unit tests ([README](unit/README.md)) * `integration`: our suite of API tests ([README](integration/browser/README.md)) * `smoke`: our suite of automated UI tests ([README](smoke/README.md)) -* `ui`: our suite of manual UI tests diff --git a/test/smoke/README.md b/test/smoke/README.md index 9d95d597675..86777cab856 100644 --- a/test/smoke/README.md +++ b/test/smoke/README.md @@ -8,12 +8,6 @@ Make sure you are on **Node v12.x**. # Build extensions in the VS Code repo (if needed) yarn && yarn compile -# Install Dependencies and Compile -yarn --cwd test/smoke - -# Prepare OSS in repo* -node build/lib/preLaunch.js - # Dev (Electron) yarn smoketest