From affa55122f83575888d4ebf1728992686e8223de Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 7 Sep 2020 09:36:37 +0200 Subject: [PATCH] [TESTS] Running in CI should not create but rather fail on missing snapshots (#1039) * tests: running in CI should not create but rather fail on missing snapshots Otherwise they get created on the CI infrastructure but that's it, the build won't fail although it was forgotten to add the snapshot. * Bump minimum phpunit version which correctly accepts the `-d` parameter The `prefer-lowest` version we get with L6 is 8.0.0 which throws this error: ``` PHP Fatal error: Uncaught TypeError: ini_set() expects parameter 2 to be string, bool given in /home/runner/work/laravel-ide-helper/laravel-ide-helper/vendor/phpunit/phpunit/src/TextUI/Command.php:379 ``` * Update composer.json Co-authored-by: Barry vd. Heuvel --- .github/workflows/run-tests.yml | 2 +- composer.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5e62f32..4cf5c7d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -46,4 +46,4 @@ jobs: composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress - name: Execute Unit Tests - run: composer test + run: composer test-ci diff --git a/composer.json b/composer.json index 51dd72c..0cd686e 100644 --- a/composer.json +++ b/composer.json @@ -36,6 +36,7 @@ "illuminate/view": "^6 || ^7 || ^8", "mockery/mockery": "^1.3", "orchestra/testbench": "^4 || ^5 || ^6", + "phpunit/phpunit": "^8.5 || ^9", "spatie/phpunit-snapshot-assertions": "^1.4 || ^2.2 || ^3", "vimeo/psalm": "^3.12" }, @@ -75,6 +76,7 @@ "php-cs-fixer fix --config=.php_cs.tests.php" ], "test": "phpunit", + "test-ci": "phpunit -d --without-creating-snapshots", "test-regenerate": "phpunit -d --update-snapshots" } }