PHPackages                             cnimmo/test-only-changed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. cnimmo/test-only-changed

ActiveLibrary[Testing &amp; Quality](/categories/testing)

cnimmo/test-only-changed
========================

Run Paratest on only changed files

1.2.0(2y ago)065MITPHP

Since Apr 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/CNimmo16/php-test-only-changed)[ Packagist](https://packagist.org/packages/cnimmo/test-only-changed)[ RSS](/packages/cnimmo-test-only-changed/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (8)Used By (0)

Stop wasting time running tests that you know aren't failing!
=============================================================

[](#stop-wasting-time-running-tests-that-you-know-arent-failing)

This Github action allows you to execute your PHP unit tests more quickly in CI, by running only tests which are related to files changed since the last successful workflow run.

In other words, we only run the tests which *may* actually be failing.

This package is inspired by the --onlyChanged flag in [Jest](https://github.com/jestjs/jest).

We use [Paratest](https://github.com/paratestphp/paratest) as the test runner for blazingly fast parallel execution.

Prerequisites
-------------

[](#prerequisites)

The action should be used in a Github actions workflow with PHP and composer already set up.

Usage
-----

[](#usage)

See an [example workflow](./.github/workflows/example.yml).

**Supported arguments:**

- `branch-name` Name of branch to scan for last successful workflow run. Defaults to current branch.
- `workflow-id` Name of workflow to check for success. Defaults to current workflow.
- `tests-directory` The directory where the tests are located relative to the root. Defaults to tests.
- `ignore-paths` Files to ignore when determining which files to run. Defaults to `vendor,node_modules,_ide_helper.php`
- `list-only` This option allows the flexibility to configure Paratest/bring your own test runner. When set to true, the action will not run your tests, but instead write a list of all testsuites to the `files` output, joined by the `separator` (see below).
- `separator` To be used alongside the `list-only` argument. Specifies the separator that should be used between each testsuite name. Defaults to a comma.

How it works
------------

[](#how-it-works)

The package builds a dependency graph for each of your test files, and then compares this to the files changed since your tests last passed successfully.

If the dependency graph includes the file being checked, the file is included in the test run.

We then generate a `phpunit.xml` on the fly, based on your existing `phpunit.xml`, with a testsuite specified for each of the relevant test files, as Paratest doesn't support running specific files within a larger test suite.

Caveats
-------

[](#caveats)

- Currently only supports PHP namespaces via "use" imports. Dynamic imports are not detected.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

7

Last Release

1031d ago

Major Versions

0.1.0 → 1.0.02023-04-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/768514e908c2246cc5f180eaeaa60ae76d4749a75371a50488556c776cd5df60?d=identicon)[cnimmo](/maintainers/cnimmo)

---

Top Contributors

[![CNimmo16](https://avatars.githubusercontent.com/u/48329714?v=4)](https://github.com/CNimmo16 "CNimmo16 (40 commits)")

### Embed Badge

![Health badge](/badges/cnimmo-test-only-changed/health.svg)

```
[![Health](https://phpackages.com/badges/cnimmo-test-only-changed/health.svg)](https://phpackages.com/packages/cnimmo-test-only-changed)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M679](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M571](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.0k](/packages/orchestra-testbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
