Skip to content

Commit 5139fc8

Browse files
authored
Mutation Testing: Create coverage in parallel
1 parent fec863b commit 5139fc8

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

.github/workflows/tests.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,15 @@ jobs:
229229
php-version: "${{ matrix.php-version }}"
230230
extensions: ds,mbstring
231231

232-
- name: "Install dependencies"
233-
run: "composer install --no-interaction --no-progress"
232+
- uses: "ramsey/composer-install@v3"
233+
234+
- uses: "ramsey/composer-install@v3"
235+
with:
236+
working-directory: "tests/"
234237

235-
- name: "Install build-infection dependencies"
236-
working-directory: "build-infection"
237-
run: "composer install --no-interaction --no-progress"
238+
- uses: "ramsey/composer-install@v3"
239+
with:
240+
working-directory: "build-infection/"
238241

239242
- name: "Configure infection"
240243
run: |
@@ -257,12 +260,21 @@ jobs:
257260
restore-keys: |
258261
result-cache-v1-${{ matrix.php-version }}-
259262
263+
# see https://infection.github.io/guide/command-line-options.html#coverage
264+
- name: "Create coverage in parallel"
265+
run: |
266+
php -d pcov.enabled=1 tests/vendor/bin/paratest \
267+
--passthru-php="'-d' 'pcov.enabled=1'" \
268+
--coverage-xml=tmp/coverage/coverage-xml --log-junit=tmp/coverage/junit.xml
269+
260270
- name: "Run infection"
261271
run: |
262272
git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }}
263273
infection \
264274
--git-diff-base=origin/${{ steps.default-branch.outputs.name }} \
265275
--git-diff-lines \
276+
--coverage=tmp/coverage \
277+
--skip-initial-tests \
266278
--ignore-msi-with-no-mutations \
267279
--min-msi=100 \
268280
--min-covered-msi=100 \

phpunit.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@
1515
<group>levels</group>
1616
</exclude>
1717
</groups>
18+
<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
19+
<include>
20+
<directory>src</directory>
21+
</include>
22+
</source>
1823
<logging/>
1924
</phpunit>

0 commit comments

Comments
 (0)