Skip to content

Commit 5528260

Browse files
committed
Check logs for errors when running tests.
Change-Id: I80f520c9c6371fef2428e63fcde9e84e1b6005e5 Signed-off-by: Piotr Sikora <[email protected]>
1 parent 0126124 commit 5528260

File tree

2 files changed

+65
-23
lines changed

2 files changed

+65
-23
lines changed

t/proxy.t

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use Test::Nginx::Socket;
55

66
repeat_each(1);
77

8-
plan tests => repeat_each() * (blocks() * 3 + 3 * 1);
8+
plan tests => repeat_each() * (blocks() * 4 + 3 * 1);
99

1010
our $http_config = <<'_EOC_';
1111
proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m;
@@ -48,7 +48,9 @@ GET /proxy/passwd
4848
Content-Type: text/plain
4949
--- response_body_like: root
5050
--- timeout: 10
51-
--- skip_nginx2: 3: < 0.8.3 or < 0.7.62
51+
--- no_error_log eval
52+
qr/\[(warn|error|crit|alert|emerg)\]/
53+
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
5254
5355
5456
@@ -63,7 +65,9 @@ Content-Type: text/plain
6365
X-Cache-Status: HIT
6466
--- response_body_like: root
6567
--- timeout: 10
66-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
68+
--- no_error_log eval
69+
qr/\[(warn|error|crit|alert|emerg)\]/
70+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
6771
6872
6973
@@ -77,7 +81,9 @@ PURGE /purge/proxy/passwd
7781
Content-Type: text/html
7882
--- response_body_like: Successful purge
7983
--- timeout: 10
80-
--- skip_nginx2: 3: < 0.8.3 or < 0.7.62
84+
--- no_error_log eval
85+
qr/\[(warn|error|crit|alert|emerg)\]/
86+
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
8187
8288
8389
@@ -91,7 +97,9 @@ PURGE /purge/proxy/passwd
9197
Content-Type: text/html
9298
--- response_body_like: 404 Not Found
9399
--- timeout: 10
94-
--- skip_nginx2: 3: < 0.8.3 or < 0.7.62
100+
--- no_error_log eval
101+
qr/\[(warn|error|crit|alert|emerg)\]/
102+
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
95103
96104
97105
@@ -106,7 +114,9 @@ Content-Type: text/plain
106114
X-Cache-Status: MISS
107115
--- response_body_like: root
108116
--- timeout: 10
109-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
117+
--- no_error_log eval
118+
qr/\[(warn|error|crit|alert|emerg)\]/
119+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
110120
111121
112122
@@ -121,4 +131,6 @@ Content-Type: text/plain
121131
X-Cache-Status: HIT
122132
--- response_body_like: root
123133
--- timeout: 10
124-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
134+
--- no_error_log eval
135+
qr/\[(warn|error|crit|alert|emerg)\]/
136+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62

t/proxy2.t

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use Test::Nginx::Socket;
55

66
repeat_each(1);
77

8-
plan tests => repeat_each() * (blocks() * 3 + 6 * 1);
8+
plan tests => repeat_each() * (blocks() * 4 + 6 * 1);
99

1010
our $http_config = <<'_EOC_';
1111
proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m;
@@ -80,7 +80,9 @@ GET /proxy/passwd
8080
Content-Type: text/plain
8181
--- response_body_like: root
8282
--- timeout: 10
83-
--- skip_nginx2: 3: < 0.8.3 or < 0.7.62
83+
--- no_error_log eval
84+
qr/\[(warn|error|crit|alert|emerg)\]/
85+
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
8486
8587
8688
@@ -95,7 +97,9 @@ Content-Type: text/plain
9597
X-Cache-Status: HIT
9698
--- response_body_like: root
9799
--- timeout: 10
98-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
100+
--- no_error_log eval
101+
qr/\[(warn|error|crit|alert|emerg)\]/
102+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
99103
100104
101105
@@ -109,7 +113,9 @@ PURGE /proxy/passwd
109113
Content-Type: text/html
110114
--- response_body_like: Successful purge
111115
--- timeout: 10
112-
--- skip_nginx2: 3: < 0.8.3 or < 0.7.62
116+
--- no_error_log eval
117+
qr/\[(warn|error|crit|alert|emerg)\]/
118+
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
113119
114120
115121
@@ -123,7 +129,9 @@ PURGE /proxy/passwd
123129
Content-Type: text/html
124130
--- response_body_like: 404 Not Found
125131
--- timeout: 10
126-
--- skip_nginx2: 3: < 0.8.3 or < 0.7.62
132+
--- no_error_log eval
133+
qr/\[(warn|error|crit|alert|emerg)\]/
134+
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
127135
128136
129137
@@ -138,7 +146,9 @@ Content-Type: text/plain
138146
X-Cache-Status: MISS
139147
--- response_body_like: root
140148
--- timeout: 10
141-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
149+
--- no_error_log eval
150+
qr/\[(warn|error|crit|alert|emerg)\]/
151+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
142152
143153
144154
@@ -153,7 +163,9 @@ Content-Type: text/plain
153163
X-Cache-Status: HIT
154164
--- response_body_like: root
155165
--- timeout: 10
156-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
166+
--- no_error_log eval
167+
qr/\[(warn|error|crit|alert|emerg)\]/
168+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
157169
158170
159171
@@ -167,7 +179,9 @@ PURGE /proxy/passwd
167179
Content-Type: text/html
168180
--- response_body_like: Successful purge
169181
--- timeout: 10
170-
--- skip_nginx2: 3: < 0.8.3 or < 0.7.62
182+
--- no_error_log eval
183+
qr/\[(warn|error|crit|alert|emerg)\]/
184+
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
171185
172186
173187
@@ -181,7 +195,9 @@ PURGE /proxy/passwd
181195
Content-Type: text/html
182196
--- response_body_like: 404 Not Found
183197
--- timeout: 10
184-
--- skip_nginx2: 3: < 0.8.3 or < 0.7.62
198+
--- no_error_log eval
199+
qr/\[(warn|error|crit|alert|emerg)\]/
200+
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
185201
186202
187203
@@ -196,7 +212,9 @@ Content-Type: text/plain
196212
X-Cache-Status: MISS
197213
--- response_body_like: root
198214
--- timeout: 10
199-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
215+
--- no_error_log eval
216+
qr/\[(warn|error|crit|alert|emerg)\]/
217+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
200218
201219
202220
@@ -211,7 +229,9 @@ Content-Type: text/plain
211229
X-Cache-Status: HIT
212230
--- response_body_like: root
213231
--- timeout: 10
214-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
232+
--- no_error_log eval
233+
qr/\[(warn|error|crit|alert|emerg)\]/
234+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
215235
216236
217237
@@ -225,7 +245,9 @@ PURGE /proxy/passwd
225245
Content-Type: text/html
226246
--- response_body_like: 403 Forbidden
227247
--- timeout: 10
228-
--- skip_nginx2: 3: < 0.8.3 or < 0.7.62
248+
--- no_error_log eval
249+
qr/\[(warn|error|crit|alert|emerg)\]/
250+
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
229251
230252
231253
@@ -240,7 +262,9 @@ Content-Type: text/plain
240262
X-Cache-Status: HIT
241263
--- response_body_like: root
242264
--- timeout: 10
243-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
265+
--- no_error_log eval
266+
qr/\[(warn|error|crit|alert|emerg)\]/
267+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
244268
245269
246270
@@ -263,7 +287,9 @@ PURGE /proxy/passwd
263287
Content-Type: text/html
264288
--- response_body_like: 404 Not Found
265289
--- timeout: 10
266-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
290+
--- no_error_log eval
291+
qr/\[(warn|error|crit|alert|emerg)\]/
292+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
267293
268294
269295
@@ -286,7 +312,9 @@ PURGE /proxy/passwd
286312
Content-Type: text/html
287313
--- response_body_like: 403 Forbidden
288314
--- timeout: 10
289-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
315+
--- no_error_log eval
316+
qr/\[(warn|error|crit|alert|emerg)\]/
317+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62
290318
291319
292320
@@ -316,4 +344,6 @@ PURGE /proxy/passwd
316344
Content-Type: text/html
317345
--- response_body_like: Successful purge
318346
--- timeout: 10
319-
--- skip_nginx2: 4: < 0.8.3 or < 0.7.62
347+
--- no_error_log eval
348+
qr/\[(warn|error|crit|alert|emerg)\]/
349+
--- skip_nginx2: 5: < 0.8.3 or < 0.7.62

0 commit comments

Comments
 (0)