From a9269811dc102412bea959d446363a230d84b598 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 15 Feb 2020 20:55:04 +0100 Subject: [PATCH 1/3] Added command to run api tests with code coverage --- bin/test/run-api-tests.sh | 2 +- composer.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/test/run-api-tests.sh b/bin/test/run-api-tests.sh index 2a14b218..fae0c628 100755 --- a/bin/test/run-api-tests.sh +++ b/bin/test/run-api-tests.sh @@ -9,7 +9,7 @@ echo 'Starting server...' vendor/bin/mezzio-swoole start -d sleep 2 -vendor/bin/phpunit --order-by=random -c phpunit-api.xml --testdox --colors=always $* +phpdbg -qrr vendor/bin/phpunit --order-by=random -c phpunit-api.xml --testdox --colors=always $* testsExitCode=$? vendor/bin/mezzio-swoole stop diff --git a/composer.json b/composer.json index f26c9eec..c9199246 100644 --- a/composer.json +++ b/composer.json @@ -107,7 +107,7 @@ "test:ci": [ "@test:unit:ci", "@test:db:ci", - "@test:api" + "@test:api:ci" ], "test:unit": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-unit.cov --testdox", "test:unit:ci": "@test:unit --coverage-clover=build/clover.xml --coverage-xml=build/coverage-xml --log-junit=build/junit.xml", @@ -129,6 +129,7 @@ "test:db:postgres": "DB_DRIVER=postgres composer test:db:sqlite", "test:db:ms": "DB_DRIVER=mssql composer test:db:sqlite", "test:api": "bin/test/run-api-tests.sh", + "test:api:ci": "@test:api --coverage-php build/coverage-api.cov", "test:unit:pretty": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-html build/coverage", "infect": "infection --threads=4 --min-msi=80 --log-verbosity=default --only-covered", "infect:ci": "@infect --coverage=build", From 37c0a813db70e5efc480c0446a4abf7230b252b8 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 15 Feb 2020 21:14:14 +0100 Subject: [PATCH 2/3] Updated to PHPUnit 9 --- .travis.yml | 4 ++-- composer.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d6176ed..4e4c70f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,8 +37,8 @@ script: after_success: - rm -f build/clover.xml - - wget https://phar.phpunit.de/phpcov-6.0.1.phar - - phpdbg -qrr phpcov-6.0.1.phar merge build --clover build/clover.xml + - wget https://phar.phpunit.de/phpcov-7.0.1.phar + - phpdbg -qrr phpcov-7.0.1.phar merge build --clover build/clover.xml - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/clover.xml diff --git a/composer.json b/composer.json index c9199246..cdda9028 100644 --- a/composer.json +++ b/composer.json @@ -58,14 +58,14 @@ }, "require-dev": { "devster/ubench": "^2.0", - "dms/phpunit-arraysubset-asserts": "^0.1.0", + "dms/phpunit-arraysubset-asserts": "^0.2.0", "eaglewu/swoole-ide-helper": "dev-master", "infection/infection": "^0.15.0", "phpstan/phpstan": "^0.12.3", - "phpunit/phpunit": "^8.3", + "phpunit/phpunit": "^9.0.1", "roave/security-advisories": "dev-master", "shlinkio/php-coding-standard": "~2.1.0", - "shlinkio/shlink-test-utils": "^1.3", + "shlinkio/shlink-test-utils": "^1.4", "symfony/var-dumper": "^5.0" }, "autoload": { From 2cf9f64e8e9f9eb0733e0b4f176174757e943471 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 15 Feb 2020 21:14:55 +0100 Subject: [PATCH 3/3] Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ed83602..edf73367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this #### Changed -* *Nothing* +* [#656](https://github.com/shlinkio/shlink/issues/656) Updated to PHPUnit 9. #### Deprecated