Skip to content

Commit b727a54

Browse files
authored
travis-ci : run integration test in parallel (#229)
* ci:use travis-ci job stages * ci: make integration test run in parallel * ci: fix stage name * ci: compile test classes before test
1 parent a9e053f commit b727a54

File tree

2 files changed

+54
-43
lines changed

2 files changed

+54
-43
lines changed

.travis.yml

Lines changed: 53 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ env:
3535
services:
3636
- mysql
3737

38+
39+
3840
before_install:
3941
- cat /etc/hosts
4042

@@ -57,52 +59,55 @@ before_script:
5759
- 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
5860
- make
5961
- cp objs/nginx ${NC_PJ_HOME}/test/nginx-working-dir
60-
61-
script:
62+
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
63+
- mkdir logs temp temp/client_temp temp/fastcgi_temp temp/proxy_temp temp/scgi_temp temp/uwsgi_temp
6264
- cd /home/who/git/nginx-clojure/
6365
- mkdir bin
64-
- lein with-profile +cljremotetest classpath
66+
- lein with-profile +cljremotetest classpath
6567
- lein install
66-
- echo "******************************* Start Junit Test**********************************"
67-
- lein with-profile unittest junit
68-
- echo "******************************* Start Intergration Test (Plain Mode ) ************"
69-
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
70-
- mkdir logs temp temp/client_temp temp/fastcgi_temp temp/proxy_temp temp/scgi_temp temp/uwsgi_temp
71-
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf &
72-
# - sudo iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
73-
# - sudo iptables -A INPUT -p tcp --dport 8081 -j ACCEPT
74-
# - sudo iptables -A INPUT -p tcp --dport 8082 -j ACCEPT
75-
# - sudo iptables -A INPUT -p tcp --dport 8181 -j ACCEPT
76-
# - sudo iptables -A INPUT -p tcp --dport 8999 -j ACCEPT
77-
# - sudo iptables --list
78-
# - tail -f logs/error.log
79-
- sleep 10
80-
- tail logs/error.log
81-
- curl -v http://localhost:8080/clojure
82-
- cd /home/who/git/nginx-clojure/
83-
- lein with-profile cljremotetest test :all
84-
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
85-
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf -s stop
86-
- sleep 10
87-
- echo "******************************* Start Intergration Test (Thread Pool Mode ) ************"
88-
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf &
89-
- sleep 10
90-
- tail logs/error.log
91-
- curl -v http://localhost:8080/clojure
92-
- cd /home/who/git/nginx-clojure/
93-
- lein with-profile cljremotetest test :no-async
94-
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
95-
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf -s stop
96-
- sleep 10
97-
- echo "******************************* Start Intergration Test (Coroutine Mode ) ************"
98-
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf &
99-
- sleep 30
100-
- tail logs/error.log
101-
- curl -v http://localhost:8080/clojure
102-
- cd /home/who/git/nginx-clojure/
103-
- lein with-profile cljremotetest test :all
104-
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
105-
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf -s stop
68+
- lein with-profile unittest junit compile
69+
70+
jobs:
71+
include:
72+
- stage: unit test
73+
script:
74+
- lein with-profile unittest junit
75+
- stage: integration test
76+
script:
77+
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
78+
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf &
79+
- sleep 10
80+
- tail -f logs/error.log &
81+
- curl -v http://localhost:8080/clojure
82+
- killall tail
83+
- cd /home/who/git/nginx-clojure/
84+
- lein with-profile cljremotetest test :all
85+
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
86+
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf -s stop
87+
- # stage name not required, will continue to use `integration test`
88+
script:
89+
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
90+
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf &
91+
- sleep 10
92+
- tail -f logs/error.log &
93+
- curl -v http://localhost:8080/clojure
94+
- killall tail
95+
- cd /home/who/git/nginx-clojure/
96+
- lein with-profile cljremotetest test :no-async
97+
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
98+
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf -s stop
99+
- # stage name not required, will continue to use `integration test`
100+
script:
101+
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
102+
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf &
103+
- sleep 30
104+
- tail -f logs/error.log &
105+
- curl -v http://localhost:8080/clojure
106+
- killall tail
107+
- cd /home/who/git/nginx-clojure/
108+
- lein with-profile cljremotetest test :all
109+
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
110+
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf -s stop
106111

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

112117
notifications:
113118
email: false
119+
120+
branches:
121+
only:
122+
- master
123+
- stable

nginx-clojure-embed/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
/res
1212
/ngx-memoryleak
1313
/.lein-failures
14+
/pom.xml.asc

0 commit comments

Comments
 (0)