Skip to content

travis-ci : run integration test in parallel #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 53 additions & 43 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ env:
services:
- mysql



before_install:
- cat /etc/hosts

Expand All @@ -57,52 +59,55 @@ before_script:
- cd ${NGX_SRC} && ./configure --with-http_v2_module --with-select_module --with-http_ssl_module --with-ipv6 --with-http_geoip_module --with-http_auth_request_module --with-debug --add-module=${NC_PJ_HOME}/src/c --with-http_stub_status_module --prefix= --sbin-path=nginx --conf-path=conf/nginx.conf --error-log-path=logs/error.log --http-log-path=logs/access.log --pid-path=logs/nginx.pid --lock-path=logs/nginx.lock --http-client-body-temp-path=temp/client_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --http-scgi-temp-path=temp/scgi_temp
- make
- cp objs/nginx ${NC_PJ_HOME}/test/nginx-working-dir

script:
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- mkdir logs temp temp/client_temp temp/fastcgi_temp temp/proxy_temp temp/scgi_temp temp/uwsgi_temp
- cd /home/who/git/nginx-clojure/
- mkdir bin
- lein with-profile +cljremotetest classpath
- lein with-profile +cljremotetest classpath
- lein install
- echo "******************************* Start Junit Test**********************************"
- lein with-profile unittest junit
- echo "******************************* Start Intergration Test (Plain Mode ) ************"
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- mkdir logs temp temp/client_temp temp/fastcgi_temp temp/proxy_temp temp/scgi_temp temp/uwsgi_temp
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf &
# - sudo iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
# - sudo iptables -A INPUT -p tcp --dport 8081 -j ACCEPT
# - sudo iptables -A INPUT -p tcp --dport 8082 -j ACCEPT
# - sudo iptables -A INPUT -p tcp --dport 8181 -j ACCEPT
# - sudo iptables -A INPUT -p tcp --dport 8999 -j ACCEPT
# - sudo iptables --list
# - tail -f logs/error.log
- sleep 10
- tail logs/error.log
- curl -v http://localhost:8080/clojure
- cd /home/who/git/nginx-clojure/
- lein with-profile cljremotetest test :all
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf -s stop
- sleep 10
- echo "******************************* Start Intergration Test (Thread Pool Mode ) ************"
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf &
- sleep 10
- tail logs/error.log
- curl -v http://localhost:8080/clojure
- cd /home/who/git/nginx-clojure/
- lein with-profile cljremotetest test :no-async
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf -s stop
- sleep 10
- echo "******************************* Start Intergration Test (Coroutine Mode ) ************"
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf &
- sleep 30
- tail logs/error.log
- curl -v http://localhost:8080/clojure
- cd /home/who/git/nginx-clojure/
- lein with-profile cljremotetest test :all
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf -s stop
- lein with-profile unittest junit compile

jobs:
include:
- stage: unit test
script:
- lein with-profile unittest junit
- stage: integration test
script:
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf &
- sleep 10
- tail -f logs/error.log &
- curl -v http://localhost:8080/clojure
- killall tail
- cd /home/who/git/nginx-clojure/
- lein with-profile cljremotetest test :all
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf -s stop
- # stage name not required, will continue to use `integration test`
script:
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf &
- sleep 10
- tail -f logs/error.log &
- curl -v http://localhost:8080/clojure
- killall tail
- cd /home/who/git/nginx-clojure/
- lein with-profile cljremotetest test :no-async
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf -s stop
- # stage name not required, will continue to use `integration test`
script:
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf &
- sleep 30
- tail -f logs/error.log &
- curl -v http://localhost:8080/clojure
- killall tail
- cd /home/who/git/nginx-clojure/
- lein with-profile cljremotetest test :all
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf -s stop

after_failure:
- echo "******************************** Test Failed (Start of Nginx error.log)*****************"
Expand All @@ -111,3 +116,8 @@ after_failure:

notifications:
email: false

branches:
only:
- master
- stable
1 change: 1 addition & 0 deletions nginx-clojure-embed/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
/res
/ngx-memoryleak
/.lein-failures
/pom.xml.asc