From db47a9a253bc67debe17e77367d5c8fddba89e51 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 9 Aug 2022 19:15:49 +0200 Subject: [PATCH] Added mutation tests for CLI E2E tests --- composer.json | 15 +++++++++++---- infection-cli.json | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 infection-cli.json diff --git a/composer.json b/composer.json index 815fc6d6..6a91dd85 100644 --- a/composer.json +++ b/composer.json @@ -57,8 +57,8 @@ }, "require-dev": { "cebe/php-openapi": "^1.7", - "dms/phpunit-arraysubset-asserts": "^0.4.0", "devster/ubench": "^2.1", + "dms/phpunit-arraysubset-asserts": "^0.4.0", "infection/infection": "^0.26.5", "openswoole/ide-helper": "~4.11.1", "phpspec/prophecy-phpunit": "^2.0", @@ -115,12 +115,14 @@ "test": [ "@test:unit", "@test:db", - "@test:api" + "@test:api", + "@test:cli" ], "test:ci": [ "@test:unit:ci", "@test:db", - "@test:api:ci" + "@test:api:ci", + "@test:cli:ci" ], "test:unit": "@php vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-unit.cov --testdox", "test:unit:ci": "@test:unit --coverage-xml=build/coverage-unit/coverage-xml --log-junit=build/coverage-unit/junit.xml", @@ -135,11 +137,12 @@ "test:api": "bin/test/run-api-tests.sh", "test:api:ci": "GENERATE_COVERAGE=yes composer test:api", "test:cli": "APP_ENV=test DB_DRIVER=maria TEST_ENV=cli php vendor/bin/phpunit --order-by=random --colors=always --testdox -c phpunit-cli.xml", - "test:cli:ci": "GENERATE_COVERAGE=yes composer test:cli", + "test:cli:ci": "GENERATE_COVERAGE=yes composer test:cli -- --log-junit=build/coverage-cli/junit.xml", "infect:ci:base": "infection --threads=4 --log-verbosity=default --only-covered --only-covering-test-cases --skip-initial-tests", "infect:ci:unit": "@infect:ci:base --coverage=build/coverage-unit --min-msi=84", "infect:ci:db": "@infect:ci:base --coverage=build/coverage-db --min-msi=95 --configuration=infection-db.json", "infect:ci:api": "@infect:ci:base --coverage=build/coverage-api --min-msi=80 --configuration=infection-api.json", + "infect:ci:cli": "@infect:ci:base --coverage=build/coverage-cli --min-msi=95 --configuration=infection-cli.json", "infect:ci": "@parallel infect:ci:unit infect:ci:db infect:ci:api", "infect:test": [ "@parallel test:unit:ci test:db:sqlite:ci test:api:ci", @@ -153,6 +156,10 @@ "@test:api:ci", "@infect:ci:api" ], + "infect:test:cli": [ + "@test:cli:ci", + "@infect:ci:cli" + ], "swagger:validate": "php-openapi validate docs/swagger/swagger.json", "swagger:inline": "php-openapi inline docs/swagger/swagger.json docs/swagger/swagger-inlined.json", "clean:dev": "rm -f data/database.sqlite && rm -f config/params/generated_config.php" diff --git a/infection-cli.json b/infection-cli.json new file mode 100644 index 00000000..60552d11 --- /dev/null +++ b/infection-cli.json @@ -0,0 +1,24 @@ +{ + "source": { + "directories": [ + "module/*/src" + ] + }, + "timeout": 5, + "logs": { + "text": "build/infection-cli/infection-log.txt", + "html": "build/infection-cli/infection-log.html", + "summary": "build/infection-cli/summary-log.txt", + "debug": "build/infection-cli/debug-log.txt" + }, + "tmpDir": "build/infection-cli/temp", + "phpUnit": { + "configDir": "." + }, + "testFrameworkOptions": "--configuration=phpunit-cli.xml", + "mutators": { + "@default": true, + "IdenticalEqual": false, + "NotIdenticalNotEqual": false + } +}