From 1c5224e348aa167457bfca4d052e9fb936aa584a Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 28 Jan 2026 03:02:12 +0300 Subject: [PATCH 1/3] ci: test perf --- .github/workflows/nodejs.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 482976de74a..b9bf0fb65b6 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -71,6 +71,12 @@ jobs: with: fetch-depth: 0 + - name: Add workspace to Defender exclusions + if: matrix.os == 'windows-latest' + run: | + Set-MpPreference -ExclusionPath ${{ github.workspace }} + shell: powershell + - name: Using Node.js v${{ matrix.node-version }} uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: From e5d940309c1e04f1e87bbfd98b45bf957ca12c25 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 28 Jan 2026 03:15:57 +0300 Subject: [PATCH 2/3] ci: fix arguments --- .github/workflows/nodejs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index b9bf0fb65b6..9d813ebeff1 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -74,7 +74,8 @@ jobs: - name: Add workspace to Defender exclusions if: matrix.os == 'windows-latest' run: | - Set-MpPreference -ExclusionPath ${{ github.workspace }} + Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue + Add-MpPreference -ExclusionPath "${{ github.workspace }}" -ErrorAction SilentlyContinue shell: powershell - name: Using Node.js v${{ matrix.node-version }} From 91731703bc5f922dd7df141aaf5109c390784ba6 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 28 Jan 2026 03:45:18 +0300 Subject: [PATCH 3/3] test: refactor --- .github/workflows/nodejs.yml | 10 ++++++++-- .gitignore | 1 + eslint.config.mjs | 1 + test/create-webpack-app/init/init.test.js | 7 +++++-- test/utils/test-utils.js | 5 ++--- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 9d813ebeff1..3763a7467cb 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -74,8 +74,14 @@ jobs: - name: Add workspace to Defender exclusions if: matrix.os == 'windows-latest' run: | - Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue - Add-MpPreference -ExclusionPath "${{ github.workspace }}" -ErrorAction SilentlyContinue + Add-MpPreference -ExclusionPath "${{ github.workspace }}" + + Add-MpPreference -ExclusionProcess "node.exe" + + $npmCache = (npm config get cache) + Add-MpPreference -ExclusionPath $npmCache + + Set-MpPreference -DisableRealtimeMonitoring $true shell: powershell - name: Using Node.js v${{ matrix.node-version }} diff --git a/.gitignore b/.gitignore index 0cd9e98f062..aaf111b65be 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ packages/**/yarn.lock # test output files test/js/* +test/create-webpack-app-testing/* test/**/bin/ test/**/**/bin/ test/**/**/**/bin/ diff --git a/eslint.config.mjs b/eslint.config.mjs index 4021eee7921..9c51bae9331 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -5,6 +5,7 @@ import configs from "eslint-config-webpack/configs.js"; export default defineConfig([ globalIgnores([ "packages/*/lib/**/*", + "test/**/create-webpack-app-testing/**/*", "test/**/dist/**/*", "test/**/bin/**/*", "test/**/binary/**/*", diff --git a/test/create-webpack-app/init/init.test.js b/test/create-webpack-app/init/init.test.js index 02c48667cca..d9bf1072d67 100644 --- a/test/create-webpack-app/init/init.test.js +++ b/test/create-webpack-app/init/init.test.js @@ -1,6 +1,5 @@ const { existsSync, mkdirSync, readFileSync, writeFileSync } = require("node:fs"); const { cp } = require("node:fs/promises"); -const os = require("node:os"); const path = require("node:path"); const { join, resolve } = require("node:path"); const { createPathDependentUtils, isWindows, uniqueDirectoryForTest } = require("../test.utils"); @@ -149,7 +148,11 @@ describe("create-webpack-app cli", () => { }); it("should generate folders if non existing generation path is given", async () => { - const assetsPath = path.resolve(os.tmpdir(), Date.now().toString()); + const assetsPath = path.resolve( + __dirname, + "../create-webpack-app-testing", + Date.now().toString(), + ); const { stdout } = await run(__dirname, ["init", assetsPath, "--force"]); expect(stdout).toContain("Project has been initialised with webpack!"); diff --git a/test/utils/test-utils.js b/test/utils/test-utils.js index a0692bda71e..d2f16f89c1e 100644 --- a/test/utils/test-utils.js +++ b/test/utils/test-utils.js @@ -2,7 +2,6 @@ const { exec } = require("node:child_process"); const fs = require("node:fs"); -const os = require("node:os"); const path = require("node:path"); const { stripVTControlCharacters } = require("node:util"); const concat = require("concat-stream"); @@ -373,10 +372,10 @@ const uuid = (size = 21) => { }; const uniqueDirectoryForTest = async () => { - const result = path.resolve(os.tmpdir(), uuid()); + const result = path.resolve(path.resolve(__dirname, "../create-webpack-app-testing"), uuid()); if (!fs.existsSync(result)) { - fs.mkdirSync(result); + fs.mkdirSync(result, { recursive: true }); } return result;