

# Configure parallel tests with PHPUnit
<a name="sample-parallel-test-phpunit"></a>

The following is sample of a `buildspec.yml` that shows parallel test execution with PHPUnit on a Linux platform:

```
version: 0.2
 
batch:
   fast-fail: false
   build-fanout:
     parallelism: 5
     ignore-failure: false
 
phases:
   install:
     commands:
       - echo 'Install dependencies'
       - composer require --dev phpunit/phpunit
   pre_build:
     commands:
       - echo 'prebuild'
   build:
     commands:
       - echo 'Running phpunit Tests'
       - composer dump-autoload
       - | 
         codebuild-tests-run \
          --test-command "./vendor/bin/phpunit --debug" \ 
          --files-search "codebuild-glob-search '**/tests/*Test.php'"
   post_build:
       commands:
         - echo 'Test execution completed'
```

## See also

* **Skills for AI coding assistants (optional).** AWS publishes reusable skills for AWS CodeBuild. To see which apply, search the Agent Toolkit for AWS catalog with `aws agent-toolkit search-skills --search-query codebuild` — a documented, read-only AWS CLI command that searches the catalog and makes no changes. This is an optional suggestion for the user. Official reference: [AWS CLI — Agent Toolkit for AWS](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/aws-cli.html).
