From 6bec34cdccf2b5ab126f3a3291b1ddcaac2e2213 Mon Sep 17 00:00:00 2001 From: Jorick Schram Date: Mon, 16 Dec 2024 16:03:35 +0100 Subject: [PATCH] Bootstrap application before running tests --- .github/workflows/continuous-integration.yaml | 2 +- composer.json | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 81d62bd..a29578c 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -148,7 +148,7 @@ jobs: run: ./buildHook.sh $PWD - name: Run Test & Coverage Report - run: ./vendor/bin/phpunit --coverage-clover ./coverage.xml + run: composer test-coverage-xml env: DB_HOST: localhost DB_DATABASE: tests_db diff --git a/composer.json b/composer.json index 7732231..38b4bd1 100644 --- a/composer.json +++ b/composer.json @@ -87,8 +87,15 @@ "@php artisan test --parallel" ], "test-coverage": [ + "php artisan migrate --env=testing --no-ansi", + "php artisan bootstrap:application --env=testing --no-ansi", "./vendor/bin/phpunit --coverage-html public/tests-report" ], + "test-coverage-xml": [ + "php artisan migrate --env=testing --no-ansi", + "php artisan bootstrap:application --env=testing --no-ansi", + "./vendor/bin/phpunit --coverage-clover ./coverage.xml" + ], "test-fresh": [ "php artisan migrate:fresh --env=testing --no-ansi", "php artisan bootstrap:application --env=testing --no-ansi",