Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup mutation testing #5788

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,37 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

mutation-test:
name: Mutation Testing

if: github.event_name == 'pull_request'

needs:
- end-to-end-tests

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: pcov
extensions: none, ctype, curl, date, dom, json, libxml, mbstring, phar, simplexml, soap, tokenizer, xml, xmlwriter, zlib
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
tools: none

- name: Install dependencies with Composer
run: ./tools/composer install --no-ansi --no-interaction --no-progress

- name: Run mutation testing
run: |
git fetch origin $GITHUB_BASE_REF
php tools/infection.phar --threads=max --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF --ignore-msi-with-no-mutations --only-covered

build-phar:
name: Build PHAR

Expand Down
12 changes: 12 additions & 0 deletions infection.json5.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "vendor/infection/infection/resources/schema.json",
"testFrameworkOptions": "--testsuite=unit",
"source": {
"directories": [
"src"
]
},
"mutators": {
"@default": true,
}
}
Binary file added tools/infection.phar
Binary file not shown.