From 2b0e550cbca522d14cb14fb7654552fc8f51ac81 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:08:14 +0900 Subject: [PATCH 1/5] test: don't skip unicode related tests anymore --- playground/hasWindowsUnicodeFsBug.js | 10 ------ playground/hmr-ssr/__tests__/hmr-ssr.spec.ts | 2 +- playground/hmr/__tests__/hmr.spec.ts | 34 +++++++++----------- playground/html/__tests__/html.spec.ts | 3 +- playground/html/vite.config.js | 13 +++----- playground/vitestGlobalSetup.ts | 4 --- 6 files changed, 21 insertions(+), 45 deletions(-) delete mode 100644 playground/hasWindowsUnicodeFsBug.js diff --git a/playground/hasWindowsUnicodeFsBug.js b/playground/hasWindowsUnicodeFsBug.js deleted file mode 100644 index c46dd2a5545392..00000000000000 --- a/playground/hasWindowsUnicodeFsBug.js +++ /dev/null @@ -1,10 +0,0 @@ -import os from 'node:os' - -const isWindows = os.platform() === 'win32' -const nodeVersionArray = process.versions.node.split('.') -// ignore some files due to https://github.com/nodejs/node/issues/48673 -// node <=21.0.0 and ^20.4.0 has the bug -export const hasWindowsUnicodeFsBug = - isWindows && - (+nodeVersionArray[0] > 20 || - (+nodeVersionArray[0] === 20 && +nodeVersionArray[1] >= 4)) diff --git a/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts b/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts index f28b620f565131..6a2b3763b3ffec 100644 --- a/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts +++ b/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts @@ -253,7 +253,7 @@ describe('hmr works correctly', () => { }) // TODO - // test.skipIf(hasWindowsUnicodeFsBug)('full-reload encodeURI path', async () => { + // test('full-reload encodeURI path', async () => { // await page.goto( // viteTestUrl + '/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', // ) diff --git a/playground/hmr/__tests__/hmr.spec.ts b/playground/hmr/__tests__/hmr.spec.ts index 27590bd6022bd0..eb7b66d3c0d783 100644 --- a/playground/hmr/__tests__/hmr.spec.ts +++ b/playground/hmr/__tests__/hmr.spec.ts @@ -1,6 +1,5 @@ import { beforeAll, describe, expect, it, test } from 'vitest' import type { Page } from 'playwright-chromium' -import { hasWindowsUnicodeFsBug } from '../../hasWindowsUnicodeFsBug' import { addFile, browser, @@ -253,24 +252,21 @@ if (!isBuild) { await untilUpdated(() => el.textContent(), '3') }) - test.skipIf(hasWindowsUnicodeFsBug)( - 'full-reload encodeURI path', - async () => { - await page.goto( - viteTestUrl + '/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', - ) - const el = await page.$('#app') - expect(await el.textContent()).toBe('title') - editFile('unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', (code) => - code.replace('title', 'title2'), - ) - await page.waitForEvent('load') - await untilUpdated( - async () => (await page.$('#app')).textContent(), - 'title2', - ) - }, - ) + test('full-reload encodeURI path', async () => { + await page.goto( + viteTestUrl + '/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', + ) + const el = await page.$('#app') + expect(await el.textContent()).toBe('title') + editFile('unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', (code) => + code.replace('title', 'title2'), + ) + await page.waitForEvent('load') + await untilUpdated( + async () => (await page.$('#app')).textContent(), + 'title2', + ) + }) test('CSS update preserves query params', async () => { await page.goto(viteTestUrl) diff --git a/playground/html/__tests__/html.spec.ts b/playground/html/__tests__/html.spec.ts index 1baab83cf6a792..a026ce71cf2a3d 100644 --- a/playground/html/__tests__/html.spec.ts +++ b/playground/html/__tests__/html.spec.ts @@ -1,5 +1,4 @@ import { beforeAll, describe, expect, test } from 'vitest' -import { hasWindowsUnicodeFsBug } from '../../hasWindowsUnicodeFsBug' import { browserLogs, editFile, @@ -219,7 +218,7 @@ describe('noBody', () => { }) }) -describe.skipIf(hasWindowsUnicodeFsBug)('Unicode path', () => { +describe('Unicode path', () => { test('direct access', async () => { await page.goto( viteTestUrl + '/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', diff --git a/playground/html/vite.config.js b/playground/html/vite.config.js index 003a591def4c1d..8f829b23439c61 100644 --- a/playground/html/vite.config.js +++ b/playground/html/vite.config.js @@ -1,6 +1,5 @@ import { resolve } from 'node:path' import { defineConfig } from 'vite' -import { hasWindowsUnicodeFsBug } from '../hasWindowsUnicodeFsBug' export default defineConfig({ base: './', @@ -21,14 +20,10 @@ export default defineConfig({ inline1: resolve(__dirname, 'inline/shared-1.html'), inline2: resolve(__dirname, 'inline/shared-2.html'), inline3: resolve(__dirname, 'inline/unique.html'), - ...(hasWindowsUnicodeFsBug - ? {} - : { - unicodePath: resolve( - __dirname, - 'unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', - ), - }), + unicodePath: resolve( + __dirname, + 'unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', + ), linkProps: resolve(__dirname, 'link-props/index.html'), valid: resolve(__dirname, 'valid.html'), importmapOrder: resolve(__dirname, 'importmapOrder.html'), diff --git a/playground/vitestGlobalSetup.ts b/playground/vitestGlobalSetup.ts index 7f85d9d12748bf..3a8288ab34ba57 100644 --- a/playground/vitestGlobalSetup.ts +++ b/playground/vitestGlobalSetup.ts @@ -3,7 +3,6 @@ import fs from 'fs-extra' import type { GlobalSetupContext } from 'vitest/node' import type { BrowserServer } from 'playwright-chromium' import { chromium } from 'playwright-chromium' -import { hasWindowsUnicodeFsBug } from './hasWindowsUnicodeFsBug' let browserServer: BrowserServer | undefined @@ -28,9 +27,6 @@ export async function setup({ provide }: GlobalSetupContext): Promise { .copy(path.resolve(__dirname, '../playground'), tempDir, { dereference: false, filter(file) { - if (file.includes('中文-にほんご-한글-🌕🌖🌗')) { - return !hasWindowsUnicodeFsBug - } file = file.replace(/\\/g, '/') return !file.includes('__tests__') && !/dist(?:\/|$)/.test(file) }, From 21282f55c019db3dd996cece4ed42a2411b95c3a Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:09:34 +0900 Subject: [PATCH 2/5] chore: run with check-latest: true once --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4d15eadc1424a..5c5ee4bda6fdf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,7 @@ jobs: with: node-version: ${{ matrix.node_version }} cache: "pnpm" + check-latest: true - name: Install deps if: steps.changed-files.outputs.only_changed != 'true' From 5c7cb74fa474ace0cb422b5e27a73697c1aa1b6c Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:11:21 +0900 Subject: [PATCH 3/5] chore: remove check-latest --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c5ee4bda6fdf2..b4d15eadc1424a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,6 @@ jobs: with: node-version: ${{ matrix.node_version }} cache: "pnpm" - check-latest: true - name: Install deps if: steps.changed-files.outputs.only_changed != 'true' From 692461ba0740ba74def53de2a4546ab9f25cba9b Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:19:35 +0900 Subject: [PATCH 4/5] Revert "chore: remove check-latest" This reverts commit 5c7cb74fa474ace0cb422b5e27a73697c1aa1b6c. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4d15eadc1424a..5c5ee4bda6fdf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,7 @@ jobs: with: node-version: ${{ matrix.node_version }} cache: "pnpm" + check-latest: true - name: Install deps if: steps.changed-files.outputs.only_changed != 'true' From 41aa41c424c0cdfd6bc39b3ef5f9ba137d9664bd Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:49:45 +0900 Subject: [PATCH 5/5] Revert "Revert "chore: remove check-latest"" This reverts commit 692461ba0740ba74def53de2a4546ab9f25cba9b. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c5ee4bda6fdf2..b4d15eadc1424a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,6 @@ jobs: with: node-version: ${{ matrix.node_version }} cache: "pnpm" - check-latest: true - name: Install deps if: steps.changed-files.outputs.only_changed != 'true'