优化
This commit is contained in:
@@ -7,14 +7,29 @@ param(
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
if (-not $DryRun -and -not $env:CHONGCHONG_LOCAL_CHECK_OWNER) {
|
||||
$batch = @('pwsh', '-NoProfile', '-File', $PSCommandPath)
|
||||
foreach ($flag in @('SkipAdmin', 'SkipClient', 'SkipPda')) {
|
||||
if ($PSBoundParameters[$flag]) { $batch += "-$flag" }
|
||||
}
|
||||
& (Join-Path $PSScriptRoot 'local-check.ps1') -Label 'Frontend full regression' -Command $batch
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '../..')).Path
|
||||
|
||||
function Invoke-FrontendStep {
|
||||
param([string]$Name, [string]$Directory, [string]$Task)
|
||||
$display = "pnpm --dir `"$Directory`" $Task"
|
||||
if ($Task -eq 'test' -and (Split-Path -Leaf $Directory) -eq 'client-web') {
|
||||
$display = "pnpm --dir `"$Directory`" exec node --test --test-concurrency=2 src/**/*.test.mjs"
|
||||
}
|
||||
Write-Host " [$Name] $display"
|
||||
if ($DryRun) { return }
|
||||
& pnpm --dir $Directory $Task
|
||||
if ($Task -eq 'test' -and (Split-Path -Leaf $Directory) -eq 'client-web') {
|
||||
& pnpm --dir $Directory exec node --test --test-concurrency=2 'src/**/*.test.mjs'
|
||||
} else {
|
||||
& pnpm --dir $Directory $Task
|
||||
}
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
}
|
||||
|
||||
@@ -23,7 +38,7 @@ function Invoke-PdaTests {
|
||||
$pattern = Join-Path $Directory 'tests/*.test.mjs'
|
||||
Write-Host " [test] node --test `"$pattern`""
|
||||
if ($DryRun) { return }
|
||||
& node --test $pattern
|
||||
& node --test --test-concurrency=2 $pattern
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user