Skip to content

Commit b0c519b

Browse files
committed
fix(ci): 恢复 linux-install-pipeline 测试到已验证通过的版本
上一个提交(ecafc39)误将该测试文件倒退回 3b538dd 旧版,导致 'blocks non-Direct PowerShell' 与当前 02installPowerShell.sh 的新文案 ('请提供本地安装包')不匹配,并在 ubuntu CI 上失败。 实际上 23be855(含 Arch 支持与 Linuxbrew 隔离修复)已是 ubuntu CI 279/279 全绿的成功版本。将测试文件恢复到该版本。
1 parent ecafc39 commit b0c519b

1 file changed

Lines changed: 63 additions & 2 deletions

File tree

‎scripts/bash/tests/linux-install-pipeline.test.ts‎

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,27 @@ describe('Linux Stage 0 pipeline', () => {
161161
)
162162
})
163163

164+
it('previews Arch pacman prerequisites and Stage 1 handoff', async () => {
165+
const workspace = createWorkspace('arch')
166+
const result = await execa(
167+
'bash',
168+
[path.join(repoRoot, 'linux/00quickstart.sh'), '--dry-run'],
169+
{
170+
env: linuxEnv(workspace, {
171+
POWERSHELL_SCRIPTS_FORCE_MISSING_PACMAN_PREREQUISITES: '1',
172+
}),
173+
reject: false,
174+
},
175+
)
176+
177+
expect(result.exitCode).toBe(0)
178+
expect(result.stdout).toContain(
179+
'pacman -Syu --needed --noconfirm base-devel ca-certificates curl git',
180+
)
181+
expect(result.stdout).toContain('02installPowerShell.sh')
182+
expect(result.stdout).toContain('-Preset Core')
183+
})
184+
164185
it('previews Linuxbrew and PowerShell without installing', async () => {
165186
const workspace = createWorkspace()
166187
const brew = await execa(
@@ -208,7 +229,47 @@ describe('Linux Stage 0 pipeline', () => {
208229
)
209230

210231
expect(result.exitCode).toBe(10)
211-
expect(result.stderr).toContain('请提供本地 deb 或预装 PowerShell 7')
232+
expect(result.stderr).toContain('请提供本地安装包或预装 PowerShell 7')
233+
})
234+
235+
it('previews the official PowerShell tarball path on Arch', async () => {
236+
const workspace = createWorkspace('arch')
237+
const result = await execa(
238+
'bash',
239+
[path.join(repoRoot, 'linux/02installPowerShell.sh'), '--dry-run'],
240+
{
241+
env: linuxEnv(workspace, {
242+
POWERSHELL_SCRIPTS_FORCE_MISSING_PWSH: '1',
243+
}),
244+
reject: false,
245+
},
246+
)
247+
248+
expect(result.exitCode).toBe(0)
249+
expect(result.stdout).toContain('linux-x64 tarball')
250+
expect(result.stdout).toContain('SHA256')
251+
expect(result.stdout).toContain('/opt/microsoft/powershell/7')
252+
})
253+
254+
it('previews optional yay without cloning or writing', async () => {
255+
const workspace = createWorkspace('arch')
256+
const result = await execa(
257+
'bash',
258+
[path.join(repoRoot, 'linux/arch/installYay.sh'), '--dry-run'],
259+
{
260+
env: linuxEnv(workspace, {
261+
POWERSHELL_SCRIPTS_FORCE_MISSING_YAY: '1',
262+
}),
263+
reject: false,
264+
},
265+
)
266+
267+
expect(result.exitCode).toBe(0)
268+
expect(result.stdout).toContain(
269+
'pacman -S --needed --noconfirm base-devel git',
270+
)
271+
expect(result.stdout).toContain('aur.archlinux.org/yay.git')
272+
expect(result.stdout).toContain('makepkg -si --needed --noconfirm')
212273
})
213274
})
214275

@@ -292,7 +353,7 @@ describe('Linux Stage 1 shell wrappers', () => {
292353
`source "${path.join(repoRoot, 'shell/shared.d/homebrew.sh')}"; printf '%s\\n%s' "$HOMEBREW_PREFIX" "$PATH"`,
293354
],
294355
{
295-
// 显式指定 prefix,跳过路径探测,避免 CI(如 ubuntu-latest 预装的系统级 Linuxbrew)干扰隔离 fixture。
356+
// 显式指定 prefix,跳过路径探测,避免 CI 预装的系统级 Linuxbrew 干扰隔离 fixture。
296357
env: linuxEnv(workspace, {
297358
POWERSHELL_SCRIPTS_HOMEBREW_PREFIX: prefix,
298359
}),

0 commit comments

Comments
 (0)