percy-capybara 2.3.5 → 2.3.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09d303f9090ad8ce75b13714c58bcec25d711602
|
4
|
+
data.tar.gz: 108512d47e2d4e67e84cdfa2b9456e5368ac58a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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)
|
@@ -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.
|
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-
|
11
|
+
date: 2017-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: percy-client
|