Repository navigation
Commit 1119ee7
committed
fix(ci): 修复 Pester Test 在三平台的全部失败
修复最近 3 次 Pester Test 运行(windows-latest 12 项 Pester 失败、
ubuntu-latest 1 项 Vitest 失败)的 4 类根因,并清理 qa 因 tsgo 缺失而失败的问题。
根因 A(行尾符/哈希不一致,2 项):
.gitattributes 只为 *.ps1 强制 eol=lf,Windows runner 的 core.autocrlf=true
会把 .psm1/.psd1/.env/.wslconfig 检出成 CRLF,破坏 bootstrap manifest 哈希
校验与 .wslconfig 内容比对。改为 * text=auto eol=lf 对所有文本强制 LF。
根因 B(09/WSL 管理员守卫未受 WhatIf 门控,2 项):
windows/09deployAutoHotkey.ps1 与 windows/wsl/Initialize-WslHost.ps1 的
管理员守卫是无条件的,GitHub windows-latest 以管理员运行导致 -WhatIt 仍 exit 10。
按规范「WhatIf/fixture 可生成计划」,加 -not $WhatIfPreference 门控。
根因 C(managed-env adapter 在原生 Windows throw,8 项):
brew/npm 走 ManagedEnvAdapter,其在原生 Windows throw。该 adapter 写 .zshrc、
设 UnixFileMode、依赖 zsh,本质只能跑在非 Windows。给 tests/PackageSources.Tests.ps1
的 8 个相关 It 加 -Skip:$IsWindows(macOS 仍全跑全过)。
根因 D(homebrew.sh 命中 CI 预装 Linuxbrew,1 项):
shell/shared.d/homebrew.sh 候选顺序把系统级 /home/linuxbrew/.linuxbrew 排前,
ubuntu-latest 预装真 Linuxbrew 会抢先于测试 fixture。新增
POWERSHELL_SCRIPTS_HOMEBREW_PREFIX 覆盖(显式 prefix 时跳过路径探测),
测试传入该变量隔离 fixture。
附加:移除已废弃的 @typescript/native-preview(tsgo),两个子 package 的
typecheck:fast 改用 tsc,并同步依赖升级与 pnpm-lock.yaml。
验证:pnpm test:pwsh:all(host 760/0、linux docker 756/0)、pnpm qa(176/0)、
Vitest linux-install-pipeline(12/12,typecheck 无错误)。1 parent 3b538dd commit 1119ee7
10 files changed
Lines changed: 1071 additions & 858 deletions
File tree
- projects/clis/json-diff-tool
- scripts
- bash/tests
- node
- tests
- windows
- wsl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
1 | 7 | | |
2 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
3 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
0 commit comments