uptime_monitor 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75b1b3732cc2d08241cdca4d5697b17c7f503235
4
- data.tar.gz: 9d037db9abeab5d6b7406cda2e228f6fee582c37
3
+ metadata.gz: 89464c2c9a951210f005a692dbf01e523d60b171
4
+ data.tar.gz: 6c03f8db541703010ada4c9445d5c18fc2d4853c
5
5
  SHA512:
6
- metadata.gz: 8298862f36218c41d2bffdb7d3265c675cc83735315c1f1cd1aca00d4ea4412149a74dd14ccfeb65c66cdbd9aad262252f5a944d103a5b6fbea942dbdc4b55ab
7
- data.tar.gz: c5be927e6a32bb61b37f2714ee98822bfe9f22e0b081420085b0af30c7875bdbe0660c8544b6bb53d76e75060844b472841c1663e6ebcb89eb0124dd2fcae25b
6
+ metadata.gz: 21a848684aa53946047ae56cbf28506ae65c979f48f1cb8838bcc71b89038d14ced4a4761351cecd60f759e128e3df9334bbb94c95ffd1b2b727d657990f20c0
7
+ data.tar.gz: e73eb6afa058f1842c9e2623ad3ac90dbfba7c3e351c0c90af3d751346226f159b65b6dcac32ee8fe01f03fd77e497858343f55271fce2ce2f61244eb59166ef
data/README.md CHANGED
@@ -379,7 +379,9 @@ monitor = {
379
379
  ragios.create(monitor)
380
380
  ```
381
381
 
382
- ## Running Uptime Monitor outside Ragios with Docker Compose
382
+ ## Using Uptime Monitor without Ragios
383
+
384
+ ### Running Uptime Monitor outside Ragios with Docker Compose
383
385
 
384
386
  First clone the uptime_monitor Repo on github.
385
387
 
@@ -405,7 +407,7 @@ docker-compose run --rm uptime_monitor
405
407
  This will give you access to the entire uptime_monitor and all its objects loaded into PRY console. It will also run Selenium Grid and firefox in separate docker containers already connected to the uptime_monitor.
406
408
 
407
409
 
408
- ## Testing the validations outside Ragios
410
+ ### Testing the validations outside Ragios
409
411
  Sometimes it's useful to run validations outside Ragios to verify that the validations are syntactically correct and don't raise any exceptions. This is best done by running the uptime_monitor plugin as a Plain Old Ruby Object.
410
412
 
411
413
  First load uptime_monitor into PRY console:
@@ -455,7 +457,7 @@ u.test_result
455
457
  In the above example the *test_command?* method runs the validations and returns true when all validations passes, returns false when any of the validation fails. *test_result* is a hash that contains the result of the tests ran by *test_command?*.
456
458
 
457
459
 
458
- ## Testing individual validations
460
+ ### Testing individual validations
459
461
  It can be very useful to test validations/actions individually before adding them to Ragios. This can be done by running plugin's browser directly.
460
462
  ```ruby
461
463
  url= "http://obi-akubue.org"
@@ -517,9 +519,9 @@ u.test_result
517
519
  ```
518
520
  Notice that *test_result* includes a url to the screenshot of the webpage when the test failed. This test result is also included in the notifications sent to site admin by Ragios when a test fails. So this way the admin can see exactly what webpage looked like when the transaction failed.
519
521
 
520
- ## Disable screenshots on individual monitors
521
- While using Ragios, to disable screenshots on a particular monitor add the key/value pair ```disable_screenshots: true```
522
- example:
522
+ ### Disable screenshots on individual monitors
523
+ To disable screenshots on a particular monitor in Ragios add the key/value pair ```disable_screenshots: true``` to the monitor.
524
+ For example:
523
525
  ```ruby
524
526
  monitor = {
525
527
  url: "http://obi-akubue.org",
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.1
1
+ 0.7.2
@@ -20,6 +20,8 @@ services:
20
20
 
21
21
  hub:
22
22
  image: selenium/hub:3.8.1-erbium
23
+ environment:
24
+ GRID_BROWSER_TIMEOUT: 60
23
25
  ports:
24
26
  - "4444:4444"
25
27
 
@@ -27,26 +29,33 @@ services:
27
29
  build: .
28
30
  volumes:
29
31
  - .:/usr/src/uptime_monitor
32
+ depends_on:
33
+ - firefox
34
+ - chrome
30
35
  links:
31
- - firefox:firefox
36
+ - hub:hub
32
37
  environment:
33
38
  S3_AWS_ACCESS_KEY_ID:
34
39
  S3_AWS_SECRET_ACCESS_KEY:
35
40
  RAGIOS_HERCULES_S3_DIR:
36
41
  RAGIOS_HERCULES_ENABLE_SCREENSHOTS:
37
- BROWSER: firefox
42
+ HUB_HOST: hub
43
+ HUB_PORT: 4444
38
44
  entrypoint: bundle exec rake repl
39
45
 
40
46
  unit_tests:
41
47
  build: .
42
48
  volumes:
43
49
  - .:/usr/src/uptime_monitor
50
+ depends_on:
51
+ - firefox
44
52
  links:
45
- - firefox:firefox
53
+ - hub:hub
46
54
  environment:
47
55
  S3_AWS_ACCESS_KEY_ID:
48
56
  S3_AWS_SECRET_ACCESS_KEY:
49
57
  RAGIOS_HERCULES_S3_DIR:
50
58
  RAGIOS_HERCULES_ENABLE_SCREENSHOTS:
51
- BROWSER: firefox
59
+ HUB_HOST: hub
60
+ HUB_PORT: 4444
52
61
  entrypoint: bundle exec rspec -fd spec
@@ -116,13 +116,18 @@ module Hercules
116
116
  uploader = Hercules::UptimeMonitor::ScreenShotUploader.new
117
117
  uploader.store(file)
118
118
  end
119
+
119
120
  private
121
+
120
122
  def goto(url, browser_name)
121
123
  client = Selenium::WebDriver::Remote::Http::Default.new
122
124
  client.read_timeout = 180 # seconds – default is 60
123
125
 
124
126
  options = {http_client: client}
125
- options[:url] = "http://#{ENV['BROWSER']}:5555/wd/hub" if ENV['BROWSER']
127
+
128
+ if ENV['HUB_HOST'] && ENV['HUB_PORT']
129
+ options[:url] = "http://#{ENV['HUB_HOST']}:4444/wd/hub"
130
+ end
126
131
 
127
132
  @browser = Watir::Browser.new browser_name, options
128
133
  @browser.goto url
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: uptime_monitor 0.7.1 ruby lib
5
+ # stub: uptime_monitor 0.7.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "uptime_monitor".freeze
9
- s.version = "0.7.1"
9
+ s.version = "0.7.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["obi-a".freeze]
14
- s.date = "2018-01-27"
14
+ s.date = "2018-03-10"
15
15
  s.description = "A Ragios plugin that uses a real web browser to monitor transactions on a website for availability".freeze
16
16
  s.email = "obioraakubue@yahoo.com".freeze
17
17
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uptime_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - obi-a
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-27 00:00:00.000000000 Z
11
+ date: 2018-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: watir