sauce_whisk 0.0.16 → 0.0.17

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: a508906722431bc92733a47e7f2cfe623f019911
4
- data.tar.gz: 7df76bb1f9a6367a707c7662594e706f4fa787e1
3
+ metadata.gz: e4b099fc29dacd4b928198d697bd9c5d9dec0546
4
+ data.tar.gz: dd6813d53c45d7629c14ea73d14ad92297bbddf4
5
5
  SHA512:
6
- metadata.gz: 7480a0ffc3fede0aaa4fb226039c5fdb16a77a90f3146f982a9237a8622105de464d32716f4389f1e9f8d805ee874112caaec6178cfb2be4429806d2ec4b463b
7
- data.tar.gz: 2e59765f7c437561c48096dce1e0fc5a72eadfd7680ab6df1e238dc57d06a98bf71d6d1fd11d82f2105a03f8c7908a716f939eb1b34e6bf05d884f2dcea93e80
6
+ metadata.gz: 0d65dfa347b4ea90eadc55e706a50fb98ed6c505fd4f711a8f96ebd2a7717e0cdc3644a88100180467eaaeb943af9cc68495b9ac7b11af87b3f465dafa23efa2
7
+ data.tar.gz: 7e27aaa017ac01a3915d3727834f6e23a79a2d8e0a02908297e08f212bbc4a81f5cd2092b6e4ee792340ad6715ce9d29dc04b26a7f53f5531c05964e3513553a
data/README.md CHANGED
@@ -32,10 +32,18 @@ You'll need a [Sauce Labs account](http://wwww.saucelabs.com/signup). They're f
32
32
  |:username | SAUCE_USERNAME | Your Sauce Labs Username |
33
33
  |:access\_key | SAUCE\_ACCESS\_KEY| Your Access Key, found on the lower left of your Account page (Not your password!) |
34
34
  |:asset\_fetch\_retries | SAUCE\_ASSET\_FETCH\_RETRY | Number of times to retry fetching assets |
35
+ |:rest_retries | SAUCE_REST_RETRIES | Number of times to try failing REST calls |
36
+
35
37
 
36
38
  ### Locations
37
39
  There are three ways to configure SauceWhisk. The gem tries each of the following locations in turn.
38
40
 
41
+ #### Directly on the SauceWhisk object
42
+ `asset_fetch_retries` and `rest_retries` can be set directly on the SauceWhisk object:
43
+ ```ruby
44
+ SauceWhisk.asset_fetch_retries = 5
45
+ ```
46
+
39
47
  #### The Sauce gem
40
48
  If you have the Sauce gem required, the SauceWhisk gem will try to read its configuration from the Sauce gem's configuration.
41
49
 
@@ -90,6 +98,19 @@ NB: It's not possible to create a new job on Sauce Labs' infrastructure with the
90
98
 
91
99
  ### Updating Job Metadata
92
100
 
