Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
Florent Torregrosa Drupal
Docker Drupal Project
Commits
08173a4a
Commit
08173a4a
authored
Oct 14, 2020
by
Florent Torregrosa
🤘
Browse files
Tools: allows to execute Functional and FunctionalJavascript tests on Gitlab CI.
parent
bcefda8b
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
08173a4a
...
...
@@ -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
:
...
...
composer.json
View file @
08173a4a
...
...
@@ -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
,
...
...
scripts/fix-permissions-dev.sh
View file @
08173a4a
...
...
@@ -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
0
777
-R
"
${
APP_PATH
}
"
chmod
0
777
-R
/tmp/
*
scripts/tests/phpunit.xml.dist
View file @
08173a4a
...
...
@@ -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.
...
...
scripts/tests/run-tests-phpunit.sh
View file @
08173a4a
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment