health_check 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/README.rdoc +28 -16
- data/Vagrantfile +20 -0
- data/lib/health_check/version.rb +1 -1
- data/test/init_variables +2 -0
- data/test/provision_vagrant +79 -0
- metadata +82 -93
data/CHANGELOG
CHANGED
data/README.rdoc
CHANGED
@@ -195,38 +195,50 @@ See https://github.com/ianheggie/health_check/wiki/Ajax-Example for an Ajax exam
|
|
195
195
|
|
196
196
|
== Testing
|
197
197
|
|
198
|
-
=== Automated testing
|
198
|
+
=== Automated testing
|
199
199
|
|
200
|
-
* {<img src="https://
|
201
|
-
* {<img src="https://travis-ci.org/ianheggie/health_check.png">}[https://travis-ci.org/ianheggie/health_check] - Travis CI
|
202
|
-
* {<img src="https://codeclimate.com/github/ianheggie/health_check.png" />}[https://codeclimate.com/github/ianheggie/health_check] - Code quality
|
203
|
-
* {<img src="https://gemnasium.com/ianheggie/health_check.png">}[https://gemnasium.com/ianheggie/health_check] - Gem dependencies
|
200
|
+
* {<img src="https://travis-ci.org/ianheggie/health_check.svg?branch=rails2.3">}[https://travis-ci.org/ianheggie/health_check.svg?branch=rails2.3] - Travis CI
|
204
201
|
|
205
202
|
=== Manual testing
|
206
203
|
|
207
|
-
The
|
208
|
-
install the gem, and then run up tests against the server.
|
209
|
-
This will require TCP port 3456 to be free.
|
204
|
+
The instructions have been changed to using a vagrant virtual box for consistant results.
|
210
205
|
|
211
|
-
|
212
|
-
You will need to install the bundler gem if using rbenv.
|
213
|
-
See the <tt>.travis.yml</tt> file for the list of ruby versions that we test against.
|
214
|
-
|
215
|
-
* rbenv command: <tt>rbenv shell 1.8.7-p371</tt>
|
216
|
-
* rvm command: <tt>rvm use 1.9.3</tt>
|
206
|
+
Install vagrant 1.9.7 or later and virtual_box or other local virtual machine providor.
|
217
207
|
|
218
208
|
Create a temp directory for throw away testing, and clone the health_check gem into it
|
219
209
|
|
220
210
|
mkdir -p ~/tmp
|
221
211
|
cd ~/tmp
|
222
|
-
git clone https://github.com/ianheggie/health_check.git
|
212
|
+
git clone https://github.com/ianheggie/health_check.git ~/tmp/health_check
|
213
|
+
|
214
|
+
The Vagrantfile includes provisioning rules to install chruby (ruby version control),
|
215
|
+
ruby-build will also be installed and run to build various rubies under /opt/rubies.
|
216
|
+
|
217
|
+
Use <tt>vagrant ssh</tt> to connect to the virtual box and run tests.
|
218
|
+
|
219
|
+
The test script will package up and install the gem under a temporary path, create a dummy rails app configured for sqlite,
|
220
|
+
install the gem, and then run up tests against the server.
|
221
|
+
This will require TCP port 3456 to be free.
|
223
222
|
|
224
223
|
Cd to the checked out health_check directory and then run the test as follows:
|
225
224
|
|
226
225
|
cd ~/tmp/health_check
|
227
226
|
|
227
|
+
vagrant up # this will also run vagrant provision and take some time
|
228
|
+
# chruby and various ruby versions will be installed
|
229
|
+
|
230
|
+
vagrant ssh
|
231
|
+
|
232
|
+
cd /vagrant # the current directory on your host is mounted here on the virtual machine
|
233
|
+
|
234
|
+
chruby 1.8.7
|
235
|
+
# or
|
236
|
+
chruby 1.9.3
|
237
|
+
|
228
238
|
test/test_with_railsapp
|
229
239
|
|
240
|
+
exit # from viretual machine when finished
|
241
|
+
|
230
242
|
The script will first call `test/setup_railsapp` to setup a rails app with health_check installed and then
|
231
243
|
run up the rails server and perform veraious tests.
|
232
244
|
|
@@ -237,7 +249,7 @@ The command `rake test` will also launch these tests, except it cannot install t
|
|
237
249
|
|
238
250
|
== Copyright
|
239
251
|
|
240
|
-
Copyright (c) 2010-
|
252
|
+
Copyright (c) 2010-2017 Ian Heggie, released under the MIT license.
|
241
253
|
See MIT-LICENSE for details.
|
242
254
|
|
243
255
|
== Contributors
|
data/Vagrantfile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
Vagrant.configure("2") do |config|
|
5
|
+
# For a complete reference, please see the online documentation at
|
6
|
+
# https://docs.vagrantup.com.
|
7
|
+
|
8
|
+
config.vm.box = "ubuntu/xenial64"
|
9
|
+
|
10
|
+
# set auto_update to false, if you do NOT want to check the correct
|
11
|
+
# additions version when booting this machine
|
12
|
+
config.vbguest.auto_update = false
|
13
|
+
|
14
|
+
# do NOT download the iso file from a webserver
|
15
|
+
config.vbguest.no_remote = true
|
16
|
+
|
17
|
+
# provision with a shell script.
|
18
|
+
config.vm.provision "shell", path: "./test/provision_vagrant"
|
19
|
+
|
20
|
+
end
|
data/lib/health_check/version.rb
CHANGED
data/test/init_variables
CHANGED
@@ -20,6 +20,8 @@ if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
|
|
20
20
|
echo "Detected user installed rvm"
|
21
21
|
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
|
22
22
|
echo "Detected root installed rvm"
|
23
|
+
elif [[ -s /usr/local/share/chruby/chruby.sh ]] ; then
|
24
|
+
echo "Detected root installed chruby"
|
23
25
|
elif [[ -d "$HOME/.rbenv" ]] ; then
|
24
26
|
echo "Detected rbenv: `rbenv version`"
|
25
27
|
rehash='rbenv rehash'
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
case `id` in
|
4
|
+
*root*)
|
5
|
+
;;
|
6
|
+
*)
|
7
|
+
exec echo Must be run as root
|
8
|
+
;;
|
9
|
+
esac
|
10
|
+
|
11
|
+
chruby_version=0.3.9
|
12
|
+
chruby=chruby-${chruby_version}
|
13
|
+
|
14
|
+
set -xe
|
15
|
+
id
|
16
|
+
pwd
|
17
|
+
export DEBIAN_FRONTEND=noninteractive
|
18
|
+
find /tmp/got-apt-update -mtime -1 || ( apt-get update && touch /tmp/got-apt-update )
|
19
|
+
apt install --yes --force-yes -q ruby ruby-dev sqlite3 libsqlite3-dev nodejs subversion git git-core
|
20
|
+
# https://github.com/rbenv/ruby-build/wiki#suggested-build-environment
|
21
|
+
# using default gcc-5 since xenial doesn't have gcc-6
|
22
|
+
apt install --yes --force-yes -q gcc-5 autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
|
23
|
+
|
24
|
+
# The following is not required for testing, install if you are doing manual tests with extra gems
|
25
|
+
# apt install --yes --force-yes -q mysql-client mysql-server libmysqlclient-dev
|
26
|
+
# apt install --yes --force-yes -q libcurl4-openssl-dev libncurses5-dev libxml2-dev libxslt1-dev
|
27
|
+
(
|
28
|
+
echo Install chruby
|
29
|
+
[ -s ${chruby}.tar.gz ] || wget -q -O ${chruby}.tar.gz https://github.com/postmodern/chruby/archive/v${chruby_version}.tar.gz
|
30
|
+
[ -d ${chruby} ] || tar -xzf ${chruby}.tar.gz
|
31
|
+
cd ${chruby}/
|
32
|
+
./scripts/setup.sh
|
33
|
+
cat > /etc/profile.d/chruby.sh <<'EOF'
|
34
|
+
if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
|
35
|
+
source /usr/local/share/chruby/chruby.sh
|
36
|
+
#source /usr/local/share/chruby/auto
|
37
|
+
fi
|
38
|
+
EOF
|
39
|
+
chmod a+r /etc/profile.d/chruby.sh
|
40
|
+
)
|
41
|
+
|
42
|
+
(
|
43
|
+
[ -d ruby-build ] || git clone https://github.com/rbenv/ruby-build.git
|
44
|
+
which ruby-build || PREFIX=/usr/local ./ruby-build/install.sh
|
45
|
+
|
46
|
+
mkdir -p /opt/rubies
|
47
|
+
v=1.8.7-p375
|
48
|
+
[ -x /opt/rubies/${v}/bin/bundle ] || ( ruby-build ${v} /opt/rubies/${v} && /opt/rubies/${v}/bin/gem update --system 1.8.25 && /opt/rubies/${v}/bin/gem install bundler )
|
49
|
+
|
50
|
+
v=1.9.3-p551
|
51
|
+
[ -x /opt/rubies/${v}/bin/bundle ] || ( ruby-build ${v} /opt/rubies/${v} && /opt/rubies/${v}/bin/gem install bundler )
|
52
|
+
|
53
|
+
#for v in 2.2.0
|
54
|
+
#do
|
55
|
+
# [ -x /opt/rubies/${v}/bin/bundle ] || ( ruby-build ${v} /opt/rubies/${v} && /opt/rubies/${v}/bin/gem install bundler )
|
56
|
+
#done
|
57
|
+
)
|
58
|
+
|
59
|
+
echo Setup system ruby
|
60
|
+
which bundle || gem install bundler
|
61
|
+
bundle --version
|
62
|
+
set +x
|
63
|
+
cat <<EOF
|
64
|
+
|
65
|
+
Now test by running the following commands:
|
66
|
+
|
67
|
+
vagrant ssh
|
68
|
+
cd /vagrant
|
69
|
+
|
70
|
+
chruby RUBY_VERSION
|
71
|
+
or
|
72
|
+
chruby system # for system version 2.3.1
|
73
|
+
|
74
|
+
./test/test_with_railsapp
|
75
|
+
|
76
|
+
exit
|
77
|
+
|
78
|
+
EOF
|
79
|
+
exit
|
metadata
CHANGED
@@ -1,103 +1,95 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: health_check
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.6.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 6
|
9
|
-
- 1
|
10
|
-
version: 1.6.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Ian Heggie
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2017-10-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: rails
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
18
|
+
requirements:
|
27
19
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 3
|
33
|
-
- 0
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 2.3.0
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rake
|
39
23
|
prerelease: false
|
40
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.3.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
41
33
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 57
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
- 8
|
49
|
-
- 3
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
50
37
|
version: 0.8.3
|
51
38
|
- - <
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
segments:
|
55
|
-
- 11
|
56
|
-
- 0
|
57
|
-
version: "11.0"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '11.0'
|
58
41
|
type: :development
|
59
|
-
version_requirements: *id002
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: shoulda
|
62
42
|
prerelease: false
|
63
|
-
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 0.8.3
|
49
|
+
- - <
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '11.0'
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: shoulda
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
64
55
|
none: false
|
65
|
-
requirements:
|
56
|
+
requirements:
|
66
57
|
- - ~>
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
hash: 35
|
69
|
-
segments:
|
70
|
-
- 2
|
71
|
-
- 11
|
72
|
-
- 0
|
58
|
+
- !ruby/object:Gem::Version
|
73
59
|
version: 2.11.0
|
74
60
|
type: :development
|
75
|
-
version_requirements: *id003
|
76
|
-
- !ruby/object:Gem::Dependency
|
77
|
-
name: bundler
|
78
61
|
prerelease: false
|
79
|
-
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 2.11.0
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: bundler
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
80
71
|
none: false
|
81
|
-
requirements:
|
72
|
+
requirements:
|
82
73
|
- - ~>
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
|
85
|
-
segments:
|
86
|
-
- 1
|
87
|
-
- 2
|
88
|
-
version: "1.2"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.2'
|
89
76
|
type: :development
|
90
|
-
|
91
|
-
|
92
|
-
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '1.2'
|
84
|
+
description: ! " \tSimple health check of Rails app for uptime monitoring with Pingdom,
|
85
|
+
NewRelic, EngineYard or uptime.openacs.org etc.\n"
|
86
|
+
email:
|
93
87
|
- ian@heggie.biz
|
94
88
|
executables: []
|
95
|
-
|
96
89
|
extensions: []
|
97
|
-
|
98
|
-
extra_rdoc_files:
|
90
|
+
extra_rdoc_files:
|
99
91
|
- README.rdoc
|
100
|
-
files:
|
92
|
+
files:
|
101
93
|
- .document
|
102
94
|
- .gitignore
|
103
95
|
- .travis.yml
|
@@ -107,6 +99,7 @@ files:
|
|
107
99
|
- README.rdoc
|
108
100
|
- Rakefile
|
109
101
|
- VERSION
|
102
|
+
- Vagrantfile
|
110
103
|
- config/routes.rb
|
111
104
|
- health_check.gemspec
|
112
105
|
- init.rb
|
@@ -123,6 +116,7 @@ files:
|
|
123
116
|
- test/migrate/twelve/011_create_roles.roles.rb
|
124
117
|
- test/migrate/twelve/012_create_users.rb
|
125
118
|
- test/migrate/twelve/9_create_countries.rb
|
119
|
+
- test/provision_vagrant
|
126
120
|
- test/rails_2.3.gemfile
|
127
121
|
- test/rails_2.3_lts.gemfile
|
128
122
|
- test/setup_railsapp
|
@@ -131,41 +125,35 @@ files:
|
|
131
125
|
- test/testurl
|
132
126
|
- test/unit/health_check_controller_test.rb
|
133
127
|
- test/unit/routes_test.rb
|
134
|
-
has_rdoc: true
|
135
128
|
homepage: https://github.com/ianheggie/health_check
|
136
129
|
licenses: []
|
137
|
-
|
138
130
|
post_install_message:
|
139
131
|
rdoc_options: []
|
140
|
-
|
141
|
-
require_paths:
|
132
|
+
require_paths:
|
142
133
|
- lib
|
143
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
135
|
none: false
|
145
|
-
requirements:
|
146
|
-
- -
|
147
|
-
- !ruby/object:Gem::Version
|
148
|
-
|
149
|
-
segments:
|
136
|
+
requirements:
|
137
|
+
- - ! '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
segments:
|
150
141
|
- 0
|
151
|
-
|
152
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
hash: 4237956159374351486
|
143
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
144
|
none: false
|
154
|
-
requirements:
|
155
|
-
- -
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
|
158
|
-
segments:
|
159
|
-
- 0
|
160
|
-
version: "0"
|
145
|
+
requirements:
|
146
|
+
- - ! '>='
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
161
149
|
requirements: []
|
162
|
-
|
163
150
|
rubyforge_project:
|
164
|
-
rubygems_version: 1.
|
151
|
+
rubygems_version: 1.8.23.2
|
165
152
|
signing_key:
|
166
153
|
specification_version: 3
|
167
|
-
summary: Simple health check of Rails app for uptime monitoring with Pingdom, NewRelic,
|
168
|
-
|
154
|
+
summary: Simple health check of Rails app for uptime monitoring with Pingdom, NewRelic,
|
155
|
+
EngineYard or uptime.openacs.org etc.
|
156
|
+
test_files:
|
169
157
|
- test/fake_smtp_server
|
170
158
|
- test/init_variables
|
171
159
|
- test/migrate/empty/do_not_remove.txt
|
@@ -173,6 +161,7 @@ test_files:
|
|
173
161
|
- test/migrate/twelve/011_create_roles.roles.rb
|
174
162
|
- test/migrate/twelve/012_create_users.rb
|
175
163
|
- test/migrate/twelve/9_create_countries.rb
|
164
|
+
- test/provision_vagrant
|
176
165
|
- test/rails_2.3.gemfile
|
177
166
|
- test/rails_2.3_lts.gemfile
|
178
167
|
- test/setup_railsapp
|