Skip to content

test: CI is green with zero tests — phpunit reports 0% over 1168 lines #2

Description

@WAHIB-EL-KHADIRI

What the green check actually proves

composer check runs phpcs, then phpstan level 5, then phpunit. The first two
pass on their own merits. The third does this:

PHPUnit 10.5.64 by Sebastian Bergmann and contributors.
Runtime:       PHP 8.1.34 with Xdebug 3.5.3
Configuration: /home/runner/work/taskflow-pro/taskflow-pro/phpunit.xml.dist

No tests executed!

Code Coverage Report:
 Summary:
  Classes:  0.00% (0/69)
  Methods:  0.00% (0/379)
  Lines:    0.00% (0/1168)

tests/ exists and is empty. PHPUnit exits 0 when a suite is empty, so the
job goes green.

The CI badge therefore says nothing about whether this code works. It says
the code is formatted and type-consistent. 1168 lines across 69 classes have
never been executed by a test.

Why it stays invisible

phpunit.xml.dist is deliberately strict — it sets failOnRisky="true" and
failOnWarning="true" — but not failOnEmptyTestSuite. It guards every
outcome except the one that is actually happening.

Two parts, in order

1. Make the gate honest. Add to phpunit.xml.dist:

failOnEmptyTestSuite="true"

Doing this alone turns CI red immediately, which is the accurate state — so it
should land together with, or just after, the first real test.

2. Start the suite where it is worth most. The domain layer is the part
this project's README claims is free of framework and persistence concerns,
which is exactly the part that is cheap to test and most embarrassing to have
wrong. A handful of tests over the entities and use cases in app/ buys more
than broad shallow coverage.

Good first issue

Picking one class in app/, writing two or three tests for its real behaviour,
and flipping failOnEmptyTestSuite is a self-contained contribution that
leaves the repository measurably more trustworthy than it was.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions