health_check 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +79 -14
- data/CHANGELOG +5 -0
- data/README.rdoc +15 -7
- data/lib/health_check/health_check_routes.rb +2 -1
- data/lib/health_check/middleware_health_check.rb +14 -21
- data/lib/health_check/version.rb +1 -1
- data/test/setup_railsapp +49 -1
- data/test/test_with_railsapp +60 -2
- metadata +19 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 80358069f525f51e0fc2751abe438c1d724fb3a0
|
4
|
+
data.tar.gz: 37280de5cb5c4ef5b713069321d5ad82fb0aa0ed
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b5381bdf60fa524ca2bdd072655b83e036938b0a4d325183af6431366b77f34121b8b12ace9e7404e921248a84fc347caf549208b8062001ad10f38916ff127a
|
7
|
+
data.tar.gz: 82da4951b07dd4e420c570a9469ff722fa2c726b5f9d9f2961df4830abbe02e71085c18dda5449d0c0f800f3f43d029d781a05bd28d30ededef039b4059264e5
|
data/.travis.yml
CHANGED
@@ -23,45 +23,110 @@ bundler_args: "--binstubs"
|
|
23
23
|
script: ./test/test_with_railsapp
|
24
24
|
|
25
25
|
matrix:
|
26
|
+
fast_finish: true
|
27
|
+
|
26
28
|
allow_failures:
|
27
29
|
- rvm: 2.3.1
|
28
30
|
gemfile: test/rails_edge.gemfile
|
29
|
-
env: RAILS_VERSION=edge
|
31
|
+
env: RAILS_VERSION=edge MIDDLEWARE=YES
|
30
32
|
|
31
33
|
- rvm: ruby-head
|
32
34
|
gemfile: test/rails_5.0.gemfile
|
33
|
-
env: RAILS_VERSION=5.0
|
35
|
+
env: RAILS_VERSION=5.0 MIDDLEWARE=YES
|
34
36
|
|
35
37
|
include:
|
38
|
+
# -------------------------------------
|
39
|
+
# Standard
|
40
|
+
|
41
|
+
# ruby 5.0 Jun. 2016
|
42
|
+
|
43
|
+
- rvm: 2.3.1
|
44
|
+
gemfile: test/rails_5.0.gemfile
|
45
|
+
env: RAILS_VERSION=5.0 MIDDLEWARE=no
|
46
|
+
|
47
|
+
- rvm: 2.2.2
|
48
|
+
gemfile: test/rails_5.0.gemfile
|
49
|
+
env: RAILS_VERSION=5.0 MIDDLEWARE=no
|
50
|
+
|
51
|
+
# rails 4.2 Dec, 2014
|
52
|
+
|
53
|
+
- rvm: 2.2.0
|
54
|
+
gemfile: test/rails_4.2.gemfile
|
55
|
+
env: RAILS_VERSION=4.2 MIDDLEWARE=no
|
56
|
+
|
57
|
+
- rvm: 2.1.2
|
58
|
+
gemfile: test/rails_4.2.gemfile
|
59
|
+
env: RAILS_SERVER=puma RAILS_VERSION=4.2 MIDDLEWARE=no
|
60
|
+
|
61
|
+
# Can't find i18n?? because it can't compile?
|
62
|
+
#- rvm: 2.1.2
|
63
|
+
# gemfile: test/rails_4.2.gemfile
|
64
|
+
# env: RAILS_SERVER=passenger RAILS_VERSION=4.2
|
65
|
+
|
66
|
+
- rvm: 2.1.2
|
67
|
+
gemfile: test/rails_4.2.gemfile
|
68
|
+
env: RAILS_SERVER=thin RAILS_VERSION=4.2 MIDDLEWARE=no
|
69
|
+
|
70
|
+
# No longer supported by travis
|
71
|
+
#- rvm: rbx-2.2.6
|
72
|
+
# gemfile: test/rails_4.0.gemfile
|
73
|
+
# env: RAILS_ENV2=development RAILS_VERSION=4.0
|
74
|
+
|
75
|
+
- rvm: 2.1.2
|
76
|
+
gemfile: test/rails_4.2.gemfile
|
77
|
+
env: RAILS_SERVER=unicorn RAILS_VERSION=4.2 MIDDLEWARE=no
|
78
|
+
|
79
|
+
# Disabled because it takes way too long (40+ mins)
|
80
|
+
# Temporary version lock until Bundler >= 1.13.2
|
81
|
+
# https://github.com/bundler/bundler/issues/4975
|
82
|
+
#- rvm: jruby-19mode
|
83
|
+
# gemfile: test/rails_4.2.gemfile
|
84
|
+
# env: BUNDLER_VERSION=1.12.5 RAILS_VERSION=4.2
|
85
|
+
|
86
|
+
# rails 4.1 April 8, 2014
|
87
|
+
|
88
|
+
- rvm: 2.1.2
|
89
|
+
gemfile: test/rails_4.1.gemfile
|
90
|
+
env: RAILS_VERSION=4.1 MIDDLEWARE=no
|
91
|
+
|
92
|
+
# rails 4.0
|
93
|
+
|
94
|
+
- rvm: 1.9.3
|
95
|
+
gemfile: test/rails_4.0.gemfile
|
96
|
+
env: RAILS_VERSION=4.0 MIDDLEWARE=no
|
97
|
+
|
98
|
+
# -------------------------------------
|
99
|
+
# INSTALLED AS MIDDLEWARE
|
100
|
+
|
36
101
|
# ruby / rails edge
|
37
102
|
|
38
103
|
- rvm: 2.3.1
|
39
104
|
gemfile: test/rails_edge.gemfile
|
40
|
-
env: RAILS_VERSION=edge
|
105
|
+
env: RAILS_VERSION=edge MIDDLEWARE=YES
|
41
106
|
|
42
107
|
# ruby 5.0 Jun. 2016
|
43
108
|
|
44
109
|
- rvm: 2.3.1
|
45
110
|
gemfile: test/rails_5.0.gemfile
|
46
|
-
env: RAILS_VERSION=5.0
|
111
|
+
env: RAILS_VERSION=5.0 MIDDLEWARE=YES
|
47
112
|
|
48
113
|
- rvm: 2.2.2
|
49
114
|
gemfile: test/rails_5.0.gemfile
|
50
|
-
env: RAILS_VERSION=5.0
|
115
|
+
env: RAILS_VERSION=5.0 MIDDLEWARE=YES
|
51
116
|
|
52
117
|
- rvm: ruby-head
|
53
118
|
gemfile: test/rails_5.0.gemfile
|
54
|
-
env: RAILS_VERSION=5.0
|
119
|
+
env: RAILS_VERSION=5.0 MIDDLEWARE=YES
|
55
120
|
|
56
121
|
# rails 4.2 Dec, 2014
|
57
122
|
|
58
123
|
- rvm: 2.2.0
|
59
124
|
gemfile: test/rails_4.2.gemfile
|
60
|
-
env: RAILS_VERSION=4.2
|
125
|
+
env: RAILS_VERSION=4.2 MIDDLEWARE=YES
|
61
126
|
|
62
127
|
- rvm: 2.1.2
|
63
128
|
gemfile: test/rails_4.2.gemfile
|
64
|
-
env: RAILS_SERVER=puma RAILS_VERSION=4.2
|
129
|
+
env: RAILS_SERVER=puma RAILS_VERSION=4.2 MIDDLEWARE=YES
|
65
130
|
|
66
131
|
# Can't find i18n?? because it can't compile?
|
67
132
|
#- rvm: 2.1.2
|
@@ -70,33 +135,33 @@ matrix:
|
|
70
135
|
|
71
136
|
- rvm: 2.1.2
|
72
137
|
gemfile: test/rails_4.2.gemfile
|
73
|
-
env: RAILS_SERVER=thin RAILS_VERSION=4.2
|
138
|
+
env: RAILS_SERVER=thin RAILS_VERSION=4.2 MIDDLEWARE=YES
|
74
139
|
|
75
140
|
# No longer supported by travis
|
76
141
|
#- rvm: rbx-2.2.6
|
77
142
|
# gemfile: test/rails_4.0.gemfile
|
78
|
-
# env: RAILS_ENV2=development RAILS_VERSION=4.0
|
143
|
+
# env: RAILS_ENV2=development RAILS_VERSION=4.0 MIDDLEWARE=YES
|
79
144
|
|
80
145
|
- rvm: 2.1.2
|
81
146
|
gemfile: test/rails_4.2.gemfile
|
82
|
-
env: RAILS_SERVER=unicorn RAILS_VERSION=4.2
|
147
|
+
env: RAILS_SERVER=unicorn RAILS_VERSION=4.2 MIDDLEWARE=YES
|
83
148
|
|
84
149
|
# Disabled because it takes way too long (40+ mins)
|
85
150
|
# Temporary version lock until Bundler >= 1.13.2
|
86
151
|
# https://github.com/bundler/bundler/issues/4975
|
87
152
|
#- rvm: jruby-19mode
|
88
153
|
# gemfile: test/rails_4.2.gemfile
|
89
|
-
# env: BUNDLER_VERSION=1.12.5 RAILS_VERSION=4.2
|
154
|
+
# env: BUNDLER_VERSION=1.12.5 RAILS_VERSION=4.2 MIDDLEWARE=YES
|
90
155
|
|
91
156
|
# rails 4.1 April 8, 2014
|
92
157
|
|
93
158
|
- rvm: 2.1.2
|
94
159
|
gemfile: test/rails_4.1.gemfile
|
95
|
-
env: RAILS_VERSION=4.1
|
160
|
+
env: RAILS_VERSION=4.1 MIDDLEWARE=YES
|
96
161
|
|
97
162
|
# rails 4.0
|
98
163
|
|
99
164
|
- rvm: 1.9.3
|
100
165
|
gemfile: test/rails_4.0.gemfile
|
101
|
-
env: RAILS_VERSION=4.0
|
166
|
+
env: RAILS_VERSION=4.0 MIDDLEWARE=YES
|
102
167
|
|
data/CHANGELOG
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
= Change Log =
|
2
2
|
|
3
|
+
* 2.4.0
|
4
|
+
* Added tests for middleware
|
5
|
+
* Changed contributed middleware code to conform to existing url scheme
|
6
|
+
* Allow both GET and POST calls
|
7
|
+
* Prefer config.uri for changing route prefix
|
3
8
|
* 2.3.0
|
4
9
|
* Fix route reload issue
|
5
10
|
* Various fixes to get tests working with bundle/jruby and other gem issues
|
data/README.rdoc
CHANGED
@@ -24,7 +24,9 @@ health_check provides various monitoring URIs, for example:
|
|
24
24
|
<message>success</message>
|
25
25
|
</hash>
|
26
26
|
|
27
|
-
|
27
|
+
You may also issue POST calls instead of GET to these urls.
|
28
|
+
|
29
|
+
On failure (detected by health_check) a 500 http status is returned with a simple explanation of the failure
|
28
30
|
|
29
31
|
curl localhost:3000/health_check/fail
|
30
32
|
health_check failed: invalid argument to health_test.
|
@@ -74,6 +76,9 @@ To change the configuration of health_check, create a file `config/initializers/
|
|
74
76
|
|
75
77
|
HealthCheck.setup do |config|
|
76
78
|
|
79
|
+
# uri prefix
|
80
|
+
config.uri = 'health_check'
|
81
|
+
|
77
82
|
# Text output upon success
|
78
83
|
config.success = 'success'
|
79
84
|
|
@@ -126,14 +131,17 @@ You may call add_custom_check multiple times with different tests. These tests w
|
|
126
131
|
If you have a catchall route then add the following line above the catch all route (in `config/routes.rb`):
|
127
132
|
health_check_routes
|
128
133
|
|
129
|
-
To change the url prefix (eg to /ping), add the following line in `config/routes.rb`:
|
130
|
-
health_check_routes('ping')
|
131
|
-
|
132
134
|
=== Installing As Middleware
|
133
135
|
|
134
|
-
|
135
|
-
|
136
|
-
|
136
|
+
Install health_check as middleware if you want to ignore exceptions from later parts of the Rails middleware stack,
|
137
|
+
eg DB connection errors from QueryCache. Include "middleware" in the list of checks to have the checks processed by the middleware
|
138
|
+
health check rather than the full stack check. The "middleware" check will fail if you have not installed health_check as middleware.
|
139
|
+
|
140
|
+
To install health_check as middleware add the following line to the config/application.rb:
|
141
|
+
config.middleware.insert_after "Rails::Rack::Logger", HealthCheck::MiddlewareHealthcheck
|
142
|
+
|
143
|
+
Note: health_check is installed as a full rails engine even if it has been installed as middleware. This is so the
|
144
|
+
standard checks continue to test the complete rails stack.
|
137
145
|
|
138
146
|
== Uptime Monitoring
|
139
147
|
|
@@ -7,7 +7,8 @@ module ActionDispatch::Routing
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def add_health_check_routes(prefix = nil)
|
10
|
-
|
10
|
+
HealthCheck.uri = prefix if prefix
|
11
|
+
match "#{HealthCheck.uri}(/:checks)(.:format)", :to => 'health_check/health_check#index', via: [:get, :post]
|
11
12
|
end
|
12
13
|
|
13
14
|
end
|
@@ -7,38 +7,31 @@ module HealthCheck
|
|
7
7
|
|
8
8
|
def call(env)
|
9
9
|
uri = env['PATH_INFO']
|
10
|
-
if uri
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
if uri =~ /^\/?#{HealthCheck.uri}\/([-_0-9a-zA-Z]*)middleware_?([-_0-9a-zA-Z]*)(\.(\w*))?/
|
11
|
+
checks = $1 + ($1 != '' && $2 != '' ? '_' : '') + $2
|
12
|
+
checks = 'standard' if checks == ''
|
13
|
+
response_type = $4
|
14
14
|
begin
|
15
15
|
errors = HealthCheck::Utils.process_checks(checks)
|
16
16
|
rescue => e
|
17
17
|
errors = e.message.blank? ? e.class.to_s : e.message.to_s
|
18
18
|
end
|
19
|
-
|
20
|
-
|
19
|
+
healthy = errors.blank?
|
20
|
+
msg = healthy ? HealthCheck.success : "health_check failed: #{errors}"
|
21
|
+
if response_type == 'xml'
|
22
|
+
content_type = 'text/xml'
|
23
|
+
msg = { healthy: healthy, message: msg }.to_xml
|
24
|
+
elsif response_type == 'json'
|
25
|
+
content_type = 'application/json'
|
26
|
+
msg = { healthy: healthy, message: msg }.to_json
|
21
27
|
else
|
22
|
-
|
23
|
-
send(response_method, 500, msg, false)
|
28
|
+
content_type = 'text/plain'
|
24
29
|
end
|
30
|
+
[ (healthy ? 200 : 500), { 'Content-Type' => content_type }, [msg] ]
|
25
31
|
else
|
26
32
|
@app.call(env)
|
27
33
|
end
|
28
34
|
end
|
29
35
|
|
30
|
-
def response_json code, msg, healthy
|
31
|
-
obj = { healthy: healthy, message: msg }
|
32
|
-
[ code, { 'Content-Type' => 'application/json' }, [obj.to_json] ]
|
33
|
-
end
|
34
|
-
|
35
|
-
def response_xml code, msg, healthy
|
36
|
-
obj = { healthy: healthy, message: msg }
|
37
|
-
[ code, { 'Content-Type' => 'text/xml' }, [obj.to_xml] ]
|
38
|
-
end
|
39
|
-
|
40
|
-
def response_plain code, msg, healthy
|
41
|
-
[ code, { 'Content-Type' => 'text/plain' }, [msg] ]
|
42
|
-
end
|
43
36
|
end
|
44
37
|
end
|
data/lib/health_check/version.rb
CHANGED
data/test/setup_railsapp
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
+
route_prefix=medical_check
|
4
|
+
|
3
5
|
err_report() {
|
4
6
|
echo "$0: Error on line $1 - aborted"
|
5
7
|
exit 1
|
@@ -38,6 +40,11 @@ do
|
|
38
40
|
export BUNDLE_GEMFILE=$PWD/test/rails_$x.gemfile
|
39
41
|
done
|
40
42
|
|
43
|
+
if [ -z "$MIDDLEWARE" ]; then
|
44
|
+
echo -n "Add as middleware [N/y] : "
|
45
|
+
read MIDDLEWARE
|
46
|
+
export MIDDLEWARE
|
47
|
+
fi
|
41
48
|
rm -rf tmp/Gemfile* tmp/railsapp tmp/bin tmp/gems test/bin test/rails*.gemfile.lock
|
42
49
|
|
43
50
|
mkdir -p tmp/gems
|
@@ -160,6 +167,7 @@ HealthCheck.setup do |config|
|
|
160
167
|
config.smtp_timeout = 60.0
|
161
168
|
config.http_status_for_error_text = 550
|
162
169
|
config.http_status_for_error_object = 555
|
170
|
+
config.uri = '$route_prefix'
|
163
171
|
|
164
172
|
config.add_custom_check do
|
165
173
|
File.exists?("$custom_file") ? '' : '$custom_file is missing!'
|
@@ -354,6 +362,45 @@ end
|
|
354
362
|
|
355
363
|
EOF
|
356
364
|
|
365
|
+
echo =======================================
|
366
|
+
|
367
|
+
case "$MIDDLEWARE" in
|
368
|
+
[Yy]*)
|
369
|
+
if [ -s config/application.rb ]; then
|
370
|
+
mv -f config/application.rb config/application.rb-old
|
371
|
+
(
|
372
|
+
ruby -n -e 'print if not /^ *end/..9999' config/application.rb-old | tee /tmp/t$$
|
373
|
+
if [ ! -s /tmp/t$$ ]; then
|
374
|
+
echo "WARNING: ruby -n -e failed silently - using sed instead!! (rbx-19mode has that problem)" >&3
|
375
|
+
sed -e '/^ *end/,$d' config/application.rb-old
|
376
|
+
fi
|
377
|
+
|
378
|
+
echo " # -----------------------------------------"
|
379
|
+
echo " # START OF SECTION FOR TESTING HEALTH_CHECK"
|
380
|
+
echo " config.middleware.insert_after 'Rails::Rack::Logger', HealthCheck::MiddlewareHealthcheck"
|
381
|
+
echo " # END OF SECTION FOR TESTING HEALTH_CHECK"
|
382
|
+
echo " # ---------------------------------------"
|
383
|
+
ruby -n -e 'print if /^ *end/..9999' config/application.rb-old | tee /tmp/t$$
|
384
|
+
if [ ! -s /tmp/t$$ ]; then
|
385
|
+
echo "WARNING: ruby -n -e failed silently - using sed instead!! (rbx-19mode has that problem)" >&3
|
386
|
+
sed -n -e '/^ *end/,$p' config/application.rb-old
|
387
|
+
fi
|
388
|
+
) 3>&1 > config/application.rb
|
389
|
+
|
390
|
+
#echo =============== config/application.rb-old ========================
|
391
|
+
#cat config/application.rb-old
|
392
|
+
echo =============== config/application.rb ========================
|
393
|
+
cat config/application.rb
|
394
|
+
else
|
395
|
+
echo FAILED: NO config/application.rb file!!
|
396
|
+
exit 2
|
397
|
+
fi
|
398
|
+
|
399
|
+
echo =======================================
|
400
|
+
|
401
|
+
;;
|
402
|
+
esac
|
403
|
+
|
357
404
|
if [ -s config/routes.rb ]; then
|
358
405
|
mv -f config/routes.rb config/routes.rb-old
|
359
406
|
(
|
@@ -386,7 +433,8 @@ if [ -s config/routes.rb ]; then
|
|
386
433
|
echo =============== config/routes.rb ========================
|
387
434
|
cat config/routes.rb
|
388
435
|
else
|
389
|
-
echo NO config/routes.rb file!!
|
436
|
+
echo FAILED: NO config/routes.rb file!!
|
437
|
+
exit 2
|
390
438
|
fi
|
391
439
|
echo =======================================
|
392
440
|
|
data/test/test_with_railsapp
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
+
route_prefix=medical_check
|
4
|
+
|
3
5
|
err_report() {
|
4
6
|
echo "$0: Error on line $1 - aborted"
|
5
7
|
exit 1
|
@@ -43,6 +45,16 @@ cd $railsapp
|
|
43
45
|
date > $custom_file
|
44
46
|
rm -f $catchall_file
|
45
47
|
|
48
|
+
case `egrep '^[^#]*MiddlewareHealthcheck' config/application.rb` in
|
49
|
+
'')
|
50
|
+
export has_middleware=false
|
51
|
+
;;
|
52
|
+
?*)
|
53
|
+
export has_middleware=true
|
54
|
+
;;
|
55
|
+
esac
|
56
|
+
|
57
|
+
|
46
58
|
testurl="$base_dir/test/testurl"
|
47
59
|
fake_smtp_server="$base_dir/test/fake_smtp_server"
|
48
60
|
|
@@ -253,6 +265,8 @@ common_tests()
|
|
253
265
|
echo
|
254
266
|
fi
|
255
267
|
|
268
|
+
|
269
|
+
|
256
270
|
test_no=`expr 1 + $test_no`
|
257
271
|
if [ -z "$run_test" ] || [ $test_no == "$run_test" ]; then
|
258
272
|
echo "${test_no}: TESTING ${route_prefix}/site should pass ..."
|
@@ -268,6 +282,36 @@ common_tests()
|
|
268
282
|
echo
|
269
283
|
fi
|
270
284
|
|
285
|
+
#test with coruppted DB
|
286
|
+
rm -rf db.bak
|
287
|
+
cp -R db db.bak
|
288
|
+
for f in db/*.sqlite3
|
289
|
+
do
|
290
|
+
echo CORRUPTED > $f
|
291
|
+
done
|
292
|
+
|
293
|
+
test_no=`expr 1 + $test_no`
|
294
|
+
if [ -z "$run_test" ] || [ $test_no == "$run_test" ]; then
|
295
|
+
echo "${test_no}: TESTING ${route_prefix}/database should fail if the database has been corrupted ..."
|
296
|
+
|
297
|
+
$testurl ${host}/${route_prefix}/database 550 text/plain failed
|
298
|
+
echo
|
299
|
+
fi
|
300
|
+
|
301
|
+
test_no=`expr 1 + $test_no`
|
302
|
+
if [ -z "$run_test" ] || [ $test_no == "$run_test" ]; then
|
303
|
+
echo "${test_no}: TESTING ${route_prefix}/site should pass ..."
|
304
|
+
$testurl ${host}/${route_prefix}/site 200 text/plain $success
|
305
|
+
if $has_middleware; then
|
306
|
+
echo "${test_no}: TESTING ${route_prefix}/middleware_site should pass ..."
|
307
|
+
$testurl ${host}/${route_prefix}/middleware_site 200 text/plain $success
|
308
|
+
fi
|
309
|
+
echo
|
310
|
+
fi
|
311
|
+
|
312
|
+
# Restore database
|
313
|
+
cp -f db.bak/*.sqlite3 db/
|
314
|
+
|
271
315
|
test_no=`expr 1 + $test_no`
|
272
316
|
if [ -z "$run_test" ] || [ $test_no == "$run_test" ]; then
|
273
317
|
echo "${test_no}: TESTING ${route_prefix}/migration should fail without all migrations ..."
|
@@ -407,6 +451,18 @@ common_tests()
|
|
407
451
|
echo
|
408
452
|
fi
|
409
453
|
|
454
|
+
test_no=`expr 1 + $test_no`
|
455
|
+
if [ -z "$run_test" ] || [ $test_no == "$run_test" ]; then
|
456
|
+
if $has_middleware; then
|
457
|
+
echo "${test_no}: TESTING ${route_prefix}/middleware_site should pass ..."
|
458
|
+
$testurl ${host}/${route_prefix}/middleware_site 200 text/plain $success
|
459
|
+
else
|
460
|
+
echo "${test_no}: TESTING ${route_prefix}/middleware_site should fail ..."
|
461
|
+
$testurl ${host}/${route_prefix}/middleware_site 550 text/plain failed
|
462
|
+
fi
|
463
|
+
echo
|
464
|
+
fi
|
465
|
+
|
410
466
|
test_no=`expr 1 + $test_no`
|
411
467
|
if [ -z "$run_test" ] || [ $test_no == "$run_test" ]; then
|
412
468
|
echo "${test_no}: TESTING log files to check for deprecation warnings ..."
|
@@ -440,13 +496,15 @@ case "$run_test" in
|
|
440
496
|
|
441
497
|
# get a static file
|
442
498
|
|
443
|
-
route_prefix=health_check
|
444
|
-
|
445
499
|
echo
|
446
500
|
echo 'TESTING no catchall route active ...'
|
447
501
|
expected_status=404,500,502
|
448
502
|
$testurl ${host}/another/url $expected_status
|
449
503
|
|
504
|
+
echo 'TESTING default route has been overriden ...'
|
505
|
+
expected_status=404,500,502
|
506
|
+
$testurl ${host}/health_check/site $expected_status
|
507
|
+
|
450
508
|
common_tests 1
|
451
509
|
;;
|
452
510
|
esac
|
metadata
CHANGED
@@ -1,81 +1,72 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: health_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
5
|
-
prerelease:
|
4
|
+
version: 2.4.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ian Heggie
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '4.0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '4.0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 0.8.3
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 0.8.3
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: shoulda
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 2.11.0
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: 2.11.0
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: bundler
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '1.2'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '1.2'
|
78
|
-
description:
|
69
|
+
description: " \tSimple health check of Rails app for uptime monitoring with Pingdom,
|
79
70
|
NewRelic, EngineYard or uptime.openacs.org etc.\n"
|
80
71
|
email:
|
81
72
|
- ian@heggie.biz
|
@@ -84,9 +75,9 @@ extensions: []
|
|
84
75
|
extra_rdoc_files:
|
85
76
|
- README.rdoc
|
86
77
|
files:
|
87
|
-
- .document
|
88
|
-
- .gitignore
|
89
|
-
- .travis.yml
|
78
|
+
- ".document"
|
79
|
+
- ".gitignore"
|
80
|
+
- ".travis.yml"
|
90
81
|
- CHANGELOG
|
91
82
|
- Gemfile
|
92
83
|
- MIT-LICENSE
|
@@ -126,27 +117,26 @@ files:
|
|
126
117
|
- test/unit/routes_test.rb
|
127
118
|
homepage: https://github.com/ianheggie/health_check
|
128
119
|
licenses: []
|
120
|
+
metadata: {}
|
129
121
|
post_install_message:
|
130
122
|
rdoc_options: []
|
131
123
|
require_paths:
|
132
124
|
- lib
|
133
125
|
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
-
none: false
|
135
126
|
requirements:
|
136
|
-
- -
|
127
|
+
- - ">="
|
137
128
|
- !ruby/object:Gem::Version
|
138
129
|
version: 1.9.3
|
139
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
|
-
none: false
|
141
131
|
requirements:
|
142
|
-
- -
|
132
|
+
- - ">="
|
143
133
|
- !ruby/object:Gem::Version
|
144
134
|
version: '0'
|
145
135
|
requirements: []
|
146
136
|
rubyforge_project:
|
147
|
-
rubygems_version:
|
137
|
+
rubygems_version: 2.5.1
|
148
138
|
signing_key:
|
149
|
-
specification_version:
|
139
|
+
specification_version: 4
|
150
140
|
summary: Simple health check of Rails app for uptime monitoring with Pingdom, NewRelic,
|
151
141
|
EngineYard or uptime.openacs.org etc.
|
152
142
|
test_files:
|