easymon 1.2.6 → 1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of easymon might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/easymon/checks/active_record_check.rb +1 -1
- data/lib/easymon/checks/split_active_record_check.rb +1 -1
- data/lib/easymon/version.rb +1 -1
- data/test/controllers/easymon/checks_controller_test.rb +2 -2
- data/test/dummy/log/development.log +0 -0
- data/test/dummy/log/test.log +1331 -2979
- data/test/unit/checks/active_record_check_on_postgresql_test.rb +1 -1
- data/test/unit/checks/active_record_check_test.rb +7 -7
- data/test/unit/checks/split_active_record_check_test.rb +13 -13
- metadata +5 -3
@@ -11,7 +11,7 @@ class ActiveRecordCheckOnPostgresqlTest < ActiveSupport::TestCase
|
|
11
11
|
end
|
12
12
|
|
13
13
|
test "#check returns a failed result on a failed run" do
|
14
|
-
PGBase.connection.stubs(:
|
14
|
+
PGBase.connection.stubs(:active?).raises("boom")
|
15
15
|
check = create_check
|
16
16
|
results = check.check
|
17
17
|
|
@@ -1,31 +1,31 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class ActiveRecordCheckTest < ActiveSupport::TestCase
|
4
|
-
|
4
|
+
|
5
5
|
test "#check returns a successful result on a good run" do
|
6
6
|
check = create_check
|
7
7
|
results = check.check
|
8
|
-
|
8
|
+
|
9
9
|
assert_equal(true, results[0])
|
10
10
|
assert_equal("Up", results[1])
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
test "#check returns a failed result on a failed run" do
|
14
|
-
ActiveRecord::Base.connection.stubs(:
|
14
|
+
ActiveRecord::Base.connection.stubs(:active?).raises("boom")
|
15
15
|
check = create_check
|
16
16
|
results = check.check
|
17
|
-
|
17
|
+
|
18
18
|
assert_equal(false, results[0])
|
19
19
|
assert_equal("Down", results[1])
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
test "given nil as a config" do
|
23
23
|
check = Easymon::ActiveRecordCheck.new(nil)
|
24
24
|
results = check.check
|
25
25
|
assert_equal("Down", results[1])
|
26
26
|
assert_equal(false, results[0])
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
private
|
30
30
|
def create_check
|
31
31
|
Easymon::ActiveRecordCheck.new(ActiveRecord::Base)
|
@@ -1,48 +1,48 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class SplitActiveRecordCheckTest < ActiveSupport::TestCase
|
4
|
-
|
4
|
+
|
5
5
|
test "#run sets success conditions on successful run" do
|
6
6
|
master = ActiveRecord::Base.connection
|
7
7
|
Easymon::Base.establish_connection
|
8
8
|
slave = Easymon::Base.connection
|
9
|
-
|
9
|
+
|
10
10
|
check = Easymon::SplitActiveRecordCheck.new { [master, slave] }
|
11
|
-
|
11
|
+
|
12
12
|
results = check.check
|
13
|
-
|
13
|
+
|
14
14
|
assert_equal("Master: Up - Slave: Up", results[1])
|
15
15
|
assert_equal(true, results[0])
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
test "#run sets failed conditions when slave is down" do
|
19
19
|
master = ActiveRecord::Base.connection
|
20
20
|
Easymon::Base.establish_connection
|
21
21
|
slave = Easymon::Base.connection
|
22
22
|
|
23
|
-
slave.stubs(:
|
24
|
-
|
23
|
+
slave.stubs(:active?).raises("boom")
|
24
|
+
|
25
25
|
check = Easymon::SplitActiveRecordCheck.new { [master, slave] }
|
26
26
|
results = check.check
|
27
27
|
|
28
28
|
assert_equal("Master: Up - Slave: Down", results[1])
|
29
29
|
assert_equal(false, results[0])
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
test "#run sets failed conditions when master is down" do
|
33
33
|
master = ActiveRecord::Base.connection
|
34
34
|
Easymon::Base.establish_connection
|
35
35
|
slave = Easymon::Base.connection
|
36
36
|
|
37
|
-
master.stubs(:
|
38
|
-
|
37
|
+
master.stubs(:active?).raises("boom")
|
38
|
+
|
39
39
|
check = Easymon::SplitActiveRecordCheck.new { [master, slave] }
|
40
40
|
results = check.check
|
41
|
-
|
41
|
+
|
42
42
|
assert_equal("Master: Down - Slave: Up", results[1])
|
43
43
|
assert_equal(false, results[0])
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
test "given nil as a config" do
|
47
47
|
check = Easymon::SplitActiveRecordCheck.new { }
|
48
48
|
results = check.check
|
@@ -61,7 +61,7 @@ module Easymon
|
|
61
61
|
super config
|
62
62
|
end
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def database_configuration
|
66
66
|
env = "#{Rails.env}_slave"
|
67
67
|
config = YAML.load_file(Rails.root.join('config/database.yml'))[env]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easymon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Anderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -171,6 +171,7 @@ files:
|
|
171
171
|
- test/dummy/config/memcached.yml
|
172
172
|
- test/dummy/config/redis.yml
|
173
173
|
- test/dummy/config/routes.rb
|
174
|
+
- test/dummy/log/development.log
|
174
175
|
- test/dummy/log/test.log
|
175
176
|
- test/dummy/public/404.html
|
176
177
|
- test/dummy/public/422.html
|
@@ -210,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
211
|
version: '0'
|
211
212
|
requirements: []
|
212
213
|
rubyforge_project:
|
213
|
-
rubygems_version: 2.
|
214
|
+
rubygems_version: 2.5.1
|
214
215
|
signing_key:
|
215
216
|
specification_version: 4
|
216
217
|
summary: Simple availability checks for your rails app
|
@@ -247,6 +248,7 @@ test_files:
|
|
247
248
|
- test/dummy/config/redis.yml
|
248
249
|
- test/dummy/config/routes.rb
|
249
250
|
- test/dummy/config.ru
|
251
|
+
- test/dummy/log/development.log
|
250
252
|
- test/dummy/log/test.log
|
251
253
|
- test/dummy/public/404.html
|
252
254
|
- test/dummy/public/422.html
|