Skip to content

Commit 9fc6be2

Browse files
committed
Add env var to disable skip cache
DISABLE_SKIP_CACHE=1 can be used to disable the skip cache. This does not control the extensions cache. See https://externals.io/message/116044 for related discussion. Closes GH-7510.
1 parent b94b97f commit 9fc6be2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

run-tests.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,8 @@ function run_test(string $php, $file, array $env): string
18661866

18671867
static $skipCache;
18681868
if (!$skipCache) {
1869-
$skipCache = new SkipCache($cfg['keep']['skip']);
1869+
$enableSkipCache = !($env['DISABLE_SKIP_CACHE'] ?? '0');
1870+
$skipCache = new SkipCache($enableSkipCache, $cfg['keep']['skip']);
18701871
}
18711872

18721873
$temp_filenames = null;
@@ -3659,6 +3660,7 @@ private function mergeSuites(array &$dest, array $source): void
36593660

36603661
class SkipCache
36613662
{
3663+
private bool $enable;
36623664
private bool $keepFile;
36633665

36643666
private array $skips = [];
@@ -3669,8 +3671,9 @@ class SkipCache
36693671
private int $extHits = 0;
36703672
private int $extMisses = 0;
36713673

3672-
public function __construct(bool $keepFile)
3674+
public function __construct(bool $enable, bool $keepFile)
36733675
{
3676+
$this->enable = $enable;
36743677
$this->keepFile = $keepFile;
36753678
}
36763679

@@ -3691,10 +3694,10 @@ public function checkSkip(string $php, string $code, string $checkFile, string $
36913694

36923695
save_text($checkFile, $code, $tempFile);
36933696
$result = trim(system_with_timeout("$php \"$checkFile\"", $env));
3694-
if (strpos($result, 'nocache') !== 0) {
3695-
$this->skips[$key][$code] = $result;
3696-
} else {
3697+
if (strpos($result, 'nocache') === 0) {
36973698
$result = '';
3699+
} else if ($this->enable) {
3700+
$this->skips[$key][$code] = $result;
36983701
}
36993702
$this->misses++;
37003703

0 commit comments

Comments
 (0)