Skip to content

Commit 338697d

Browse files
committed
Fix CompatPatchApplied handling in PHP tests
1 parent f5ce5ed commit 338697d

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

php/BuildPhp/private/Add-TestRequirements.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function Add-TestRequirements {
6767

6868
if(-not(Test-Path $binZipFilePath)) {
6969
Write-Host "Downloading PHP build $binZipFile..."
70-
Get-PhpBuild -PhpVersion $PhpVersion -Arch $Arch -Ts $Ts -VsVersion $VsVersion
70+
$null = Get-PhpBuild -PhpVersion $PhpVersion -Arch $Arch -Ts $Ts -VsVersion $VsVersion
7171
} else {
7272
try {
7373
[System.IO.Compression.ZipFile]::ExtractToDirectory($binZipFilePath, $binDirectoryPath)
@@ -82,10 +82,10 @@ function Add-TestRequirements {
8282
} else {
8383
Write-Host "Downloading PHP test pack $testZipFile..."
8484
}
85-
Get-PhpTestPack -PhpVersion $PhpVersion `
86-
-TestsDirectory $TestsDirectory `
87-
-SourceRepository $SourceRepository `
88-
-SourceRef $SourceRef
85+
$null = Get-PhpTestPack -PhpVersion $PhpVersion `
86+
-TestsDirectory $TestsDirectory `
87+
-SourceRepository $SourceRepository `
88+
-SourceRef $SourceRef
8989
} else {
9090
try {
9191
[System.IO.Compression.ZipFile]::ExtractToDirectory($testZipFilePath, $testsDirectoryPath)
@@ -134,11 +134,11 @@ function Add-TestRequirements {
134134
$FetchDeps = $True
135135
}
136136
if($FetchDeps -eq $True -or $null -eq $Env:DEPS_CACHE_HIT -or $Env:DEPS_CACHE_HIT -ne 'true') {
137-
Add-PhpDeps -PhpVersion $PhpVersion -VsVersion $VsVersion -Arch $Arch -Destination $env:DEPS_DIR
137+
$null = Add-PhpDeps -PhpVersion $PhpVersion -VsVersion $VsVersion -Arch $Arch -Destination $env:DEPS_DIR
138138
}
139-
Invoke-EditBin -Exe "$binDirectoryPath\php.exe" -StackSize 8388608 -Arch $Arch
140-
Invoke-EditBin -Exe "$binDirectoryPath\php-cgi.exe" -StackSize 8388608 -Arch $Arch
141-
Add-Path "$env:DEPS_DIR\bin"
139+
$null = Invoke-EditBin -Exe "$binDirectoryPath\php.exe" -StackSize 8388608 -Arch $Arch
140+
$null = Invoke-EditBin -Exe "$binDirectoryPath\php-cgi.exe" -StackSize 8388608 -Arch $Arch
141+
$null = Add-Path "$env:DEPS_DIR\bin"
142142
return [PSCustomObject]@{
143143
CompatPatchApplied = $compatPatchApplied
144144
}

php/BuildPhp/public/Invoke-PhpTests.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,17 @@ function Invoke-PhpTests {
127127
"-r", "$TestType-tests-to-run.txt"
128128
)
129129

130+
$compatPatchApplied = $true
131+
if ($null -ne $testSetup) {
132+
foreach ($setupOutput in @($testSetup)) {
133+
if ($setupOutput -and $setupOutput.PSObject.Properties.Name -contains 'CompatPatchApplied') {
134+
$compatPatchApplied = [bool]$setupOutput.CompatPatchApplied
135+
}
136+
}
137+
}
138+
130139
$workers = $settings.workers
131-
if($workers -ne "" -and $testSetup -and -not $testSetup.CompatPatchApplied) {
140+
if($workers -ne "" -and -not $compatPatchApplied) {
132141
$workers = "-j2"
133142
}
134143

0 commit comments

Comments
 (0)