mirror of
https://github.com/pestphp/pest.git
synced 2026-12-06 07:42:17 +01:00
fix(tia): keep pcov.enabled when the pcov restarter re-runs pest (#2015)
* fix(tia): keep pcov.enabled when the pcov restarter re-runs pest * test: cover pcov.enabled in the pcov restarter command --------- Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
This commit is contained in:
committed by
GitHub
parent
c6761c4bc1
commit
ceef9806c2
@@ -81,6 +81,8 @@ final class PcovRestarter implements Restarter
|
||||
'-d',
|
||||
'memory_limit='.ini_get('memory_limit'),
|
||||
'-d',
|
||||
'pcov.enabled='.ini_get('pcov.enabled'),
|
||||
'-d',
|
||||
'pcov.directory='.$projectRoot,
|
||||
],
|
||||
array_values($arguments),
|
||||
|
||||
@@ -2102,6 +2102,7 @@
|
||||
|
||||
PASS Tests\Unit\Restarters\PcovRestarter
|
||||
✓ it preserves the active memory limit in the restarted process
|
||||
✓ it preserves pcov.enabled in the restarted process
|
||||
|
||||
PASS Tests\Unit\Support\Arr
|
||||
✓ last → it should return false for an empty arary
|
||||
@@ -2292,4 +2293,4 @@
|
||||
✓ pass with dataset with ('my-datas-set-value')
|
||||
✓ within describe → pass with dataset with ('my-datas-set-value')
|
||||
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 36 skipped, 1624 passed (3587 assertions)
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 36 skipped, 1625 passed (3589 assertions)
|
||||
|
||||
@@ -24,3 +24,15 @@ it('preserves the active memory limit in the restarted process', function (): vo
|
||||
ini_set('memory_limit', (string) $originalMemoryLimit);
|
||||
}
|
||||
});
|
||||
|
||||
it('preserves pcov.enabled in the restarted process', function (): void {
|
||||
$command = new ReflectionMethod(PcovRestarter::class, 'command')
|
||||
->invoke(new PcovRestarter, __DIR__, []);
|
||||
|
||||
assert(is_array($command));
|
||||
|
||||
$index = array_search('pcov.enabled='.ini_get('pcov.enabled'), $command, true);
|
||||
|
||||
expect($index)->toBeInt()
|
||||
->and($command[$index - 1])->toBe('-d');
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ test('parallel', function () use ($run): void {
|
||||
$output = $run('--exclude-group=integration');
|
||||
$output = implode("\n", array_slice(explode("\n", (string) $output), -10));
|
||||
|
||||
$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 28 skipped, 1605 passed (3529 assertions)';
|
||||
$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 28 skipped, 1606 passed (3531 assertions)';
|
||||
|
||||
expect($output)
|
||||
->toContain("Tests: {$expected}")
|
||||
|
||||
Reference in New Issue
Block a user