A high-performance parallel test processor for PHPUnit tests written in Go. Execute PHP unit and integration tests in parallel to significantly reduce test execution time. Because waiting for tests is so 2023.
- Parallel Execution: Run multiple PHPUnit tests simultaneously across multiple workers
- Test Discovery: Automatically discover test files in your project
- Flexible Filtering: Filter tests by name patterns with wildcard support
- Interactive Error Viewer: Beautiful TUI for viewing and managing test failures
- Database Migrations: Run migrations in parallel for all test databases
- Real-time Progress: See test execution progress with progress bars
- Colorized Output: Beautiful terminal output with colors
- Test Case Listing: List all test files and their test cases in a tree view
- Single Binary: No dependencies, just one executable
- Go: 1.22 or higher (for building from source)
- PHP: 7.4 or higher
- PHPUnit: Installed in your PHP project (
vendor/bin/phpunit) - Laravel: Project should use Laravel framework (for migrations support)
Linux (64-bit):
curl -sL https://github.com/giorgi-leladze/php-test-processor/releases/latest/download/ptp-linux-amd64.tar.gz | tar -xz && sudo mv ptp-linux-amd64 /usr/local/bin/ptp && chmod +x /usr/local/bin/ptp
macOS Intel:
curl -sL https://github.com/giorgi-leladze/php-test-processor/releases/latest/download/ptp-darwin-amd64.tar.gz | tar -xz && sudo mv ptp-darwin-amd64 /usr/local/bin/ptp && chmod +x /usr/local/bin/ptpmacOS Apple Silicon (M1/M2/M3/M4):
curl -sL https://github.com/giorgi-leladze/php-test-processor/releases/latest/download/ptp-darwin-arm64.tar.gz | tar -xz && sudo mv ptp-darwin-arm64 /opt/homebrew/bin/ptp && chmod +x /opt/homebrew/bin/ptpOr visit the Releases page to download manually.
# Clone the repository
git clone https://github.com/giorgi-leladze/php-test-processor.git
cd php-test-processor
# Build the binary
go build -o ptp .
# Make it executable (Linux/macOS)
chmod +x ptp
# Move to a directory in your PATH (optional)
sudo mv ptp /usr/local/bin/go install github.com/giorgi-leladze/php-test-processor@latestThis will install the ptp binary to $GOPATH/bin (or $HOME/go/bin if GOPATH is not set).
PTP uses sensible defaults and doesn't require any configuration file. The following directories are automatically ignored when searching for test files:
vendornode_modulespublicstoragebootstrapconfigdatabaseresourcesroutes
You can override the default number of processors (4) using the --processors flag.
# Run all tests with default settings
ptp run
# Run with custom number of processors
ptp run --processors 8
# Run tests from a specific directory
ptp run --test-path tests/Unit
# Filter tests by name pattern
ptp run --filter "*UserTest.php"
ptp run --filter "*Payment*"
# Run migrations before tests
ptp run --migrate
# Run migrations without fresh (only pending migrations)
ptp run --migrate --no-fresh
# Combine options
ptp run --test-path tests/Integration --filter "*Payment*" --processors 8# List all test files
ptp list
# List tests with test cases (tree view)
ptp list --test-cases
# Filter tests when listing
ptp list --filter "*UserTest.php"
# List tests from specific directory
ptp list --test-path tests/Unit --test-cases# Run migrations for all test databases
ptp migrate
# Run with custom number of workers
ptp migrate --processors 8
# Run without fresh (only pending migrations)
ptp migrate --no-fresh# Open interactive error viewer
ptp faills
# Navigate with arrow keys, mark tests as resolved with 'R', view details with right arrow- Test Discovery: Scans your project directory for
*Test.phpfiles (recursively from the specified path) - Filtering: Applies name filters if provided (supports wildcard patterns)
- Worker Pool: Creates multiple worker processes (one per processor)
- Parallel Execution: Each worker runs PHPUnit tests in isolated environments with separate databases
- Result Aggregation: Collects and parses results from all workers
- Output: Displays formatted results and saves to JSON for later viewing
PTP automatically creates separate test databases for each worker:
testing_1,testing_2, etc.
Each worker uses its own database to avoid conflicts during parallel execution.
Test results are saved to storage/test-results.json for later viewing with ptp faills.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Cobra for CLI
- Uses tview for the interactive TUI
- Uses color for terminal colors
- Uses phpunit for test execution
If you encounter any issues or have questions, please open an issue on GitHub.
Note: This project is actively maintained. For detailed architecture information, see ARCHITECTURE.md.