-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
44 lines (44 loc) · 2.16 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
language: php
php:
- "5.4"
env:
- DB=mysqli MOODLE_VERSION=MOODLE_28_STABLE
- DB=pgsql MOODLE_VERSION=MOODLE_28_STABLE
before_script:
- git clone -b $MOODLE_VERSION git://github.com/moodle/moodle ../moodle && cd ../moodle
- mv ../moodle-mod-testingdemo mod/testingdemo
- echo '<?php unset($CFG); global $CFG; $CFG = new stdClass;' > config.php
- echo "\$CFG->dbtype = '$DB';" >> config.php
- echo "\$CFG->dblibrary = 'native';" >> config.php
- echo "\$CFG->dbhost = 'localhost';" >> config.php
- echo "\$CFG->dbname = 'moodle';" >> config.php
- if [ "$DB" = 'pgsql' ]; then echo "\$CFG->dbuser = 'postgres';" >> config.php; fi
- if [ "$DB" = 'mysqli' ]; then echo "\$CFG->dbuser = 'root';" >> config.php; fi
- echo "\$CFG->dbpass = '';" >> config.php
- echo "\$CFG->prefix = 'mdl_';" >> config.php
- echo '$CFG->dboptions = array();' >> config.php
- echo "\$CFG->wwwroot = 'http://localhost';" >> config.php
- echo "\$CFG->dataroot = '$HOME/moodledata';" >> config.php
- echo "\$CFG->phpunit_prefix = 'phpu_';" >> config.php
- echo "\$CFG->phpunit_dataroot = '$HOME/phpu_moodledata';" >> config.php
- echo "\$CFG->behat_prefix = 'b_';" >> config.php
- echo "\$CFG->behat_dataroot = '$HOME/bht_moodledata';" >> config.php
- echo "\$CFG->behat_wwwroot = 'http://localhost:8000';" >> config.php
- echo "require_once(dirname(__FILE__) . '/lib/setup.php');" >> config.php
- cat config.php
- psql -c 'create database moodle;' -U postgres
- mysql -e 'create database moodle default character set UTF8 collate utf8_unicode_ci;'
- mkdir -m777 $HOME/moodledata $HOME/phpu_moodledata $HOME/bht_moodledata
- composer self-update
- composer install --dev --prefer-dist
- wget http://selenium-release.storage.googleapis.com/2.43/selenium-server-standalone-2.43.1.jar
- php admin/tool/phpunit/cli/init.php
- php admin/tool/behat/cli/init.php
- php -S localhost:8000 2>/dev/null >/dev/null &
- java -jar selenium-server-standalone-2.43.1.jar 2>/dev/null >/dev/null &
script:
- vendor/bin/phpunit --group mod_testingdemo
- vendor/bin/behat --config $HOME/bht_moodledata/behat/behat.yml --tags @mod_testingdemo