pestphp / pestphp/pest

[Bug]: --exactly flag does not return a non zero exit code when it should fail

Open
#1,897 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
11.7k
Forks
538
Avg merge
4d 11h
Merged PRs (30d)
8

Description

What Happened

When I run my tests and provide the --exactly flag, which I have set to 100, the exit code is 0 even when the code coverage is not 100%. From what I understand this should be a non-zero exit code.

How to Reproduce

Create a fresh laravel application. The example tests are enough to see the issue. Run php artisan test --coverage --exactly=100. Then check the exit code echo $?.

Sample Repository

No response

Pest Version

5.1.3

PHP Version

8.4

Operation System

macOS

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in a fresh Laravel application with php artisan test --coverage --exactly=100, then inspect how the --exactly coverage option determines the command exit status. Done means the command returns a non-zero exit code when coverage is below 100%, while preserving the expected behavior when it reaches 100%.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.