From d2a670ec685e1bb024aca5ba5dda394d04929214 Mon Sep 17 00:00:00 2001 From: Matteo Scaramuccia Date: Wed, 10 Jun 2020 22:44:07 +0200 Subject: [PATCH] MDL-66322 travis: Configure a local copy of 'exttests' --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4747a9c2eaf..5296bcbb33a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,9 @@ language: php dist: trusty +services: + - docker + php: # We only run the highest and lowest supported versions to reduce the load on travis-ci.org. - 7.2 @@ -72,6 +75,9 @@ cache: - $HOME/.composer/cache - $HOME/.npm +before_install: + - docker run -d -p 127.0.0.1:8080:80 --name exttests moodlehq/moodle-exttests + install: - > if [ "$DB" = 'mysqli' ]; @@ -181,6 +187,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 ; # Initialise PHPUnit for Moodle. php admin/tool/phpunit/cli/init.php @@ -251,6 +261,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 - >