From 6eb3dae8c382d5d39d77f803a24f7d8899648965 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 1 Jan 2021 11:13:51 +0100 Subject: [PATCH 1/2] Added dependency on composer parallel to speed-up dev commnds --- composer.json | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index e503edcb..9c82c6ed 100644 --- a/composer.json +++ b/composer.json @@ -72,7 +72,8 @@ "roave/security-advisories": "dev-master", "shlinkio/php-coding-standard": "~2.1.1", "shlinkio/shlink-test-utils": "^1.6", - "symfony/var-dumper": "^5.2" + "symfony/var-dumper": "^5.2", + "veewee/composer-run-parallel": "^0.1.0" }, "autoload": { "psr-4": { @@ -105,6 +106,10 @@ "@test:ci", "@infect:ci" ], + "ci:parallel": [ + "@parallel cs stan test:unit:ci test:db:sqlite:ci test:db:mysql test:db:maria test:db:postgres test:db:ms", + "@parallel test:api infect:ci:unit infect:ci:db" + ], "cs": "phpcs", "cs:fix": "phpcbf", "stan": "phpstan analyse module/*/src/ module/*/config config docker/config data/migrations --level=6", @@ -137,9 +142,11 @@ "test:unit:pretty": "@php vendor/bin/phpunit --order-by=random --colors=always --coverage-html build/coverage-unit-html", "infect": "infection --threads=4 --min-msi=80 --log-verbosity=default --only-covered", "infect:ci:base": "@infect --skip-initial-tests", + "infect:ci:unit": "@infect:ci:base --coverage=build/coverage-unit", + "infect:ci:db": "@infect:ci:base --coverage=build/coverage-db --min-msi=95 --test-framework-options=--configuration=phpunit-db.xml", "infect:ci": [ - "@infect:ci:base --coverage=build/coverage-unit", - "@infect:ci:base --coverage=build/coverage-db --test-framework-options=--configuration=phpunit-db.xml" + "@infect:ci:unit", + "@infect:ci:db" ], "infect:test": [ "@test:unit:ci", From f3b4e94def96b7b90fb84423480b8ed79c6ac8bb Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 1 Jan 2021 11:19:57 +0100 Subject: [PATCH 2/2] Documented missing composer commands --- composer.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 9c82c6ed..b2828ef9 100644 --- a/composer.json +++ b/composer.json @@ -157,6 +157,7 @@ }, "scripts-descriptions": { "ci": "Alias for \"cs\", \"stan\", \"test:ci\" and \"infect:ci\"", + "ci:parallel": "Same as \"ci\", but parallelizing tasks as much as possible", "cs": "Checks coding styles", "cs:fix": "Fixes coding styles, when possible", "stan": "Inspects code with phpstan", @@ -166,14 +167,17 @@ "test:unit:ci": "Runs unit test suites, generating all needed reports and logs for CI envs", "test:db": "Runs database test suites on a SQLite, MySQL, MariaDB, PostgreSQL and MsSQL", "test:db:sqlite": "Runs database test suites on a SQLite database", + "test:db:sqlite:ci": "Runs database test suites on a SQLite database, generating all needed reports and logs for CI envs", "test:db:mysql": "Runs database test suites on a MySQL database", "test:db:maria": "Runs database test suites on a MariaDB database", "test:db:postgres": "Runs database test suites on a PostgreSQL database", + "test:db:ms": "Runs database test suites on a Miscrosoft SQL Server database", "test:api": "Runs API test suites", "test:unit:pretty": "Runs unit test suites and generates an HTML code coverage report", - "infect": "Checks unit tests quality applying mutation testing", - "infect:ci": "Checks unit tests quality applying mutation testing with existing reports and logs", - "infect:test": "Checks unit tests quality applying mutation testing", + "infect:ci": "Checks unit and db tests quality applying mutation testing with existing reports and logs", + "infect:ci:unit": "Checks unit tests quality applying mutation testing with existing reports and logs", + "infect:ci:db": "Checks db tests quality applying mutation testing with existing reports and logs", + "infect:test": "Runs unit and db tests, then checks tests quality applying mutation testing", "clean:dev": "Deletes artifacts which are gitignored and could affect dev env" }, "config": {