Skip to content

Commit

Permalink
Merge branch 'm37_MDL-66322_Travis_Run_Using_Docker_ExtTests' of http…
Browse files Browse the repository at this point in the history
…s://github.com/scara/moodle into MOODLE_37_STABLE
  • Loading branch information
andrewnicols committed Jul 8, 2020
2 parents 07ade46 + a4d4a0b commit 84388a2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .travis.yml
Expand Up @@ -15,6 +15,7 @@ dist: xenial

services:
- mysql
- docker

php:
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
Expand Down Expand Up @@ -61,8 +62,9 @@ cache:
- $HOME/.npm

before_install:
- docker run -d -p 127.0.0.1:8080:80 --name exttests moodlehq/moodle-exttests
# Avoid IPv6 default binding as service (causes redis not to start).
sudo service redis-server start --bind 127.0.0.1
- sudo service redis-server start --bind 127.0.0.1

install:
- >
Expand Down Expand Up @@ -169,6 +171,10 @@ before_script:
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
config.php ;
# Enable test external resources
sed -i \
-e "/require_once/i \\define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://127.0.0.1:8080');" \
config.php ;
# Redis cache store tests
sed -i \
-e "/require_once/i \\define('TEST_CACHESTORE_REDIS_TESTSERVERS', '127.0.0.1');" \
Expand Down Expand Up @@ -248,6 +254,8 @@ script:
if [ "$TASK" = 'PHPUNIT' ];
then
vendor/bin/phpunit --fail-on-risky --disallow-test-output --verbose;
EXTTESTS_HITS=$(docker logs exttests 2>&1 | grep -Fv -e 'AH00558' -e '[pid 1]' | wc -l)
echo -e "\nTest local resources number of hits: ${EXTTESTS_HITS}.\n"
fi
- >
Expand Down

0 comments on commit 84388a2

Please sign in to comment.