From c9c5b48c8009bf78a4590af647550d8f9e82d921 Mon Sep 17 00:00:00 2001 From: "Yuichiro Tachibana (Tsuchiya)" Date: Mon, 30 Oct 2023 21:21:07 +0900 Subject: [PATCH 1/4] Replace the activationEvent "*" with "onStartupFinished" --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5c650664d4..e8e6295296 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "mark mode" ], "activationEvents": [ - "*" + "onStartupFinished" ], "extensionKind": [ "ui" From 98368745480cf5e2e6eea2b7673e9d0503537d57 Mon Sep 17 00:00:00 2001 From: "Yuichiro Tachibana (Tsuchiya)" Date: Tue, 31 Oct 2023 01:12:46 +0900 Subject: [PATCH 2/4] Remove `scripts/run-web-test.sh` which was introduced in #1661 --- package.json | 2 +- scripts/run-web-test.sh | 33 --------------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100755 scripts/run-web-test.sh diff --git a/package.json b/package.json index e8e6295296..cde677248d 100644 --- a/package.json +++ b/package.json @@ -6650,7 +6650,7 @@ "check:eslint": "eslint src --ext ts", "pretest": "yarn run test-compile", "test": "node ./out/test/runTest.js", - "test:web": "./scripts/run-web-test.sh", + "test:web": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=. --extensionTestsPath=dist/web/test/suite/index.js --permission clipboard-read --permission clipboard-write", "pretest:web": "yarn run compile-web", "compile-web": "webpack --config ./build/web-extension.webpack.config.js", "watch-web": "webpack --watch --config ./build/web-extension.webpack.config.js", diff --git a/scripts/run-web-test.sh b/scripts/run-web-test.sh deleted file mode 100755 index 909c345859..0000000000 --- a/scripts/run-web-test.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -u -ARGS=$@ -ROOT="$(dirname "$(dirname "$(realpath "$0")")")" - -# Remove the "*" activation event from package.json -# so that the extension is not activated when running tests. -# Ref: https://github.com/microsoft/vscode-test-web/issues/96#issuecomment-1702658443 -setup() { - echo "Rename package.json to package.json.bk" - mv ${ROOT}/package.json ${ROOT}/package.json.bk - echo "Remove the \"*\" activation event from package.json" - jq '.activationEvents |= map(select(. != "*"))' ${ROOT}/package.json.bk > ${ROOT}/package.json -} - -tearDown() { - echo "Restore package.json" - mv ${ROOT}/package.json.bk ${ROOT}/package.json -} - -setup - -yarn vscode-test-web \ - --browserType=chromium \ - --extensionDevelopmentPath=. \ - --extensionTestsPath=dist/web/test/suite/index.js \ - --permission clipboard-read \ - --permission clipboard-write \ - $ARGS -retval=$? - -tearDown - -exit $retval From 52889b7231be18c1e10d3eea88db4e7b885c72a5 Mon Sep 17 00:00:00 2001 From: "Yuichiro Tachibana (Tsuchiya)" Date: Tue, 31 Oct 2023 11:25:36 +0900 Subject: [PATCH 3/4] Revert "Remove `scripts/run-web-test.sh` which was introduced in #1661" This reverts commit 98368745480cf5e2e6eea2b7673e9d0503537d57. --- package.json | 2 +- scripts/run-web-test.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 scripts/run-web-test.sh diff --git a/package.json b/package.json index cde677248d..e8e6295296 100644 --- a/package.json +++ b/package.json @@ -6650,7 +6650,7 @@ "check:eslint": "eslint src --ext ts", "pretest": "yarn run test-compile", "test": "node ./out/test/runTest.js", - "test:web": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=. --extensionTestsPath=dist/web/test/suite/index.js --permission clipboard-read --permission clipboard-write", + "test:web": "./scripts/run-web-test.sh", "pretest:web": "yarn run compile-web", "compile-web": "webpack --config ./build/web-extension.webpack.config.js", "watch-web": "webpack --watch --config ./build/web-extension.webpack.config.js", diff --git a/scripts/run-web-test.sh b/scripts/run-web-test.sh new file mode 100755 index 0000000000..909c345859 --- /dev/null +++ b/scripts/run-web-test.sh @@ -0,0 +1,33 @@ +#!/bin/bash -u +ARGS=$@ +ROOT="$(dirname "$(dirname "$(realpath "$0")")")" + +# Remove the "*" activation event from package.json +# so that the extension is not activated when running tests. +# Ref: https://github.com/microsoft/vscode-test-web/issues/96#issuecomment-1702658443 +setup() { + echo "Rename package.json to package.json.bk" + mv ${ROOT}/package.json ${ROOT}/package.json.bk + echo "Remove the \"*\" activation event from package.json" + jq '.activationEvents |= map(select(. != "*"))' ${ROOT}/package.json.bk > ${ROOT}/package.json +} + +tearDown() { + echo "Restore package.json" + mv ${ROOT}/package.json.bk ${ROOT}/package.json +} + +setup + +yarn vscode-test-web \ + --browserType=chromium \ + --extensionDevelopmentPath=. \ + --extensionTestsPath=dist/web/test/suite/index.js \ + --permission clipboard-read \ + --permission clipboard-write \ + $ARGS +retval=$? + +tearDown + +exit $retval From febd54f54271c2a91033c0d064eb2cf979baf6b3 Mon Sep 17 00:00:00 2001 From: "Yuichiro Tachibana (Tsuchiya)" Date: Tue, 31 Oct 2023 11:26:32 +0900 Subject: [PATCH 4/4] Fix scripts/run-web-test.sh --- scripts/run-web-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-web-test.sh b/scripts/run-web-test.sh index 909c345859..9f0b8746b1 100755 --- a/scripts/run-web-test.sh +++ b/scripts/run-web-test.sh @@ -9,7 +9,7 @@ setup() { echo "Rename package.json to package.json.bk" mv ${ROOT}/package.json ${ROOT}/package.json.bk echo "Remove the \"*\" activation event from package.json" - jq '.activationEvents |= map(select(. != "*"))' ${ROOT}/package.json.bk > ${ROOT}/package.json + jq '.activationEvents |= map(select(. != "onStartupFinished"))' ${ROOT}/package.json.bk > ${ROOT}/package.json } tearDown() {