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 +4 -4
- data/README.md +21 -0
- data/changelog.markdown +3 -0
- data/lib/sauce_whisk.rb +16 -0
- data/lib/sauce_whisk/version.rb +1 -1
- data/spec/lib/sauce_whisk/sauce_whisk_spec.rb +46 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4b099fc29dacd4b928198d697bd9c5d9dec0546
|
4
|
+
data.tar.gz: dd6813d53c45d7629c14ea73d14ad92297bbddf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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"
|
data/changelog.markdown
CHANGED
data/lib/sauce_whisk.rb
CHANGED
@@ -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
|
data/lib/sauce_whisk/version.rb
CHANGED
@@ -42,16 +42,38 @@ describe SauceWhisk do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
describe "##asset_fetch_retries" do
|
45
|
-
|
45
|
+
before :each do
|
46
46
|
SauceWhisk.instance_variable_set(:@asset_fetch_retries, nil)
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
-
|
54
|
-
|
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
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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
|
-
|
73
|
-
|
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.
|
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:
|
11
|
+
date: 2015-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|