Skip to content
This repository was archived by the owner on Apr 17, 2024. It is now read-only.

Commit 629653b

Browse files
authored
fix: use MySQL to install the site for the tests (#349)
1 parent 7ecbec8 commit 629653b

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.travis.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@ php: 7.2
33
cache:
44
directories:
55
- "$HOME/.composer/cache/files"
6+
7+
services:
8+
- mysql
9+
610
env:
711
global:
812
- PROJECT_NAME=contentacms
913
- PROJECT_BASE_PATH=$HOME/$PROJECT_NAME
1014
- PROJECT_RELEASE_BRANCH=${PROJECT_RELEASE_BRANCH:-8.x-3.x}
1115
- SIMPLETEST_BASE_URL=http://127.0.0.1:8888
12-
- SIMPLETEST_DB=sqlite://tmp/site.sqlite
16+
- DB_NAME=drupal8_${TRAVIS_BUILD_NUMBER}
17+
- SIMPLETEST_DB=mysql://[email protected]/drupal8_${TRAVIS_BUILD_NUMBER}
1318

1419
branches:
1520
only:
@@ -24,18 +29,25 @@ jobs:
2429
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
2530
# Fix failing tests due to email sending.
2631
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
32+
- composer selfupdate
2733
- mkdir $PROJECT_BASE_PATH
34+
- mysql -e "CREATE DATABASE IF NOT EXISTS $DB_NAME;"
2835
install: composer run-script install-contenta $PROJECT_BASE_PATH --timeout=0
2936
before_script:
3037
# Start Contenta CMS Local Server
3138
- composer run-script start-contenta $PROJECT_BASE_PATH --timeout=0 &
3239
- until curl -sS $SIMPLETEST_BASE_URL; do sleep 1; done > /dev/null
3340
- echo "Connected to the test server at ${SIMPLETEST_BASE_URL}"
3441
script: composer run-script ci:helper run_functional_tests "$PROJECT_BASE_PATH" --timeout=0
35-
after_script: killall php
42+
after_script:
43+
- mysql -e "DROP DATABASE $DB_NAME;"
44+
- mysql -e "SHOW DATABASES;"
45+
- killall php
3646

3747
-
3848
stage: release
49+
before_install:
50+
- composer selfupdate
3951
install: composer run-script install-contenta $PROJECT_BASE_PATH --timeout=0
4052
before_script: skip
4153
script: skip

scripts/development/build-contenta_jsonapi.sh

-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ echo "-----------------------------------------------"
6464
echo " Installing Contenta CMS for local usage "
6565
echo "-----------------------------------------------"
6666
echo -e "${FG_C}${BG_C} EXECUTING ${NO_C} $DRUSH site-install --verbose --yes --db-url=$SIMPLETEST_DB --site-mail=admin@localhost --account-mail=admin@localhost --site-name='Contenta CMS Demo' --account-name=admin --account-pass=admin\n\n"
67-
# There is a problem installing from CLI. Drush can't locate some required services. Reinstalling a
68-
# second time usually does the trick.
69-
# TODO: We need to fix this.
70-
$DRUSH site-install --verbose --yes --db-url=$SIMPLETEST_DB --site-mail=admin@localhost --account-mail=admin@localhost --site-name='Contenta CMS Demo' --account-name=admin --account-pass=admin;
7167
$DRUSH site-install --verbose --yes --db-url=$SIMPLETEST_DB --site-mail=admin@localhost --account-mail=admin@localhost --site-name='Contenta CMS Demo' --account-name=admin --account-pass=admin;
7268

7369
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)