Skip to content

Commit 01f588a

Browse files
committed
chore: 添加新的测试脚本以识别最慢的 Pester 测试
新增 `test:pwsh:slowest` 脚本,用于运行完整的 Pester 测试套件并生成耗时报告。这有助于识别和优化执行时间最长的测试用例,以提高整体测试效率。
1 parent 4621cfd commit 01f588a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"test:pwsh:profile": "pwsh -NoProfile -Command \"$env:PWSH_TEST_MODE='serial'; $env:PWSH_TEST_PATH='./tests/ProfileMode.Tests.ps1'; $env:PWSH_TEST_VERBOSE='1'; $c = ./PesterConfiguration.ps1; $c.Run.Exit = $true; Invoke-Pester -Configuration $c\"",
3030
"test:pwsh:slow": "pwsh -NoProfile -Command \"$c = ./PesterConfiguration.ps1; $c.Run.Exit = $true; $c.Filter.Tag = 'Slow'; $c.Filter.ExcludeTag = @($c.Filter.ExcludeTag.Value | Where-Object { $_ -ne 'Slow' }); Invoke-Pester -Configuration $c\"",
3131
"test:pwsh:detailed": "pwsh -NoProfile -Command \"$env:PWSH_TEST_MODE='full'; $env:PWSH_TEST_VERBOSE='1'; $c = ./PesterConfiguration.ps1; $c.Run.Exit = $true; Invoke-Pester -Configuration $c\"",
32+
"test:pwsh:slowest": "node ./scripts/pester-duration-report.mjs --command \"pnpm test:pwsh:full\"",
3233
"test:pwsh:all:slowest": "node ./scripts/pester-duration-report.mjs --command \"pnpm test:pwsh:all\"",
3334
"benchmark": "pwsh -NoProfile -File ./scripts/pwsh/devops/Invoke-Benchmark.ps1",
3435
"scripts:install": "pwsh -File ./install.ps1",

0 commit comments

Comments
 (0)