Commit 08173a4a authored by Florent Torregrosa's avatar Florent Torregrosa 🤘
Browse files

Tools: allows to execute Functional and FunctionalJavascript tests on Gitlab CI.

parent bcefda8b
Pipeline #202486855 failed with stages
in 3 minutes and 14 seconds
......@@ -15,6 +15,7 @@ cache:
- app/
- conf/
- vendor/
- www/
- .env
# Build sources once and for all jobs and stages.
......@@ -111,7 +112,27 @@ build dev:
'Tests: PHPUnit':
stage: tests
variables:
# https://docs.gitlab.com/runner/executors/docker.html#network-per-build
FF_NETWORK_PER_BUILD: 1
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: drupal
MYSQL_USER: drupal
MYSQL_PASSWORD: drupal
SIMPLETEST_BASE_URL: http://127.0.0.1:8888
services:
- name: mariadb:10.5
alias: mysql
- name: drupalci/webdriver-chromedriver:production
alias: chrome
entrypoint:
- chromedriver
- "--no-sandbox"
- "--log-path=/tmp/chromedriver.log"
- "--verbose"
- "--whitelisted-ips="
script:
- cd ./www && php -S 0.0.0.0:8888 .ht.router.php >> webserver.log 2>&1 &
- ./scripts/tests/run-tests-phpunit.sh
workflow:
......
......@@ -94,7 +94,6 @@
},
"drupal-scaffold": {
"file-mapping": {
"[web-root]/.ht.router.php": false,
"[web-root]/example.gitignore": false,
"[web-root]/INSTALL.txt": false,
"[web-root]/README.txt": false,
......
......@@ -8,5 +8,5 @@
. "$(dirname "${BASH_SOURCE[0]}")"/script-parameters.sh
echo -e "${COLOR_LIGHT_GREEN}No more permissions problem!${COLOR_NC}"
chmod 777 -R "${APP_PATH}"
chmod 777 -R /tmp/*
chmod 0777 -R "${APP_PATH}"
chmod 0777 -R /tmp/*
......@@ -17,11 +17,12 @@
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
<!-- Example SIMPLETEST_BASE_URL value: http://localhost -->
<env name="SIMPLETEST_BASE_URL" value="http://web"/>
<env name="SIMPLETEST_BASE_URL" value="http://127.0.0.1"/>
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix -->
<env name="SIMPLETEST_DB" value="sqlite://localhost/:memory:"/>
<!-- <env name="SIMPLETEST_DB" value="sqlite://localhost/:memory:"/>-->
<env name="SIMPLETEST_DB" value="mysql://drupal:drupal@mysql/drupal"/>
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output -->
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/project/app/sites/default/files/simpletest"/>
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/tmp"/>
<!-- To have browsertest output use an alternative base URL. For example if
SIMPLETEST_BASE_URL is an internal DDEV URL, you can set this to the
external DDev URL so you can follow the links directly.
......
......@@ -5,6 +5,12 @@
ERROR=''
echo -e "${COLOR_LIGHT_GREEN}Create the folder sites/simpletest.${COLOR_NC}"
mkdir -p "${APP_PATH}"/sites/simpletest
echo -e "${COLOR_LIGHT_GREEN}Give permissions to webserver user on sites/simpletest.${COLOR_NC}"
chmod 0777 -R "${APP_PATH}"/sites/simpletest
echo -e "${COLOR_LIGHT_GREEN}Workaround for drupal-composer/drupal-paranoia make symlink to sites/simpletest.${COLOR_NC}"
rm -rf "${WWW_PATH}"/sites/simpletest
ln -s "${APP_PATH}"/sites/simpletest "${WWW_PATH}"/sites/simpletest
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment