From: gggeek Date: Thu, 19 Mar 2015 23:38:53 +0000 (+0000) Subject: Add proxy setup for travis tests X-Git-Tag: 4.0.0-alpha^2~166 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=cd480e485efe208c24df5e835c550d601ed4d3f0;p=plcapi.git Add proxy setup for travis tests --- diff --git a/.travis.yml b/.travis.yml index a41255c6..8f125db4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,12 +20,13 @@ before_script: - if [ $TRAVIS_PHP_VERSION != "hhvm" -a $TRAVIS_PHP_VERSION != "7.0" ]; then phpenv config-rm xdebug.ini; fi # We set up an Apache instance inside the Travis VM and test it. - - sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then ./tests/ci/travis/install_apache.sh; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = 'hhvm' ]; then ./tests/ci/travis/install_apache_hhvm.sh; fi" + - if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then ./tests/ci/travis/install_apache.sh; fi + - if [ '$TRAVIS_PHP_VERSION' = 'hhvm' ]; then ./tests/ci/travis/install_apache_hhvm.sh; fi + - ./tests/ci/travis/install_nginx.sh script: # to have code coverage: --coverage-clover=coverage.clover - phpunit tests LOCALSERVER=localhost URI=/demo/server/server.php HTTPSSERVER=gggeek.ssl.altervista.org HTTPSURI=/sw/xmlrpc/demo/server/server.php NOPROXY=1 DEBUG=1 + phpunit tests LOCALSERVER=localhost URI=/demo/server/server.php HTTPSSERVER=gggeek.ssl.altervista.org HTTPSURI=/sw/xmlrpc/demo/server/server.php PROXY=localhost:8080 DEBUG=1 #after_script: # # upload code-coverage to Scrutinizer diff --git a/tests/ci/travis/install_nginx.sh b/tests/ci/travis/install_nginx.sh new file mode 100644 index 00000000..c64ac205 --- /dev/null +++ b/tests/ci/travis/install_nginx.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# enable nginx (to serve as proxy) + +apt-get install nginx +sudo cp -f tests/ci/nginx.conf /etc/nginx/nginx.conf +sudo service nginx restart diff --git a/tests/ci/travis/nginx.conf b/tests/ci/travis/nginx.conf new file mode 100644 index 00000000..7b63ccf8 --- /dev/null +++ b/tests/ci/travis/nginx.conf @@ -0,0 +1,21 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + #include mime.types; + #default_type application/octet-stream; + gzip on; + + server { + listen 8080; + location / { + proxy_pass http://localhost; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_redirect off; + } + } +} \ No newline at end of file