percy-client 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/lib/percy/client/environment.rb +3 -0
- data/lib/percy/client/version.rb +1 -1
- data/spec/lib/percy/client/builds_spec.rb +1 -1
- data/spec/lib/percy/client/environment_spec.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2def872d86cf0afbde064ca9577703edacfb99a7
|
4
|
+
data.tar.gz: 1a92c9b20983c00800a72d201ee88e0dfaa28d74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57f341a02d1cdadd2c19f191cf8f00b4ab3c354bb2b98ef46fb25fad3a5c412a6af64e296f1f2a4b02b1dc7982c8b57f128415669ce0b0a3d0d53e8f189bd00f
|
7
|
+
data.tar.gz: a082d0bb77e2e77470f2d124fe15e92d0ea333f740191293bd2123a236f82507f6d07fbfeaedec2f0e407846ee6175009071f0cad0bd5dbb4df91175a8cc36e9
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
percy-client (1.
|
4
|
+
percy-client (1.7.0)
|
5
5
|
faraday (>= 0.9)
|
6
6
|
httpclient (>= 2.6)
|
7
7
|
|
@@ -34,7 +34,7 @@ GEM
|
|
34
34
|
guard-compat (~> 1.1)
|
35
35
|
rspec (>= 2.99.0, < 4.0)
|
36
36
|
hitimes (1.2.2)
|
37
|
-
httpclient (2.8.
|
37
|
+
httpclient (2.8.2.2)
|
38
38
|
listen (2.10.0)
|
39
39
|
celluloid (~> 0.16.0)
|
40
40
|
rb-fsevent (>= 0.9.3)
|
data/README.md
CHANGED
@@ -3,4 +3,4 @@
|
|
3
3
|
[![Build Status](https://travis-ci.org/percy/percy-client.svg?branch=master)](https://travis-ci.org/percy/percy-client)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/percy-client.svg)](http://badge.fury.io/rb/percy-client)
|
5
5
|
|
6
|
-
|
6
|
+
### Docs here: [https://percy.io/docs/api/ruby-client](https://percy.io/docs/api/ruby-client)
|
@@ -208,6 +208,9 @@ module Percy
|
|
208
208
|
# Support for https://github.com/ArturT/knapsack
|
209
209
|
var = 'CI_NODE_TOTAL'
|
210
210
|
Integer(ENV[var]) if ENV[var] && !ENV[var].empty?
|
211
|
+
when :codeship
|
212
|
+
var = 'CI_NODE_TOTAL'
|
213
|
+
Integer(ENV[var]) if ENV[var] && !ENV[var].empty?
|
211
214
|
when :semaphore
|
212
215
|
Integer(ENV['SEMAPHORE_THREAD_COUNT'])
|
213
216
|
end
|
data/lib/percy/client/version.rb
CHANGED
@@ -11,7 +11,7 @@ RSpec.describe Percy::Client::Builds, :vcr do
|
|
11
11
|
'data' => {
|
12
12
|
'type' => 'builds',
|
13
13
|
'attributes' => {
|
14
|
-
'branch' =>
|
14
|
+
'branch' => kind_of(String),
|
15
15
|
'target-branch' => nil,
|
16
16
|
'commit-sha' => kind_of(String),
|
17
17
|
'commit-committed-at' => kind_of(String),
|
@@ -40,6 +40,7 @@ RSpec.describe Percy::Client::Environment do
|
|
40
40
|
ENV['CI_PULL_REQUEST'] = nil
|
41
41
|
ENV['CI_COMMIT_ID'] = nil
|
42
42
|
ENV['CI_BUILD_NUMBER'] = nil
|
43
|
+
ENV['CI_NODE_TOTAL'] = nil
|
43
44
|
|
44
45
|
# Unset Drone vars.
|
45
46
|
ENV['CI'] = nil
|
@@ -341,6 +342,7 @@ RSpec.describe Percy::Client::Environment do
|
|
341
342
|
ENV['CI_BUILD_NUMBER'] = 'codeship-build-number'
|
342
343
|
ENV['CI_PULL_REQUEST'] = 'false' # This is always false on Codeship, unfortunately.
|
343
344
|
ENV['CI_COMMIT_ID'] = 'codeship-commit-sha'
|
345
|
+
ENV['CI_NODE_TOTAL'] = '3'
|
344
346
|
end
|
345
347
|
|
346
348
|
describe '#current_ci' do
|
@@ -373,6 +375,15 @@ RSpec.describe Percy::Client::Environment do
|
|
373
375
|
expect(Percy::Client::Environment.parallel_nonce).to eq('codeship-build-number')
|
374
376
|
end
|
375
377
|
end
|
378
|
+
describe '#parallel_total_shards' do
|
379
|
+
it 'reads from the CI environment (the number of nodes)' do
|
380
|
+
expect(Percy::Client::Environment.parallel_total_shards).to eq(3)
|
381
|
+
end
|
382
|
+
it 'is nil if empty' do
|
383
|
+
ENV['CI_NODE_TOTAL'] = ''
|
384
|
+
expect(Percy::Client::Environment.parallel_total_shards).to be_nil
|
385
|
+
end
|
386
|
+
end
|
376
387
|
end
|
377
388
|
context 'in Drone' do
|
378
389
|
before(:each) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: percy-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
175
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.
|
176
|
+
rubygems_version: 2.4.8
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Percy::Client
|