101
+ #### Updating Pass or Fail Status
102
+ See [here](#marking-jobs-passed-or-failed)
103
+
104
+ #### Changing job names
105
+ ```ruby
106
+ job = SauceWhisk::Jobs.fetch job_id
107
+ job.name = "Determine if the User can Invite Friends"
108
+
109
+ job.save
110
+ ```
111
+
112
+ #### All possible changes
113
+
93
114
  ```ruby
94
115
  job = SauceWhisk::Jobs.fetch job_id
95
116
  job.build = "12.3.04-beta"
@@ -1,5 +1,8 @@
1
1
  # Major Version 0
2
2
 
3
+ ### 0.0.17
4
+ * Added `asset_fetch_retries=` and `rest_retries=` methods to `SauceWhisk` object. These are used in preference to any other configuration value.
5
+
3
6
  ### 0.0.16
4
7
  * Don't try using 'puts' for the logger
5
8
 
@@ -25,14 +25,30 @@ module SauceWhisk
25
25
  return self.load_first_found(:access_key)
26
26
  end
27
27
 
28
+ def self.asset_fetch_retries=(retries)
29
+ @asset_fetch_retries = retries
30
+ end
31
+
28
32
  def self.asset_fetch_retries
33
+ if @asset_fetch_retries
34
+ return @asset_fetch_retries
35
+ end
36
+
29
37
  retries = self.load_first_found(:asset_fetch_retries)
30
38
 
31
39
  return retries.to_i if retries
32
40
  return 1
33
41
  end
34
42
 
43
+ def self.rest_retries=(retries)
44
+ @rest_retries = retries
45
+ end
46
+
35
47
  def self.rest_retries
48
+ if @rest_retries
49
+ return @rest_retries
50
+ end
51
+
36
52
  retries = self.load_first_found(:rest_retries)
37
53
 
38
54
  return retries.to_i if retries
@@ -1,3 +1,3 @@
1
1
  module SauceWhisk
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.17"
3
3
  end
@@ -42,16 +42,38 @@ describe SauceWhisk do
42
42
  end
43
43
 
44
44
  describe "##asset_fetch_retries" do
45
- it "tries to read from Sauce.config" do
45
+ before :each do
46
46
  SauceWhisk.instance_variable_set(:@asset_fetch_retries, nil)
47
- mock_config = Class.new(Hash) do
48
- def initialize
49
- self.store(:asset_fetch_retries, 3)
47
+ end
48
+
49
+ it "defaults to 1" do
50
+ expect( SauceWhisk.asset_fetch_retries ).to equal 1
51
+ end
52
+
53
+ describe "when a Sauce.config is available" do
54
+ before :each do
55
+ SauceWhisk.instance_variable_set(:@asset_fetch_retries, nil)
56
+ mock_config = Class.new(Hash) do
57
+ def initialize
58
+ self.store(:asset_fetch_retries, 3)
59
+ end
50
60
  end
61
+ stub_const "::Sauce::Config", mock_config
62
+ end
63
+
64
+ it "tries to read from Sauce.config" do
65
+ expect( SauceWhisk.asset_fetch_retries ).to equal 3
66
+ end
67
+
68
+ it "favours values set directly" do
69
+ SauceWhisk.asset_fetch_retries = 4
70
+ expect( SauceWhisk.asset_fetch_retries ).to equal 4
51
71
  end
72
+ end
52
73
 
53
- stub_const "::Sauce::Config", mock_config
54
- expect( SauceWhisk.asset_fetch_retries ).to equal 3
74
+ it "can be set directly" do
75
+ SauceWhisk.asset_fetch_retries = 5
76
+ expect( SauceWhisk.asset_fetch_retries ).to equal 5
55
77
  end
56
78
  end
57
79
 
@@ -61,16 +83,27 @@ describe SauceWhisk do
61
83
  expect( SauceWhisk.rest_retries ).to equal 1
62
84
  end
63
85
 
64
- it "tries to read from Sauce.config" do
65
- SauceWhisk.instance_variable_set(:@rest_retries, nil)
66
- mock_config = Class.new(Hash) do
67
- def initialize
68
- self.store(:rest_retries, 3)
86
+ describe "when a Sauce.config is available" do
87
+
88
+ before :each do
89
+ SauceWhisk.instance_variable_set(:@rest_retries, nil)
90
+ mock_config = Class.new(Hash) do
91
+ def initialize
92
+ self.store(:rest_retries, 3)
93
+ end
69
94
  end
95
+
96
+ stub_const "::Sauce::Config", mock_config
97
+ end
98
+
99
+ it "tries to read from Sauce.config" do
100
+ expect( SauceWhisk.rest_retries ).to equal 3
70
101
  end
71
102
 
72
- stub_const "::Sauce::Config", mock_config
73
- expect( SauceWhisk.rest_retries ).to equal 3
103
+ it "favours values set directly" do
104
+ SauceWhisk.rest_retries = 2
105
+ expect( SauceWhisk.rest_retries ).to equal 2
106
+ end
74
107
  end
75
108
  end
76
109
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce_whisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Lacey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-23 00:00:00.000000000 Z
11
+ date: 2015-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client