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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 096d4881852bec3bc9671df6c024876fe2a57d97
4
- data.tar.gz: e3c8a3aef727a224d3fbdd4d0de0594893db9d8c
3
+ metadata.gz: 2def872d86cf0afbde064ca9577703edacfb99a7
4
+ data.tar.gz: 1a92c9b20983c00800a72d201ee88e0dfaa28d74
5
5
  SHA512:
6
- metadata.gz: 0833ad669954a8b991bf2e4f91ab65c76ca11fd29acb888daaf281ff3611b2acfef60c8c5982b7d06638708b18221156380e66671deb1c181f1487a75a5db620
7
- data.tar.gz: 8f91884e1c5abe7087bd9d53670519eeca845800ca47890db035442d628f89505555cafe52a7550930a2c291a0a100f6c3e638c9fa4134e3d9f613a27ef2369c
6
+ metadata.gz: 57f341a02d1cdadd2c19f191cf8f00b4ab3c354bb2b98ef46fb25fad3a5c412a6af64e296f1f2a4b02b1dc7982c8b57f128415669ce0b0a3d0d53e8f189bd00f
7
+ data.tar.gz: a082d0bb77e2e77470f2d124fe15e92d0ea333f740191293bd2123a236f82507f6d07fbfeaedec2f0e407846ee6175009071f0cad0bd5dbb4df91175a8cc36e9
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- percy-client (1.6.0)
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.0)
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
- #### Docs here: [https://percy.io/docs/api/client](https://percy.io/docs/api/client)
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
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  class Client
3
- VERSION = '1.6.0'
3
+ VERSION = '1.7.0'
4
4
  end
5
5
  end
@@ -11,7 +11,7 @@ RSpec.describe Percy::Client::Builds, :vcr do
11
11
  'data' => {
12
12
  'type' => 'builds',
13
13
  'attributes' => {
14
- 'branch' => 'master',
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.6.0
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-07-07 00:00:00.000000000 Z
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.2.2
176
+ rubygems_version: 2.4.8
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Percy::Client