sauce_overage 0.0.2 → 1.0.0

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: 1765c58dd4f9ce1945c15371c8ace97f39c20c91
4
- data.tar.gz: b8e3f9c43e000ab714b8be866fffac52ea17bca3
3
+ metadata.gz: 45b05667ec4e6f4f7aeeeb2ecfe4c2c6442e93bd
4
+ data.tar.gz: 761ba3ea9602ad07a9a949f9ff5d9597d9cda55e
5
5
  SHA512:
6
- metadata.gz: 9ee6a775ae32aa155b93453491207640c47020f64b1564ff03f11baf885c9b337c47555e82e1ace4cb612570a0be6eabf7f1cd606d12f2fa0739d5790e142320
7
- data.tar.gz: 212fd35ae05f2b3db55e3b24560c97b94b2d8d0e5e04323275d5ea8d4762ae9bfdb17d6e2de1396090d13c92744fa1ad21095a4ff6d19d4a232164c20fe079b6
6
+ metadata.gz: 99060f962a1fd5ab8b125a712205f8c19aeff8f6bb9a7fa90032fba99b796adf467fd28dda502fd7cf73642075950ac397889350c73ce9dc1f020e9157a53885
7
+ data.tar.gz: b959cf87fc6e2b19a51af43d705ebcc17f2001ca7d3e71740aeb3c567e205bbd65218711cf463a16bf137a142e5afbcf83b0c1b1ae7f6f0d699ee2ca8c0383d7
data/.gitignore CHANGED
@@ -27,9 +27,9 @@ build/
27
27
 
28
28
  # for a library or gem, you might want to ignore these files since the code is
29
29
  # intended to run in multiple environments; otherwise, check them in:
30
- # Gemfile.lock
31
- # .ruby-version
32
- # .ruby-gemset
30
+ Gemfile.lock
31
+ .ruby-version
32
+ .ruby-gemset
33
33
 
34
34
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
35
  .rvmrc
data/.rubocop.yml CHANGED
@@ -16,3 +16,5 @@ Metrics/CyclomaticComplexity:
16
16
  Enabled: false
17
17
  Style/AccessorMethodName:
18
18
  Enabled: false
19
+ Metrics/AbcSize:
20
+ Enabled: false
data/Thorfile CHANGED
@@ -20,6 +20,6 @@ class ::Default < Thor
20
20
 
21
21
  desc 'cop', 'Executes rubocop'
22
22
  def cop
23
- exec 'bundle exec rubocop'
23
+ exec 'bundle exec rubocop --display-cop-names'
24
24
  end
25
25
  end
@@ -1,9 +1,5 @@
1
- require_relative 'sauce_utils'
2
-
3
1
  module SauceOverage
4
2
  class Account
5
- include SauceOverage::SauceUtils
6
-
7
3
  attr_reader :user, :key
8
4
 
9
5
  def initialize(opts = {})
@@ -21,7 +17,11 @@ module SauceOverage
21
17
  get.http_auth_types = :basic
22
18
  get.username = user
23
19
  get.password = key
24
- get.perform
20
+ get.verbose = true # display more info on errors
21
+ # Work around
22
+ # /.rvm/gems/ruby-2.2.2/gems/curb-0.8.8/lib/curl/easy.rb:72:in `perform': SSL connect error (Curl::Err::SSLConnectError)
23
+ # by retrying for two minutes
24
+ wait(120) { get.perform }
25
25
 
26
26
  result = JSON.parse(get.body_str || '{}')
27
27
  fail result['error'] if result['error']
@@ -1,4 +1,4 @@
1
1
  module SauceOverage
2
- VERSION = '0.0.2' unless defined? ::SauceOverage::VERSION
3
- DATE = '2015-09-21' unless defined? ::SauceOverage::DATE
2
+ VERSION = '1.0.0' unless defined? ::SauceOverage::VERSION
3
+ DATE = '2015-09-28' unless defined? ::SauceOverage::DATE
4
4
  end
data/lib/sauce_overage.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'curb'
3
3
  require 'json'
4
+ require 'webdriver_utils'
4
5
 
5
6
  require_relative 'sauce_overage/version'
6
7
  require_relative 'sauce_overage/account'
