User tests: Successful: Unsuccessful:
This should run a php -l on the code
See that travis not fails
None
Any suggestions here for the Script?
Travis script based on: https://hakre.wordpress.com/2015/11/10/linting-php-files-in-parallel-on-travis/
Status | New | ⇒ | Pending |
Labels |
Added:
?
?
|
Category | ⇒ | Unit Tests |
Also doesn't php systax check result be difference across php versions? if so,, so it needs to be checked in all supported php version.
Yep. Because each branch has different deprecation warnings and allowed syntax (like the report at #12380 will only happen with PHP 7.x but not 5.x, likewise if we tried linting https://github.com/joomla/joomla-cms/blob/staging/libraries/vendor/composer/autoload_static.php it would fail on PHP 5.5 and earlier but it's not an issue because that file isn't included by Composer on those PHP versions).
with something like this
if [[ $RUN_PHP_SYNTAX_CHECK == "yes" ]]; then bash build/travis/php-syntax-check.sh; fi
#!/bin/bash
# Script for php/hhvm syntax check in Joomla!
RUN_COMMAND="php -d display_errors=stderr -n -l"
if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then RUN_COMMAND="hhvm -d display_errors=stderr -l"; fi
find . \( -path ./libraries/vendor -o -path ./libraries/phpass -o -path ./libraries/fof -o -path ./tests -o -wholename './administrator/components/com_joomlaupdate/restore.php' \) -prune -o -type f -name "*.php" -print | xargs -n1 -P8 $RUN_COMMAND 1>/dev/null
we can faster lint tests (around 75s in php7 - was 107s here) and test also in hhvm
notice i removed the lint test for fof and unit tests
maybe it could be faster, by messing with the find command
Thanks @andrepereiradasilva It works now.
See here for a systax error: https://travis-ci.org/joomla/joomla-cms/jobs/167874647
And here if it works without problems: https://travis-ci.org/joomla/joomla-cms/jobs/167876323
I have also added excluded more 3rd Party folders.
So i think we are good to go here?
I have tested this item
works fine.
the only "issue" here is that it delays all unit tests more than 75s
but i guess we have to live with that ...
Milestone |
Added: |
Any reason to not merge this?
travis runs already long enough so adding more stuff to it makes it run even longer
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-10-31 12:16:02 |
Closed_By | ⇒ | zero-24 |
Closing than
we have an infrastructure sprint in tow weeks and we will look if we ca run syntax checks as part of the pipeline we than have setup
IMHO, for consistency, you should use a variable like
RUN_PHPSYNTAXCHECK="yes"
and then is that var is yes run the bash scriptAlso doesn't php syntax check result be difference across php versions? if so, it needs to be checked in all supported php version.