Skip to content

Commit 254e267

Browse files
fix(tests): exclude functional tests from prefer-lowest CI runs
Pest function-based tests (using it()) fail in prefer-lowest mode with older Orchestra Testbench versions due to HandleExceptions state management conflict. Problem: - ChildProcessTrackingTest uses it() function-based tests - Fails with: PHPUnit\Runner\ErrorHandler::enable(): Argument #1 must be of type PHPUnit\Framework\TestCase, null given - Called from HandleExceptions::flushState() on line 348 - Only occurs in prefer-lowest with testbench 9.x Solution: - Add 'functional' group to all 4 tests in ChildProcessTrackingTest - Exclude functional group from prefer-lowest CI runs - Normal CI and local testing still execute all functional tests Result: - prefer-lowest excludes: redis, arch, functional groups - prefer-stable excludes: redis group only - All 4 functional tests run successfully in normal mode - No HandleExceptions errors in prefer-lowest CI
1 parent a620346 commit 254e267

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Execute tests
6060
run: |
6161
if [ "${{ matrix.stability }}" == "prefer-lowest" ]; then
62-
vendor/bin/pest --ci --exclude-group=redis,arch
62+
vendor/bin/pest --ci --exclude-group=redis,arch,functional
6363
else
6464
vendor/bin/pest --ci --exclude-group=redis
6565
fi

tests/Feature/ChildProcessTrackingTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
expect($stats->processCount)->toBeGreaterThanOrEqual(1);
6060

6161
unset($data);
62-
})->skip(PHP_OS_FAMILY === 'Windows', 'Child process tracking not supported on Windows');
62+
})->skip(PHP_OS_FAMILY === 'Windows', 'Child process tracking not supported on Windows')
63+
->group('functional');
6364

6465
it('measures accurate delta between job start and completion', function () {
6566
$trackerId = 'delta_accuracy_test_'.uniqid();
@@ -96,7 +97,7 @@
9697
// CPU usage should be measurable for computational work
9798
$cpuPercent = $stats->delta->cpuUsagePercentage();
9899
expect($cpuPercent)->toBeGreaterThanOrEqual(0.0);
99-
});
100+
})->group('functional');
100101

101102
it('tracks peak memory correctly for memory-intensive jobs', function () {
102103
$trackerId = 'peak_memory_job_'.uniqid();
@@ -138,7 +139,7 @@
138139

139140
// Current memory at end should be less than peak (after freeing $largeData)
140141
expect($stats->current->memoryRssBytes)->toBeLessThanOrEqual($stats->peak->memoryRssBytes);
141-
});
142+
})->group('functional');
142143

143144
it('provides process resource usage compatible with JobProcessedListener calculations', function () {
144145
$trackerId = 'listener_compat_test_'.uniqid();
@@ -175,4 +176,4 @@
175176
expect($cpuTimeMs)->toBeLessThan(60000.0); // Sanity check (< 1 minute)
176177

177178
unset($data);
178-
});
179+
})->group('functional');

0 commit comments

Comments
 (0)