percy-capybara 2.3.5 → 2.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11f1dee5dd730cd181442f4c90c09b525fcc3e7e
4
- data.tar.gz: dde1b522f4bb4447e61f10d1816aaea6ca1007ad
3
+ metadata.gz: 09d303f9090ad8ce75b13714c58bcec25d711602
4
+ data.tar.gz: 108512d47e2d4e67e84cdfa2b9456e5368ac58a2
5
5
  SHA512:
6
- metadata.gz: 807c1b706fc28de2da15f780afed95706828e8171847d866efdf29640759caa6dfd27569a7b46976fe2b032dc8d67fa43cbe9e55d2fd5cf0262d45eb07910b4d
7
- data.tar.gz: cdcdf1d0cf88c23849248f88b0607158f57a07b9e24b56940a04ffcba5a94d48d4e419ffd9fad8e124a9886dc5b8badb1c9f489effd11dc3d0e7661fa508f2f9
6
+ metadata.gz: 67e7111b3708fbad2de5475ee88e8f74b9f47b25a30b66ba06e32372df70d15ccc8fb3d0e43052eeee3b82d1189209326c292691585c8d20b35a0205913184a2
7
+ data.tar.gz: 2dd5b305baaa6f592c84218537f2d1a125b9a78ffbc6d59bfcf1cf442fba38719edc6006494de46ae6bc6134f900f0f8390feb56515f82e988d731fd7104f42d
@@ -38,7 +38,14 @@ module Percy
38
38
  # Create the snapshot and upload any missing snapshot resources.
39
39
  start = Time.now
40
40
  rescue_connection_failures do
41
- snapshot = client.create_snapshot(current_build_id, resources, options)
41
+ begin
42
+ snapshot = client.create_snapshot(current_build_id, resources, options)
43
+ rescue Percy::Client::BadRequestError => e
44
+ Percy.logger.warn('Bad request error, skipping snapshot:')
45
+ Percy.logger.warn(e)
46
+ return
47
+ end
48
+
42
49
  snapshot['data']['relationships']['missing-resources']['data'].each do |missing_resource|
43
50
  sha = missing_resource['id']
44
51
  client.upload_resource(current_build_id, resource_map[sha].content)
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  module Capybara
3
- VERSION = '2.3.5'
3
+ VERSION = '2.3.6'
4
4
  end
5
5
  end
@@ -79,6 +79,12 @@ RSpec.describe Percy::Capybara::Client::Snapshots, type: :feature do
79
79
  expect(result).to eq(true)
80
80
  expect(capybara_client.failed?).to eq(false)
81
81
  end
82
+ it 'safely handles snapshot bad request errors' do
83
+ error = Percy::Client::BadRequestError.new(400, '', '', '', 'snapshot error msg')
84
+ expect(capybara_client.client).to receive(:create_snapshot).and_raise(error)
85
+ expect(capybara_client.snapshot(page)).to eq(nil)
86
+ expect(capybara_client.failed?).to eq(false) # Build is not failed.
87
+ end
82
88
  it 'safely handles connection errors' do
83
89
  expect(capybara_client.client).to receive(:create_snapshot)
84
90
  .and_raise(Percy::Client::ConnectionFailed)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percy-capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perceptual Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-07 00:00:00.000000000 Z
11
+ date: 2017-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: percy-client