From 24b940b94c97096bdbd134968bb005f7dc5838d1 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 3 May 2024 22:45:30 +0900 Subject: [PATCH 1/8] chore(test): avoid project .yamlfmt pollution while running tests --- .gitignore | 1 + test/runTest.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index 2de09c9..3e72aa3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules /test/suite/testdata/**/*/test.yaml .env *.vsix +.bak diff --git a/test/runTest.js b/test/runTest.js index f4cbd65..d6fea4a 100644 --- a/test/runTest.js +++ b/test/runTest.js @@ -1,9 +1,19 @@ const path = require("path"); const os = require("os"); +const fs = require("fs"); const { runTests } = require("@vscode/test-electron"); +const projectConfigPath = ".yamlfmt"; +const backupConfigPath = `${projectConfigPath}.bak`; + async function main() { + fs.rename(projectConfigPath, backupConfigPath, function (err) { + if (err) { + throw err; + } + }); + try { // The folder containing the Extension Manifest package.json // Passed to `--extensionDevelopmentPath` @@ -24,6 +34,12 @@ async function main() { console.error("Failed to run tests", err); process.exit(1); } + + fs.rename(backupConfigPath, projectConfigPath, function (err) { + if (err) { + throw err; + }; + }); } main(); From 00fa91d5d50a7d2ceb695a779c92ec0b2de6f814 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 3 May 2024 22:55:15 +0900 Subject: [PATCH 2/8] chore(test): prefer renameSync for stable and simple --- test/runTest.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/test/runTest.js b/test/runTest.js index d6fea4a..49d8b50 100644 --- a/test/runTest.js +++ b/test/runTest.js @@ -8,11 +8,7 @@ const projectConfigPath = ".yamlfmt"; const backupConfigPath = `${projectConfigPath}.bak`; async function main() { - fs.rename(projectConfigPath, backupConfigPath, function (err) { - if (err) { - throw err; - } - }); + fs.renameSync(projectConfigPath, backupConfigPath); try { // The folder containing the Extension Manifest package.json @@ -35,11 +31,7 @@ async function main() { process.exit(1); } - fs.rename(backupConfigPath, projectConfigPath, function (err) { - if (err) { - throw err; - }; - }); + fs.renameSync(backupConfigPath, projectConfigPath); } main(); From 8571085e391b2dbe56bc59d1ad29e75f07b47dd1 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 3 May 2024 23:39:13 +0900 Subject: [PATCH 3/8] fix: .gitignore definition --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3e72aa3..be28fbf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ node_modules /test/suite/testdata/**/*/test.yaml .env *.vsix -.bak +*.bak From a523227d50c6edf33fe7f10659aff286c0d4c179 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Wed, 8 May 2024 18:34:03 +0900 Subject: [PATCH 4/8] test: fix ci with bumping @vscode/test-electron `npm uninstall '@vscode/test-electron' && npm install --save-dev '@vscode/test-electron'` https://github.com/microsoft/vscode-test/issues/254 --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb4b682..b2b9cd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@types/mocha": "^10.0.1", "@types/node": "^20.4.2", "@types/vscode": "^1.80.0", - "@vscode/test-electron": "^2.3.3", + "@vscode/test-electron": "^2.3.9", "@vscode/vsce": "^2.19.0", "eslint": "^8.45.0", "mocha": "^10.2.0", @@ -199,15 +199,15 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.3.tgz", - "integrity": "sha512-hgXCkDP0ibboF1K6seqQYyHAzCURgTwHS/6QU7slhwznDLwsRwg9bhfw1CZdyUEw8vvCmlrKWnd7BlQnI0BC4w==", + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.9.tgz", + "integrity": "sha512-z3eiChaCQXMqBnk2aHHSEkobmC2VRalFQN0ApOAtydL172zXGxTwGrRtviT5HnUB+Q+G3vtEYFtuQkYqBzYgMA==", "dev": true, "dependencies": { "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "jszip": "^3.10.1", - "semver": "^7.3.8" + "semver": "^7.5.2" }, "engines": { "node": ">=16" diff --git a/package.json b/package.json index fa03de5..cb007a2 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/mocha": "^10.0.1", "@types/node": "^20.4.2", "@types/vscode": "^1.80.0", - "@vscode/test-electron": "^2.3.3", + "@vscode/test-electron": "^2.3.9", "@vscode/vsce": "^2.19.0", "eslint": "^8.45.0", "mocha": "^10.2.0", From c66cab355efcdf02cf96781692eaae59d34f50cd Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 10 May 2024 02:59:03 +0900 Subject: [PATCH 5/8] test: avoid project .yamlfmt pollution --- .yamlfmt | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .yamlfmt diff --git a/.yamlfmt b/.yamlfmt deleted file mode 100644 index 830e27d..0000000 --- a/.yamlfmt +++ /dev/null @@ -1,6 +0,0 @@ -formatter: - type: basic - retain_line_breaks: true - max_line_length: 80 - scan_folded_as_literal: true - indentless_arrays: true From 4c35d7fc2b5e0d98b51284f3e6cd4bcacad33513 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 10 May 2024 03:32:00 +0900 Subject: [PATCH 6/8] ci: fix test with simple solution * Bump `@vscode/test-electron` to apply patch for https://github.com/microsoft/vscode-test/issues/254 * Simply remove .yamlfmt rather than renaming while running tests --- .gitignore | 1 - .yamlfmt | 6 ------ package-lock.json | 10 +++++----- package.json | 2 +- test/runTest.js | 8 -------- 5 files changed, 6 insertions(+), 21 deletions(-) delete mode 100644 .yamlfmt diff --git a/.gitignore b/.gitignore index be28fbf..2de09c9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,3 @@ node_modules /test/suite/testdata/**/*/test.yaml .env *.vsix -*.bak diff --git a/.yamlfmt b/.yamlfmt deleted file mode 100644 index 830e27d..0000000 --- a/.yamlfmt +++ /dev/null @@ -1,6 +0,0 @@ -formatter: - type: basic - retain_line_breaks: true - max_line_length: 80 - scan_folded_as_literal: true - indentless_arrays: true diff --git a/package-lock.json b/package-lock.json index cb4b682..b2b9cd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@types/mocha": "^10.0.1", "@types/node": "^20.4.2", "@types/vscode": "^1.80.0", - "@vscode/test-electron": "^2.3.3", + "@vscode/test-electron": "^2.3.9", "@vscode/vsce": "^2.19.0", "eslint": "^8.45.0", "mocha": "^10.2.0", @@ -199,15 +199,15 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.3.tgz", - "integrity": "sha512-hgXCkDP0ibboF1K6seqQYyHAzCURgTwHS/6QU7slhwznDLwsRwg9bhfw1CZdyUEw8vvCmlrKWnd7BlQnI0BC4w==", + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.9.tgz", + "integrity": "sha512-z3eiChaCQXMqBnk2aHHSEkobmC2VRalFQN0ApOAtydL172zXGxTwGrRtviT5HnUB+Q+G3vtEYFtuQkYqBzYgMA==", "dev": true, "dependencies": { "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "jszip": "^3.10.1", - "semver": "^7.3.8" + "semver": "^7.5.2" }, "engines": { "node": ">=16" diff --git a/package.json b/package.json index fa03de5..cb007a2 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/mocha": "^10.0.1", "@types/node": "^20.4.2", "@types/vscode": "^1.80.0", - "@vscode/test-electron": "^2.3.3", + "@vscode/test-electron": "^2.3.9", "@vscode/vsce": "^2.19.0", "eslint": "^8.45.0", "mocha": "^10.2.0", diff --git a/test/runTest.js b/test/runTest.js index 49d8b50..f4cbd65 100644 --- a/test/runTest.js +++ b/test/runTest.js @@ -1,15 +1,9 @@ const path = require("path"); const os = require("os"); -const fs = require("fs"); const { runTests } = require("@vscode/test-electron"); -const projectConfigPath = ".yamlfmt"; -const backupConfigPath = `${projectConfigPath}.bak`; - async function main() { - fs.renameSync(projectConfigPath, backupConfigPath); - try { // The folder containing the Extension Manifest package.json // Passed to `--extensionDevelopmentPath` @@ -30,8 +24,6 @@ async function main() { console.error("Failed to run tests", err); process.exit(1); } - - fs.renameSync(backupConfigPath, projectConfigPath); } main(); From d0cbde4bbe134c042d0ec858e68925c311c2a60c Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 10 May 2024 04:17:06 +0900 Subject: [PATCH 7/8] chore(ci): bump nodejs to 20.x Node.js 16 End-of-Life is 2023-09-11 https://nodejs.org/en/blog/announcements/nodejs16-eol/ --- .github/workflows/check.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 02e0a83..6f20bc8 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -23,7 +23,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 20.x - name: Set up Go uses: actions/setup-go@v4 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 50bd4e1..ddd0d49 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,7 +21,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 20.x - name: Install dependencies run: npm install From 09118083ab1a4c23bc10a50d968e3b58255b5b1d Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 10 May 2024 14:47:55 +0900 Subject: [PATCH 8/8] Simplify workflow trigger --- .github/workflows/check.yaml | 7 +------ .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 6f20bc8..eb6b9ab 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -1,14 +1,9 @@ on: - workflow_dispatch: {} + workflow_dispatch: push: branches: - main pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review jobs: integration-tests: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ddd0d49..cb77426 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,5 @@ on: - workflow_dispatch: {} + workflow_dispatch: jobs: release: