[4.x] Coverage not found in path
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 11.7k
- Forks
- 538
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 8
Description
What Happened
Running multiple processes of pest in parallel create a crash with "ShouldNotHappen" for "vendor/pestphp/pest/.temp/coverage.php".
e.g. first process deletes the coverage.php from the second process
Using "--cache-directory=/tmp/foo" still writes coverage.php to "vendor/pestphp/pest/.temp/coverage.php".
Ideally, pest should not write into "vendor/*".
My recommendation:
- write coverage.php to "--cache-directory" if given
- if coverage.php cannot be written, stop with an error
How to Reproduce
e.g. use "--cache-directory=/tmp/foo" and make vendor/pestphp/pest/.temp/ readonly
Expectation:
- coverage.php gets written to /tmp/foo/coverage.php
Output:
Pest\Exceptions\ShouldNotHappen
This should not happen - please create an new issue here: https://github.com/pestphp/pest.
Issue: Coverage not found in path: xxx/vendor/pestphp/pest/.temp/coverage.php.
PHP version: 8.4.1
Operating system: Linux
at vendor/pestphp/pest/src/Exceptions/ShouldNotHappen.php:37
33▕ * Creates a new instance of should not happen without a specific exception.
34▕ */
35▕ public static function fromMessage(string $message): ShouldNotHappen
36▕ {
➜ 37▕ return new ShouldNotHappen(new Exception($message));
38▕ }
39▕ }
40▕
+1 vendor frames
1 vendor/pestphp/pest/src/Support/Coverage.php:88
Pest\Exceptions\ShouldNotHappen::fromMessage()
+1 vendor frames
2 vendor/pestphp/pest/src/Plugins/Coverage.php:147
Pest\Support\Coverage::report()
+1 vendor frames
Sample Repository
No response
Pest Version
3.6.0
PHP Version
8.4.1
Operation System
Linux
Notes
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the parallel-process failure with --cache-directory=/tmp/foo and a read-only vendor/pestphp/pest/.temp directory. Read src/Support/Coverage.php and src/Plugins/Coverage.php, which appear in the reported stack trace. Done means coverage.php is created in the configured cache directory and a clear error is reported when it cannot be written.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100