From 3cfbad385b65e3bca54c71422e1e703f0cee7e93 Mon Sep 17 00:00:00 2001 From: sudoHG Date: Mon, 5 Oct 2026 08:40:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E5=AE=BD=E6=B5=8B=E8=AF=95=E4=B8=AD?= =?UTF-8?q?=20Swift=20=E7=BC=96=E8=AF=91=E7=9A=84=E6=97=B6=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 三个原生测试里 swiftc 编译的超时从 60 秒放宽到 180 秒。多个 PR 同时运行时,Intel CI 机器编译 App.swift 会超过 60 秒而被终止;测试断言不变。 --- tests/localizations.test.js | 2 +- tests/mac-localization-ui.js | 2 +- tests/mac-settings-window.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/localizations.test.js b/tests/localizations.test.js index 8e77023..41cbb2d 100644 --- a/tests/localizations.test.js +++ b/tests/localizations.test.js @@ -168,7 +168,7 @@ test('原生在隔离的三语言 fixture 中读取、格式化、匹配地区 '-framework', 'AppKit', '-framework', 'WebKit', '-framework', 'StoreKit', path.join(root, 'macos', 'App.swift'), path.join(root, 'tests', 'mac-localization.swift'), '-o', executable - ], { timeout: 60000, maxBuffer: 2 * 1024 * 1024 }); + ], { timeout: 180000, maxBuffer: 2 * 1024 * 1024 }); const { stdout } = await run(executable, [cases], { timeout: 10000 }).catch(error => { assert.fail(error.stdout || error.stderr || error.message); }); diff --git a/tests/mac-localization-ui.js b/tests/mac-localization-ui.js index 492bb21..1439987 100644 --- a/tests/mac-localization-ui.js +++ b/tests/mac-localization-ui.js @@ -53,7 +53,7 @@ test('Mac WK/AppKit 本地化界面保持任务与输出,隔离偏好和剪贴 fs.copyFileSync(path.join(root, file), path.join(resources, file)); } fs.copyFileSync(path.join(root, 'macos', 'FlashMask.icns'), path.join(resources, 'FlashMask.icns')); - await run('/usr/bin/xcrun', ['swiftc', '-parse-as-library', '-target', `${process.arch === 'arm64' ? 'arm64' : 'x86_64'}-apple-macosx13.0`, '-module-cache-path', path.join(directory, 'module-cache'), '-framework', 'AppKit', '-framework', 'WebKit', '-framework', 'StoreKit', path.join(root, 'macos', 'App.swift'), path.join(root, 'tests', 'mac-localization-ui.swift'), '-o', executable], { timeout: 60000, maxBuffer: 2 * 1024 * 1024 }); + await run('/usr/bin/xcrun', ['swiftc', '-parse-as-library', '-target', `${process.arch === 'arm64' ? 'arm64' : 'x86_64'}-apple-macosx13.0`, '-module-cache-path', path.join(directory, 'module-cache'), '-framework', 'AppKit', '-framework', 'WebKit', '-framework', 'StoreKit', path.join(root, 'macos', 'App.swift'), path.join(root, 'tests', 'mac-localization-ui.swift'), '-o', executable], { timeout: 180000, maxBuffer: 2 * 1024 * 1024 }); await run('/usr/bin/codesign', ['--force', '--sign', '-', bundle]); const args = [fixtures, screenshots]; const emptyOnly = process.env.FLASH_MASK_LOCALIZATION_EMPTY_ONLY === '1'; diff --git a/tests/mac-settings-window.test.js b/tests/mac-settings-window.test.js index 354ea53..323c8a7 100644 --- a/tests/mac-settings-window.test.js +++ b/tests/mac-settings-window.test.js @@ -25,7 +25,7 @@ test('设置窗口居中在主窗口上,并完整显示在屏幕可见区域 '-framework', 'AppKit', '-framework', 'WebKit', '-framework', 'StoreKit', path.join(root, 'macos', 'App.swift'), path.join(root, 'tests', 'mac-settings-window.swift'), '-o', executable - ], { timeout: 60000, maxBuffer: 2 * 1024 * 1024 }); + ], { timeout: 180000, maxBuffer: 2 * 1024 * 1024 }); const { stdout } = await run(executable, [], { timeout: 10000 }).catch(error => { assert.fail(error.stdout || error.stderr || error.message); });