Skip to content
Snippets Groups Projects

#3486466 Adjust core phpunit xml

Merged Jonathan Smith requested to merge issue/gitlab_templates-3486466:3486466-phpunit-xml into main
All threads resolved!
Files
2
@@ -1055,9 +1055,15 @@ nightwatch (next major):
# Otherwise add --group $_PHPUNIT_TESTGROUPS
WHAT_TO_RUN=$([[ "$_PHPUNIT_TESTGROUPS" == "" || "$_PHPUNIT_TESTGROUPS" == "--all" ]] && echo "" || echo "--group $_PHPUNIT_TESTGROUPS")
PHPUNIT_OPTIONS=''
# If the project does not have its own phpunit.xml(.dist) then use the one from core. Only do this if no -c option is specified in _PHPUNIT_EXTRA.
if [[ ! $_PHPUNIT_EXTRA =~ "-c " ]]; then
test -f "$CI_PROJECT_DIR/phpunit.xml" || test -f "$CI_PROJECT_DIR/phpunit.xml.dist" || PHPUNIT_OPTIONS="$PHPUNIT_OPTIONS -c $_WEB_ROOT/core"
# If the project does not have its own phpunit.xml(.dist) then use the one from core. Only do this if no configuration options are specified in _PHPUNIT_EXTRA.
if [[ ! -f "$CI_PROJECT_DIR/phpunit.xml" && ! -f "$CI_PROJECT_DIR/phpunit.xml.dist" && ! $_PHPUNIT_EXTRA =~ (-c |--configuration|--no-configuration) ]]; then
echo "Getting phpunit.xml.dist from $_WEB_ROOT/core"
cp $_WEB_ROOT/core/phpunit.xml.dist phpunit.xml
echo "Executing curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/prepare-phpunit-xml.php"
curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/prepare-phpunit-xml.php
php prepare-phpunit-xml.php
rm prepare-phpunit-xml.php
printf "$DIVIDER\n"
fi
printf "_PHPUNIT_CONCURRENT=$_PHPUNIT_CONCURRENT, _PHPUNIT_TESTGROUPS=$_PHPUNIT_TESTGROUPS, _PHPUNIT_EXTRA=$_PHPUNIT_EXTRA\nPHPUNIT_OPTIONS=$PHPUNIT_OPTIONS, WHAT_TO_RUN=$WHAT_TO_RUN\n"
echo "executing: sudo -u www-data -E vendor/bin/phpunit $PHPUNIT_OPTIONS --bootstrap $PWD/$_WEB_ROOT/core/tests/bootstrap.php $PWD/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME --log-junit $CI_PROJECT_DIR/junit.xml $WHAT_TO_RUN $_PHPUNIT_EXTRA"
Loading