data/readme.md CHANGED
@@ -4,18 +4,19 @@
4
4
  [![Build Status](https://travis-ci.org/bootstraponline/sauce_overage.svg)](https://travis-ci.org/bootstraponline/sauce_overage)
5
5
  [![Coverage Status](https://coveralls.io/repos/bootstraponline/sauce_overage/badge.svg?branch=master&service=github&nocache)](https://coveralls.io/github/bootstraponline/sauce_overage?branch=master)
6
6
 
7
- Automatically prevent tests from running on overage minutes by tracking remaining time
7
+ Automatically prevent tests from running on overage minutes by tracking remaining time.
8
+
9
+ #### Jenkins CI Integration
8
10
 
9
11
  ```bash
10
12
  export SAUCE_USERNAME="..."
11
13
  export SAUCE_ACCESS_KEY="..."
12
- export SAUCE_OVERAGE_LIMIT="300"
13
-
14
- # if the limit is breached an error is raised and
15
- # the exit code is set to one
16
- $ sauce_overage
17
- 300 minute limit breached (120 remaining) (RuntimeError)
14
+ # if available minutes are below the limit then the job will fail
15
+ export SAUCE_OVERAGE_LIMIT="300" # minutes
18
16
 
19
- $ echo $?
20
- 1
17
+ sauce_overage
18
+ if [ "$?" -ne 0 ]; then
19
+ echo "Jenkins build failed due to lack of sauce minutes"
20
+ exit 1
21
+ fi
21
22
  ```
data/release_notes.md CHANGED
@@ -1,3 +1,12 @@
1
+ #### v1.0.0 2015-09-28
2
+
3
+ - [4df608e](https://github.com/bootstraponline/sauce_overage/commit/4df608e280a36d5dcc0774a8817daba445d2fcf8) Release 1.0.0
4
+ - [e4b2fe9](https://github.com/bootstraponline/sauce_overage/commit/e4b2fe958376c692b792bf7d8221a2d28f34ff00) Update rubocop rules
5
+ - [4258515](https://github.com/bootstraponline/sauce_overage/commit/4258515e96eb8d8faefb244e8b7f572c47683f61) Update to retry failed SSL requests
6
+ - [d6c7712](https://github.com/bootstraponline/sauce_overage/commit/d6c7712d7f2e3643c2ac1d3016bc2942760e6d27) Update readme.md
7
+ - [50b8528](https://github.com/bootstraponline/sauce_overage/commit/50b852889839d39f138bf35d34277bf08760d3e5) Add Jenkins integration code
8
+
9
+
1
10
  #### v0.0.2 2015-09-21
2
11
 
3
12
  - [4abd1f0](https://github.com/bootstraponline/sauce_overage/commit/4abd1f050a18c8f464995cdbe215906dba0c9063) Release 0.0.2
@@ -24,6 +24,7 @@ SUMMARY
24
24
 
25
25
  spec.add_runtime_dependency 'curb', '~> 0.8.8'
26
26
  spec.add_runtime_dependency 'json', '~> 1.8.3'
27
+ spec.add_runtime_dependency 'webdriver_utils', '~> 1.0.2'
27
28
 
28
29
  spec.add_development_dependency 'webmock', '~> 1.21.0'
29
30
  spec.add_development_dependency 'rspec', '~> 3.3.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce_overage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-21 00:00:00.000000000 Z
11
+ date: 2015-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curb
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.8.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: webdriver_utils
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.0.2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.0.2
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: webmock
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -163,13 +177,11 @@ files:
163
177
  - ".rubocop.yml"
164
178
  - ".travis.yml"
165
179
  - Gemfile
166
- - Gemfile.lock
167
180
  - LICENSE
168
181
  - Thorfile
169
182
  - bin/sauce_overage
170
183
  - lib/sauce_overage.rb
171
184
  - lib/sauce_overage/account.rb
172
- - lib/sauce_overage/sauce_utils.rb
173
185
  - lib/sauce_overage/version.rb
174
186
  - readme.md
175
187
  - release_notes.md
data/Gemfile.lock DELETED
@@ -1,110 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- sauce_overage (0.0.2)
5
- curb (~> 0.8.8)
6
- json (~> 1.8.3)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- addressable (2.3.8)
12
- appium_thor (1.0.1)
13
- posix-spawn (~> 0.3, >= 0.3.8)
14
- redcarpet (~> 3.1, >= 3.1.2)
15
- yard (~> 0.8, >= 0.8.7.4)
16
- ast (2.1.0)
17
- astrolabe (1.3.1)
18
- parser (~> 2.2)
19
- coderay (1.1.0)
20
- coveralls (0.8.2)
21
- json (~> 1.8)
22
- rest-client (>= 1.6.8, < 2)
23
- simplecov (~> 0.10.0)
24
- term-ansicolor (~> 1.3)
25
- thor (~> 0.19.1)
26
- crack (0.4.2)
27
- safe_yaml (~> 1.0.0)
28
- curb (0.8.8)
29
- diff-lcs (1.2.5)
30
- docile (1.1.5)
31
- domain_name (0.5.24)
32
- unf (>= 0.0.5, < 1.0.0)
33
- http-cookie (1.0.2)
34
- domain_name (~> 0.5)
35
- json (1.8.3)
36
- method_source (0.8.2)
37
- mime-types (2.6.2)
38
- netrc (0.10.3)
39
- parallel (1.6.1)
40
- parallel_tests (1.7.0)
41
- parallel
42
- parser (2.2.2.6)
43
- ast (>= 1.1, < 3.0)
44
- posix-spawn (0.3.11)
45
- powerpack (0.1.1)
46
- pry (0.10.1)
47
- coderay (~> 1.1.0)
48
- method_source (~> 0.8.1)
49
- slop (~> 3.4)
50
- rainbow (2.0.0)
51
- redcarpet (3.3.2)
52
- rest-client (1.8.0)
53
- http-cookie (>= 1.0.2, < 2.0)
54
- mime-types (>= 1.16, < 3.0)
55
- netrc (~> 0.7)
56
- rspec (3.3.0)
57
- rspec-core (~> 3.3.0)
58
- rspec-expectations (~> 3.3.0)
59
- rspec-mocks (~> 3.3.0)
60
- rspec-core (3.3.2)
61
- rspec-support (~> 3.3.0)
62
- rspec-expectations (3.3.1)
63
- diff-lcs (>= 1.2.0, < 2.0)
64
- rspec-support (~> 3.3.0)
65
- rspec-mocks (3.3.2)
66
- diff-lcs (>= 1.2.0, < 2.0)
67
- rspec-support (~> 3.3.0)
68
- rspec-support (3.3.0)
69
- rubocop (0.33.0)
70
- astrolabe (~> 1.3)
71
- parser (>= 2.2.2.5, < 3.0)
72
- powerpack (~> 0.1)
73
- rainbow (>= 1.99.1, < 3.0)
74
- ruby-progressbar (~> 1.4)
75
- ruby-progressbar (1.7.5)
76
- safe_yaml (1.0.4)
77
- simplecov (0.10.0)
78
- docile (~> 1.1.0)
79
- json (~> 1.8)
80
- simplecov-html (~> 0.10.0)
81
- simplecov-html (0.10.0)
82
- slop (3.6.0)
83
- term-ansicolor (1.3.2)
84
- tins (~> 1.0)
85
- thor (0.19.1)
86
- tins (1.6.0)
87
- unf (0.1.4)
88
- unf_ext
89
- unf_ext (0.0.7.1)
90
- webmock (1.21.0)
91
- addressable (>= 2.3.6)
92
- crack (>= 0.3.2)
93
- yard (0.8.7.6)
94
-
95
- PLATFORMS
96
- ruby
97
-
98
- DEPENDENCIES
99
- appium_thor (~> 1.0.1)
100
- bundler (~> 1.10.6)
101
- coveralls
102
- parallel_tests (~> 1.7.0)
103
- pry (~> 0.10.1)
104
- rspec (~> 3.3.0)
105
- rubocop (~> 0.33.0)
106
- sauce_overage!
107
- webmock (~> 1.21.0)
108
-
109
- BUNDLED WITH
110
- 1.10.6
@@ -1,20 +0,0 @@
1
- module SauceOverage
2
- module SauceUtils
3
- # from: https://raw.githubusercontent.com/bootstraponline/webdriver_utils/master/lib/webdriver_utils/sauce.rb
4
- # top level sauce helper methods
5
-
6
- # Returns sauce username if env is set and not empty.
7
- # If env isn't defined then nil is returned.
8
- def sauce_user
9
- env = ENV['SAUCE_USERNAME']
10
- (env && !env.empty?) ? env : nil
11
- end
12
-
13
- # Returns sauce key if env is set and not empty.
14
- # If env isn't defined then nil is returned.
15
- def sauce_key
16
- env = ENV['SAUCE_ACCESS_KEY']
17
- (env && !env.empty?) ? env : nil
18
- end
19
- end
20
- end