From 18f6870f81a6e5c776f00af4abd64559379c9606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 31 Mar 2020 09:07:39 +0200 Subject: [PATCH] Enhancement: Collect coverage from all tests --- .github/workflows/integrate.yaml | 12 +++++----- Makefile | 12 +++++----- infection.json | 2 +- test/AutoReview/phpunit.xml | 30 ------------------------- test/Integration/FixtureFactoryTest.php | 3 +++ test/Integration/phpunit.xml | 30 ------------------------- test/{Unit => }/phpunit.xml | 18 ++++++++++----- 7 files changed, 28 insertions(+), 79 deletions(-) delete mode 100644 test/AutoReview/phpunit.xml delete mode 100644 test/Integration/phpunit.xml rename test/{Unit => }/phpunit.xml (63%) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 65da0227..ed89b979 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -9,8 +9,8 @@ on: # yamllint disable-line rule:truthy - "master" env: - MIN_COVERED_MSI: 95 - MIN_MSI: 91 + MIN_COVERED_MSI: 98 + MIN_MSI: 96 REQUIRED_PHP_EXTENSIONS: "mbstring" jobs: @@ -268,13 +268,13 @@ jobs: run: "vendor/bin/doctrine orm:validate-schema --skip-sync" - name: "Run auto-review tests with phpunit/phpunit" - run: "vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml" + run: "vendor/bin/phpunit --configuration=test/phpunit.xml --coverage-text --testsuite=auto-review" - name: "Run unit tests with phpunit/phpunit" - run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml" + run: "vendor/bin/phpunit --configuration=test/phpunit.xml --coverage-text --testsuite=unit" - name: "Run integration tests with phpunit/phpunit" - run: "vendor/bin/phpunit --configuration=test/Integration/phpunit.xml" + run: "vendor/bin/phpunit --configuration=test/phpunit.xml --coverage-text --testsuite=integration" code-coverage: name: "Code Coverage" @@ -324,7 +324,7 @@ jobs: run: "composer update --no-interaction --no-progress --no-suggest" - name: "Collect code coverage with pcov and phpunit/phpunit" - run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=.build/logs/clover.xml" + run: "vendor/bin/phpunit --configuration=test/phpunit.xml --coverage-clover=.build/logs/clover.xml --testsuite=unit,integration" - name: "Send code coverage report to Codecov.io" env: diff --git a/Makefile b/Makefile index 404ba6bb..a27ef58a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -MIN_COVERED_MSI:=95 -MIN_MSI:=91 +MIN_COVERED_MSI:=98 +MIN_MSI:=96 .PHONY: it it: coding-standards static-code-analysis tests ## Runs the coding-standards, static-code-analysis, and tests targets @@ -7,7 +7,7 @@ it: coding-standards static-code-analysis tests ## Runs the coding-standards, st .PHONY: code-coverage code-coverage: vendor ## Collects coverage from running unit tests with phpunit/phpunit mkdir -p .build/phpunit - vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text + vendor/bin/phpunit --configuration=test/phpunit.xml --coverage-text --testsuite=unit,integration .PHONY: coding-standards coding-standards: vendor ## Fixes code style issues with friendsofphp/php-cs-fixer @@ -51,9 +51,9 @@ static-code-analysis-baseline: vendor ## Generates a baseline for static code an .PHONY: tests tests: vendor ## Runs auto-review, unit, and integration tests with phpunit/phpunit mkdir -p .build/phpunit - vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml - vendor/bin/phpunit --configuration=test/Unit/phpunit.xml - vendor/bin/phpunit --configuration=test/Integration/phpunit.xml + vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=auto-review + vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=unit + vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=integration vendor: composer.json composer.lock composer validate --strict diff --git a/infection.json b/infection.json index c7774fc5..8c8f0182 100644 --- a/infection.json +++ b/infection.json @@ -6,7 +6,7 @@ ] }, "phpUnit": { - "configDir": "test\/Unit" + "configDir": "test\/" }, "logs": { "text": ".build/infection/infection-log.txt" diff --git a/test/AutoReview/phpunit.xml b/test/AutoReview/phpunit.xml deleted file mode 100644 index 4f5220f1..00000000 --- a/test/AutoReview/phpunit.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - . - - - diff --git a/test/Integration/FixtureFactoryTest.php b/test/Integration/FixtureFactoryTest.php index 4669d368..746af7e5 100644 --- a/test/Integration/FixtureFactoryTest.php +++ b/test/Integration/FixtureFactoryTest.php @@ -22,6 +22,9 @@ * @internal * * @covers \Ergebnis\FactoryBot\FixtureFactory + * + * @uses \Ergebnis\FactoryBot\EntityDefinition + * @uses \Ergebnis\FactoryBot\FieldDefinition */ final class FixtureFactoryTest extends AbstractTestCase { diff --git a/test/Integration/phpunit.xml b/test/Integration/phpunit.xml deleted file mode 100644 index 2de11864..00000000 --- a/test/Integration/phpunit.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - . - - - diff --git a/test/Unit/phpunit.xml b/test/phpunit.xml similarity index 63% rename from test/Unit/phpunit.xml rename to test/phpunit.xml index 5d606146..d65b1fce 100644 --- a/test/Unit/phpunit.xml +++ b/test/phpunit.xml @@ -1,15 +1,15 @@ - - . + + AutoReview/ + + + Integration/ + + + Unit/ - ../../src/ + ../src/