-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bin/test helper scripts to execute unit tests (#1157)
Co-authored-by: Mark Shust <[email protected]> Co-authored-by: Michael Lehmkuhl <[email protected]> Co-authored-by: Jenyamba <[email protected]> Co-authored-by: Tu Van <[email protected]> Co-authored-by: Cid Lopes <[email protected]>
- Loading branch information
1 parent
6e562ec
commit fb56c6d
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
display_help() { | ||
echo -e "Description: | ||
Run unit tests | ||
Usage: | ||
bin/test/unit <unit_test_path> | ||
Arguments: | ||
<unit_test_path> Specify a path to your test or folder with tests Ex: bin/test/unit app/code/Vendor/Module | ||
Options: | ||
-h, --help Display help message" | ||
} | ||
|
||
|
||
if [[ $1 == "-h" || $1 == "--help" ]]; then | ||
display_help | ||
elif [[ -z $1 ]]; then | ||
echo -e "Please specify a path to your test or folder with tests (ex. app/code/Vendor/Module)" | ||
else | ||
bin/php vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist /var/www/html/"$1" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
display_help() { | ||
echo -e "Description: | ||
Generate unit tests coverage report in folder: dev/tests/unit/report | ||
Usage: | ||
bin/test/unit-coverage <unit_test_path> | ||
Arguments: | ||
<unit_test_path> Specify a path to your test or folder with tests Ex: bin/test/unit-coverage app/code/Vendor/Module | ||
Options: | ||
-h, --help Display help message" | ||
} | ||
|
||
if [[ $1 == "-h" || $1 == "--help" ]]; then | ||
display_help | ||
elif [[ -z $1 ]]; then | ||
echo -e "Please specify a path to your test or folder with tests (ex. app/code/Vendor/Module)" | ||
else | ||
bin/php -d xdebug.mode=coverage vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist --coverage-html ./dev/tests/unit/report /var/www/html/"$1" | ||
echo -e "Report path: dev/tests/unit/report" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
display_help() { | ||
echo -e "Description: | ||
Run unit tests with xdebug (you need to turn on xdebug in IDE as usual) | ||
Usage: | ||
bin/test/unit-xdebug <unit_test_path> | ||
Arguments: | ||
<unit_test_path> Specify a path to your test or folder with tests Ex: bin/test/unit-xdebug app/code/Vendor/Module | ||
Options: | ||
-h, --help Display help message" | ||
} | ||
|
||
|
||
if [[ $1 == "-h" || $1 == "--help" ]]; then | ||
display_help | ||
elif [[ -z $1 ]]; then | ||
echo -e "Please specify a path to your test or folder with tests (ex. app/code/Vendor/Module)" | ||
else | ||
bin/php -d xdebug.start_with_request=yes vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist /var/www/html/"$1" | ||
fi |