Skip to content

Commit

Permalink
Merge pull request #337 from lptn/improve-testing-experience
Browse files Browse the repository at this point in the history
Improve testing experience, do not override `composer check` command
  • Loading branch information
lptn authored Mar 3, 2023
2 parents 3cd92aa + 8b8878b commit d4b4de2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: composer install

- name: Run Unit tests
run: composer unit
run: composer test:unit


acceptance_tests:
Expand Down Expand Up @@ -77,4 +77,4 @@ jobs:
run: composer update --with='laravel/framework:${{ matrix.laravel }}' --no-interaction --no-progress --prefer-dist --prefer-stable

- name: Run Acceptance Tests
run: composer test
run: composer test:type
16 changes: 7 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,20 @@
},
"scripts": {
"analyze": "psalm --find-dead-code --find-unused-psalm-suppress --long-progress",
"cs": "@lint",
"cs-fix": "@lint-fix",
"check": [
"@unit",
"@analyze",
"@lint",
"@test"
],
"lint": "phpcs --report-full --report-summary --colors -n -s",
"lint-fix": "phpcbf -n",
"psalm": "@analyze",
"psalm-set-baseline": "@php ./psalm --set-baseline=psalm-baseline.xml",
"test": [
"@lint",
"@psalm",
"@test:unit",
"@test:type"
],
"test:type": [
"Composer\\Config::disableProcessTimeout",
"codecept run --skip-group skip"
],
"unit": "phpunit"
"test:unit": "phpunit"
}
}
2 changes: 1 addition & 1 deletion tests/Application/laravel-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rm -rf $APP_INSTALLATION_PATH

echo "Installing Laravel"
# See https:/laravel/laravel/tags for Laravel versions
composer create-project laravel/laravel $APP_INSTALLATION_PATH 10.0 --quiet --prefer-dist
composer create-project --quiet --prefer-dist laravel/laravel $APP_INSTALLATION_PATH 10.0 --quiet --prefer-dist
cd $APP_INSTALLATION_PATH

echo "Preparing Laravel"
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/lumen-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rm -rf $APP_INSTALLATION_PATH

echo "Installing Lumen"
# See https:/laravel/lumen/tags for Lumen versions
composer create-project laravel/lumen $APP_INSTALLATION_PATH 10.0 --quiet --prefer-dist
composer create-project --quiet --prefer-dist laravel/lumen $APP_INSTALLATION_PATH 10.0 --quiet --prefer-dist
cd $APP_INSTALLATION_PATH

echo "Adding package from source"
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tests

There are 3 types of tests:
1. Acceptance (main one): Use Codeception to run Psalm over code snippets i a context of fake Laravel app [using orchestra/testbench]
1. Acceptance (main one): Use Codeception to run Psalm over code snippets in a context of fake Laravel app [using orchestra/testbench]
2. Application: create an [almost] empty Laravel (or Lumen) app and run Psalm over its codebase.
3. Unit: use PHPUnit to test some internal logic without running Psalm.

0 comments on commit d4b4de2

Please sign in to comment.