percy-client 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/percy/client/builds.rb +18 -0
- data/lib/percy/client/snapshots.rb +4 -1
- data/lib/percy/client/version.rb +1 -1
- data/spec/cassettes/Percy_Client_Builds/_create_build/accepts_optional_resources.yml +63 -0
- data/spec/cassettes/Percy_Client_Builds/_create_build/creates_a_build.yml +18 -18
- data/spec/cassettes/Percy_Client_Builds/_finalize_build/finalizes_a_build.yml +32 -32
- data/spec/cassettes/Percy_Client_Resources/_upload_resource/returns_true_with_success.yml +65 -65
- data/spec/cassettes/Percy_Client_Snapshots/_create_snapshot/creates_a_build.yml +34 -34
- data/spec/cassettes/Percy_Client_Snapshots/_create_snapshot/fails_if_no_resources_are_given.yml +32 -32
- data/spec/lib/percy/client/builds_spec.rb +21 -0
- data/spec/lib/percy/client/resources_spec.rb +1 -1
- data/spec/lib/percy/client/snapshots_spec.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0887149e63b5fd87582fb37a82c6b3deda06b8ef
|
4
|
+
data.tar.gz: 7ad138203c7e719e754fd320162e7c442f87ea3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12dea291d0fab49b98b4c6e0c1408b6c482d9f7384b99c215fabee64c1590662ff45e91bc60f04f614e0a936dc84351f6b63826b8f51dff03854bf8644d05d46
|
7
|
+
data.tar.gz: ace7abce75c6426c925956be37144ad81dd3f07782153e396aacd2c6e24a76b3f4bb729c66141f0aec407be0a1629267f3d304e736db1656aa7796414c3e838a
|
data/lib/percy/client/builds.rb
CHANGED
@@ -5,6 +5,8 @@ module Percy
|
|
5
5
|
pull_request_number = options[:pull_request_number] ||
|
6
6
|
Percy::Client::Environment.pull_request_number
|
7
7
|
commit_data = options[:commit_data] || Percy::Client::Environment.commit
|
8
|
+
resources = options[:resources]
|
9
|
+
|
8
10
|
data = {
|
9
11
|
'data' => {
|
10
12
|
'type' => 'builds',
|
@@ -21,6 +23,22 @@ module Percy
|
|
21
23
|
},
|
22
24
|
}
|
23
25
|
}
|
26
|
+
|
27
|
+
if resources
|
28
|
+
if !resources.respond_to?(:each)
|
29
|
+
raise ArgumentError.new(
|
30
|
+
'resources argument must be an iterable of Percy::Client::Resource objects')
|
31
|
+
end
|
32
|
+
relationships_data = {
|
33
|
+
'relationships' => {
|
34
|
+
'resources' => {
|
35
|
+
'data' => resources.map { |r| r.serialize },
|
36
|
+
},
|
37
|
+
},
|
38
|
+
}
|
39
|
+
data['data'].merge!(relationships_data)
|
40
|
+
end
|
41
|
+
|
24
42
|
post("#{config.api_url}/repos/#{repo}/builds/", data)
|
25
43
|
end
|
26
44
|
|
@@ -2,7 +2,10 @@ module Percy
|
|
2
2
|
class Client
|
3
3
|
module Snapshots
|
4
4
|
def create_snapshot(build_id, resources, options = {})
|
5
|
-
|
5
|
+
if !resources.respond_to?(:each)
|
6
|
+
raise ArgumentError.new(
|
7
|
+
'resources argument must be an iterable of Percy::Client::Resource objects')
|
8
|
+
end
|
6
9
|
name = options[:name]
|
7
10
|
data = {
|
8
11
|
'data' => {
|
data/lib/percy/client/version.rb
CHANGED
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://localhost:3000/api/v1/repos/fotinakis/percy-examples/builds/
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"data":{"type":"builds","attributes":{"commit-sha":"65478abc7f79b22365c261076cb44478714c4751","commit-branch":"master","commit-committed-at":"2015-06-08
|
9
|
+
16:33:11 -0700","commit-author-name":"<COMMIT_AUTHOR_NAME>","commit-author-email":"<COMMIT_AUTHOR_EMAIL>","commit-committer-name":"<COMMIT_AUTHOR_NAME>","commit-committer-email":"<COMMIT_AUTHOR_EMAIL>","commit-message":"Bump
|
10
|
+
client version.","pull-request-number":"123"},"relationships":{"resources":{"data":[{"type":"resources","id":"ab9ff0a3cf38ce2c95215a9545f89d7a30c28612d0df9762cba33f72006388d9","attributes":{"resource-url":"/css/test.css","mimetype":null,"is-root":null}}]}}}}'
|
11
|
+
headers:
|
12
|
+
User-Agent:
|
13
|
+
- Faraday v0.9.1
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
Date:
|
17
|
+
- Wed, 10 Jun 2015 05:47:47 GMT
|
18
|
+
Content-Type:
|
19
|
+
- application/vnd.api+json
|
20
|
+
Authorization:
|
21
|
+
- Token token="<FILTERED_PERCY_TOKEN>"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 201
|
25
|
+
message: Created
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Wed, 10 Jun 2015 05:47:47 GMT
|
29
|
+
Status:
|
30
|
+
- 201 Created
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
X-Frame-Options:
|
34
|
+
- SAMEORIGIN
|
35
|
+
X-Xss-Protection:
|
36
|
+
- 1; mode=block
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
Access-Control-Allow-Origin:
|
40
|
+
- "*"
|
41
|
+
Access-Control-Allow-Methods:
|
42
|
+
- GET, POST, PUT, PATCH, DELETE, OPTIONS
|
43
|
+
Access-Control-Allow-Headers:
|
44
|
+
- Authorization, Content-Type
|
45
|
+
Cache-Control:
|
46
|
+
- no-cache, no-store, max-age=0, must-revalidate
|
47
|
+
Expires:
|
48
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
49
|
+
Content-Type:
|
50
|
+
- application/json; charset=utf-8
|
51
|
+
X-Request-Id:
|
52
|
+
- bd7dd2cb-e92b-46c7-9b41-a41998b3a783
|
53
|
+
X-Runtime:
|
54
|
+
- '0.518396'
|
55
|
+
Transfer-Encoding:
|
56
|
+
- chunked
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"data":{"id":"31422","type":"builds","attributes":{"build-number":2,"state":"pending","is-pull-request":true,"pull-request-number":123,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:47.124Z","updated-at":"2015-06-10T05:47:47.124Z"},"links":{"self":"/api/v1/builds/31422"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31422/relationships/commit","related":"/api/v1/builds/31422/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31422/relationships/repo","related":"/api/v1/builds/31422/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31422/relationships/base-build","related":"/api/v1/builds/31422/base-build"},"data":{"type":"builds","id":"31421"}},"approved-by":{"links":{"self":"/api/v1/builds/31422/relationships/approved-by","related":"/api/v1/builds/31422/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31422/relationships/snapshots","related":"/api/v1/builds/31422/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31422/relationships/comparisons","related":"/api/v1/builds/31422/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31422/relationships/missing-resources","related":"/api/v1/builds/31422/missing-resources"},"data":[{"type":"resources","id":"ab9ff0a3cf38ce2c95215a9545f89d7a30c28612d0df9762cba33f72006388d9"}]}},"meta":{"finalize-link":"/api/v1/builds/31422/finalize","approve-link":"/api/v1/builds/31422/approve"}},"included":[{"id":"2","type":"commits","attributes":{"sha":"65478abc7f79b22365c261076cb44478714c4751","branch":"master","message":"Bump
|
60
|
+
client version.","committed-at":"2015-06-08 16:33:11 -0700","author-name":"<COMMIT_AUTHOR_NAME>","committer-name":"<COMMIT_AUTHOR_NAME>","created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:46.000Z"},"links":{"self":"/api/v1/commits/2"}},{"id":"31421","type":"builds","attributes":{"build-number":1,"state":"finished","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:47.000Z"},"links":{"self":"/api/v1/builds/31421"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31421/relationships/commit","related":"/api/v1/builds/31421/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31421/relationships/repo","related":"/api/v1/builds/31421/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31421/relationships/base-build","related":"/api/v1/builds/31421/base-build"}},"approved-by":{"links":{"self":"/api/v1/builds/31421/relationships/approved-by","related":"/api/v1/builds/31421/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31421/relationships/snapshots","related":"/api/v1/builds/31421/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31421/relationships/comparisons","related":"/api/v1/builds/31421/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31421/relationships/missing-resources","related":"/api/v1/builds/31421/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31421/finalize","approve-link":"/api/v1/builds/31421/approve"}},{"id":"ab9ff0a3cf38ce2c95215a9545f89d7a30c28612d0df9762cba33f72006388d9","type":"resources","attributes":{},"links":{"self":"/api/v1/resources/ab9ff0a3cf38ce2c95215a9545f89d7a30c28612d0df9762cba33f72006388d9"}}]}'
|
61
|
+
http_version:
|
62
|
+
recorded_at: Wed, 10 Jun 2015 05:47:47 GMT
|
63
|
+
recorded_with: VCR 2.9.3
|
@@ -5,16 +5,16 @@ http_interactions:
|
|
5
5
|
uri: http://localhost:3000/api/v1/repos/fotinakis/percy-examples/builds/
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"data":{"type":"builds","attributes":{"commit-sha":"
|
9
|
-
|
10
|
-
version.","pull-request-number":"123"}}}'
|
8
|
+
string: '{"data":{"type":"builds","attributes":{"commit-sha":"65478abc7f79b22365c261076cb44478714c4751","commit-branch":"master","commit-committed-at":"2015-06-08
|
9
|
+
16:33:11 -0700","commit-author-name":"<COMMIT_AUTHOR_NAME>","commit-author-email":"<COMMIT_AUTHOR_EMAIL>","commit-committer-name":"<COMMIT_AUTHOR_NAME>","commit-committer-email":"<COMMIT_AUTHOR_EMAIL>","commit-message":"Bump
|
10
|
+
client version.","pull-request-number":"123"}}}'
|
11
11
|
headers:
|
12
12
|
User-Agent:
|
13
13
|
- Faraday v0.9.1
|
14
14
|
Accept:
|
15
15
|
- "*/*"
|
16
16
|
Date:
|
17
|
-
- Wed,
|
17
|
+
- Wed, 10 Jun 2015 05:47:47 GMT
|
18
18
|
Content-Type:
|
19
19
|
- application/vnd.api+json
|
20
20
|
Authorization:
|
@@ -22,8 +22,14 @@ http_interactions:
|
|
22
22
|
response:
|
23
23
|
status:
|
24
24
|
code: 201
|
25
|
-
message:
|
25
|
+
message: Created
|
26
26
|
headers:
|
27
|
+
Date:
|
28
|
+
- Wed, 10 Jun 2015 05:47:48 GMT
|
29
|
+
Status:
|
30
|
+
- 201 Created
|
31
|
+
Connection:
|
32
|
+
- close
|
27
33
|
X-Frame-Options:
|
28
34
|
- SAMEORIGIN
|
29
35
|
X-Xss-Protection:
|
@@ -43,21 +49,15 @@ http_interactions:
|
|
43
49
|
Content-Type:
|
44
50
|
- application/json; charset=utf-8
|
45
51
|
X-Request-Id:
|
46
|
-
-
|
52
|
+
- 1aff50d1-46bc-4c99-bd95-fbc9af6697fa
|
47
53
|
X-Runtime:
|
48
|
-
- '0.
|
49
|
-
|
50
|
-
-
|
51
|
-
Date:
|
52
|
-
- Wed, 03 Jun 2015 17:55:10 GMT
|
53
|
-
Content-Length:
|
54
|
-
- '2679'
|
55
|
-
Connection:
|
56
|
-
- Keep-Alive
|
54
|
+
- '0.437441'
|
55
|
+
Transfer-Encoding:
|
56
|
+
- chunked
|
57
57
|
body:
|
58
58
|
encoding: UTF-8
|
59
|
-
string: '{"data":{"id":"
|
60
|
-
version.","committed-at":"2015-06-
|
59
|
+
string: '{"data":{"id":"31423","type":"builds","attributes":{"build-number":3,"state":"pending","is-pull-request":true,"pull-request-number":123,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:47.682Z","updated-at":"2015-06-10T05:47:47.682Z"},"links":{"self":"/api/v1/builds/31423"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31423/relationships/commit","related":"/api/v1/builds/31423/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31423/relationships/repo","related":"/api/v1/builds/31423/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31423/relationships/base-build","related":"/api/v1/builds/31423/base-build"},"data":{"type":"builds","id":"31421"}},"approved-by":{"links":{"self":"/api/v1/builds/31423/relationships/approved-by","related":"/api/v1/builds/31423/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31423/relationships/snapshots","related":"/api/v1/builds/31423/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31423/relationships/comparisons","related":"/api/v1/builds/31423/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31423/relationships/missing-resources","related":"/api/v1/builds/31423/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31423/finalize","approve-link":"/api/v1/builds/31423/approve"}},"included":[{"id":"2","type":"commits","attributes":{"sha":"65478abc7f79b22365c261076cb44478714c4751","branch":"master","message":"Bump
|
60
|
+
client version.","committed-at":"2015-06-08 16:33:11 -0700","author-name":"<COMMIT_AUTHOR_NAME>","committer-name":"<COMMIT_AUTHOR_NAME>","created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:46.000Z"},"links":{"self":"/api/v1/commits/2"}},{"id":"31421","type":"builds","attributes":{"build-number":1,"state":"finished","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:47.000Z"},"links":{"self":"/api/v1/builds/31421"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31421/relationships/commit","related":"/api/v1/builds/31421/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31421/relationships/repo","related":"/api/v1/builds/31421/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31421/relationships/base-build","related":"/api/v1/builds/31421/base-build"}},"approved-by":{"links":{"self":"/api/v1/builds/31421/relationships/approved-by","related":"/api/v1/builds/31421/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31421/relationships/snapshots","related":"/api/v1/builds/31421/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31421/relationships/comparisons","related":"/api/v1/builds/31421/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31421/relationships/missing-resources","related":"/api/v1/builds/31421/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31421/finalize","approve-link":"/api/v1/builds/31421/approve"}}]}'
|
61
61
|
http_version:
|
62
|
-
recorded_at: Wed,
|
62
|
+
recorded_at: Wed, 10 Jun 2015 05:47:48 GMT
|
63
63
|
recorded_with: VCR 2.9.3
|
@@ -5,16 +5,16 @@ http_interactions:
|
|
5
5
|
uri: http://localhost:3000/api/v1/repos/fotinakis/percy-examples/builds/
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"data":{"type":"builds","attributes":{"commit-sha":"
|
9
|
-
|
10
|
-
version.","pull-request-number":null}}}'
|
8
|
+
string: '{"data":{"type":"builds","attributes":{"commit-sha":"65478abc7f79b22365c261076cb44478714c4751","commit-branch":"master","commit-committed-at":"2015-06-08
|
9
|
+
16:33:11 -0700","commit-author-name":"<COMMIT_AUTHOR_NAME>","commit-author-email":"<COMMIT_AUTHOR_EMAIL>","commit-committer-name":"<COMMIT_AUTHOR_NAME>","commit-committer-email":"<COMMIT_AUTHOR_EMAIL>","commit-message":"Bump
|
10
|
+
client version.","pull-request-number":null}}}'
|
11
11
|
headers:
|
12
12
|
User-Agent:
|
13
13
|
- Faraday v0.9.1
|
14
14
|
Accept:
|
15
15
|
- "*/*"
|
16
16
|
Date:
|
17
|
-
- Wed,
|
17
|
+
- Wed, 10 Jun 2015 05:47:46 GMT
|
18
18
|
Content-Type:
|
19
19
|
- application/vnd.api+json
|
20
20
|
Authorization:
|
@@ -22,8 +22,14 @@ http_interactions:
|
|
22
22
|
response:
|
23
23
|
status:
|
24
24
|
code: 201
|
25
|
-
message:
|
25
|
+
message: Created
|
26
26
|
headers:
|
27
|
+
Date:
|
28
|
+
- Wed, 10 Jun 2015 05:47:46 GMT
|
29
|
+
Status:
|
30
|
+
- 201 Created
|
31
|
+
Connection:
|
32
|
+
- close
|
27
33
|
X-Frame-Options:
|
28
34
|
- SAMEORIGIN
|
29
35
|
X-Xss-Protection:
|
@@ -43,26 +49,20 @@ http_interactions:
|
|
43
49
|
Content-Type:
|
44
50
|
- application/json; charset=utf-8
|
45
51
|
X-Request-Id:
|
46
|
-
-
|
52
|
+
- 3041884c-5f5f-48cd-9760-76da566aeeed
|
47
53
|
X-Runtime:
|
48
|
-
- '0.
|
49
|
-
|
50
|
-
-
|
51
|
-
Date:
|
52
|
-
- Wed, 03 Jun 2015 17:55:09 GMT
|
53
|
-
Content-Length:
|
54
|
-
- '1532'
|
55
|
-
Connection:
|
56
|
-
- Keep-Alive
|
54
|
+
- '0.105519'
|
55
|
+
Transfer-Encoding:
|
56
|
+
- chunked
|
57
57
|
body:
|
58
58
|
encoding: UTF-8
|
59
|
-
string: '{"data":{"id":"
|
60
|
-
version.","committed-at":"2015-06-
|
59
|
+
string: '{"data":{"id":"31421","type":"builds","attributes":{"build-number":1,"state":"pending","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:46.952Z","updated-at":"2015-06-10T05:47:46.952Z"},"links":{"self":"/api/v1/builds/31421"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31421/relationships/commit","related":"/api/v1/builds/31421/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31421/relationships/repo","related":"/api/v1/builds/31421/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31421/relationships/base-build","related":"/api/v1/builds/31421/base-build"},"data":null},"approved-by":{"links":{"self":"/api/v1/builds/31421/relationships/approved-by","related":"/api/v1/builds/31421/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31421/relationships/snapshots","related":"/api/v1/builds/31421/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31421/relationships/comparisons","related":"/api/v1/builds/31421/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31421/relationships/missing-resources","related":"/api/v1/builds/31421/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31421/finalize","approve-link":"/api/v1/builds/31421/approve"}},"included":[{"id":"2","type":"commits","attributes":{"sha":"65478abc7f79b22365c261076cb44478714c4751","branch":"master","message":"Bump
|
60
|
+
client version.","committed-at":"2015-06-08 16:33:11 -0700","author-name":"<COMMIT_AUTHOR_NAME>","committer-name":"<COMMIT_AUTHOR_NAME>","created-at":"2015-06-10T05:47:46.944Z","updated-at":"2015-06-10T05:47:46.944Z"},"links":{"self":"/api/v1/commits/2"}}]}'
|
61
61
|
http_version:
|
62
|
-
recorded_at: Wed,
|
62
|
+
recorded_at: Wed, 10 Jun 2015 05:47:46 GMT
|
63
63
|
- request:
|
64
64
|
method: post
|
65
|
-
uri: http://localhost:3000/api/v1/builds/
|
65
|
+
uri: http://localhost:3000/api/v1/builds/31421/finalize
|
66
66
|
body:
|
67
67
|
encoding: UTF-8
|
68
68
|
string: "{}"
|
@@ -72,7 +72,7 @@ http_interactions:
|
|
72
72
|
Accept:
|
73
73
|
- "*/*"
|
74
74
|
Date:
|
75
|
-
- Wed,
|
75
|
+
- Wed, 10 Jun 2015 05:47:46 GMT
|
76
76
|
Content-Type:
|
77
77
|
- application/vnd.api+json
|
78
78
|
Authorization:
|
@@ -80,8 +80,14 @@ http_interactions:
|
|
80
80
|
response:
|
81
81
|
status:
|
82
82
|
code: 200
|
83
|
-
message:
|
83
|
+
message: OK
|
84
84
|
headers:
|
85
|
+
Date:
|
86
|
+
- Wed, 10 Jun 2015 05:47:47 GMT
|
87
|
+
Status:
|
88
|
+
- 200 OK
|
89
|
+
Connection:
|
90
|
+
- close
|
85
91
|
X-Frame-Options:
|
86
92
|
- SAMEORIGIN
|
87
93
|
X-Xss-Protection:
|
@@ -101,20 +107,14 @@ http_interactions:
|
|
101
107
|
Content-Type:
|
102
108
|
- application/json; charset=utf-8
|
103
109
|
X-Request-Id:
|
104
|
-
-
|
110
|
+
- e7683121-641a-4b3e-8131-c6f2a4b296b7
|
105
111
|
X-Runtime:
|
106
|
-
- '0.
|
107
|
-
|
108
|
-
-
|
109
|
-
Date:
|
110
|
-
- Wed, 03 Jun 2015 17:55:09 GMT
|
111
|
-
Content-Length:
|
112
|
-
- '16'
|
113
|
-
Connection:
|
114
|
-
- Keep-Alive
|
112
|
+
- '0.059485'
|
113
|
+
Transfer-Encoding:
|
114
|
+
- chunked
|
115
115
|
body:
|
116
116
|
encoding: UTF-8
|
117
117
|
string: '{"success":true}'
|
118
118
|
http_version:
|
119
|
-
recorded_at: Wed,
|
119
|
+
recorded_at: Wed, 10 Jun 2015 05:47:47 GMT
|
120
120
|
recorded_with: VCR 2.9.3
|
@@ -5,16 +5,16 @@ http_interactions:
|
|
5
5
|
uri: http://localhost:3000/api/v1/repos/fotinakis/percy-examples/builds/
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"data":{"type":"builds","attributes":{"commit-sha":"
|
9
|
-
|
10
|
-
version.","pull-request-number":null}}}'
|
8
|
+
string: '{"data":{"type":"builds","attributes":{"commit-sha":"65478abc7f79b22365c261076cb44478714c4751","commit-branch":"master","commit-committed-at":"2015-06-08
|
9
|
+
16:33:11 -0700","commit-author-name":"<COMMIT_AUTHOR_NAME>","commit-author-email":"<COMMIT_AUTHOR_EMAIL>","commit-committer-name":"<COMMIT_AUTHOR_NAME>","commit-committer-email":"<COMMIT_AUTHOR_EMAIL>","commit-message":"Bump
|
10
|
+
client version.","pull-request-number":null}}}'
|
11
11
|
headers:
|
12
12
|
User-Agent:
|
13
13
|
- Faraday v0.9.1
|
14
14
|
Accept:
|
15
15
|
- "*/*"
|
16
16
|
Date:
|
17
|
-
- Wed,
|
17
|
+
- Wed, 10 Jun 2015 05:47:48 GMT
|
18
18
|
Content-Type:
|
19
19
|
- application/vnd.api+json
|
20
20
|
Authorization:
|
@@ -22,8 +22,14 @@ http_interactions:
|
|
22
22
|
response:
|
23
23
|
status:
|
24
24
|
code: 201
|
25
|
-
message:
|
25
|
+
message: Created
|
26
26
|
headers:
|
27
|
+
Date:
|
28
|
+
- Wed, 10 Jun 2015 05:47:48 GMT
|
29
|
+
Status:
|
30
|
+
- 201 Created
|
31
|
+
Connection:
|
32
|
+
- close
|
27
33
|
X-Frame-Options:
|
28
34
|
- SAMEORIGIN
|
29
35
|
X-Xss-Protection:
|
@@ -43,36 +49,30 @@ http_interactions:
|
|
43
49
|
Content-Type:
|
44
50
|
- application/json; charset=utf-8
|
45
51
|
X-Request-Id:
|
46
|
-
-
|
52
|
+
- 7366b3ff-cf23-4afc-8a03-57c7145faa15
|
47
53
|
X-Runtime:
|
48
|
-
- '0.
|
49
|
-
|
50
|
-
-
|
51
|
-
Date:
|
52
|
-
- Wed, 03 Jun 2015 17:55:09 GMT
|
53
|
-
Content-Length:
|
54
|
-
- '1532'
|
55
|
-
Connection:
|
56
|
-
- Keep-Alive
|
54
|
+
- '0.067419'
|
55
|
+
Transfer-Encoding:
|
56
|
+
- chunked
|
57
57
|
body:
|
58
58
|
encoding: UTF-8
|
59
|
-
string: '{"data":{"id":"
|
60
|
-
version.","committed-at":"2015-06-
|
59
|
+
string: '{"data":{"id":"31424","type":"builds","attributes":{"build-number":4,"state":"pending","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:48.210Z","updated-at":"2015-06-10T05:47:48.210Z"},"links":{"self":"/api/v1/builds/31424"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31424/relationships/commit","related":"/api/v1/builds/31424/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31424/relationships/repo","related":"/api/v1/builds/31424/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31424/relationships/base-build","related":"/api/v1/builds/31424/base-build"},"data":{"type":"builds","id":"31421"}},"approved-by":{"links":{"self":"/api/v1/builds/31424/relationships/approved-by","related":"/api/v1/builds/31424/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31424/relationships/snapshots","related":"/api/v1/builds/31424/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31424/relationships/comparisons","related":"/api/v1/builds/31424/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31424/relationships/missing-resources","related":"/api/v1/builds/31424/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31424/finalize","approve-link":"/api/v1/builds/31424/approve"}},"included":[{"id":"2","type":"commits","attributes":{"sha":"65478abc7f79b22365c261076cb44478714c4751","branch":"master","message":"Bump
|
60
|
+
client version.","committed-at":"2015-06-08 16:33:11 -0700","author-name":"<COMMIT_AUTHOR_NAME>","committer-name":"<COMMIT_AUTHOR_NAME>","created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:46.000Z"},"links":{"self":"/api/v1/commits/2"}},{"id":"31421","type":"builds","attributes":{"build-number":1,"state":"finished","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:47.000Z"},"links":{"self":"/api/v1/builds/31421"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31421/relationships/commit","related":"/api/v1/builds/31421/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31421/relationships/repo","related":"/api/v1/builds/31421/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31421/relationships/base-build","related":"/api/v1/builds/31421/base-build"}},"approved-by":{"links":{"self":"/api/v1/builds/31421/relationships/approved-by","related":"/api/v1/builds/31421/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31421/relationships/snapshots","related":"/api/v1/builds/31421/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31421/relationships/comparisons","related":"/api/v1/builds/31421/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31421/relationships/missing-resources","related":"/api/v1/builds/31421/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31421/finalize","approve-link":"/api/v1/builds/31421/approve"}}]}'
|
61
61
|
http_version:
|
62
|
-
recorded_at: Wed,
|
62
|
+
recorded_at: Wed, 10 Jun 2015 05:47:48 GMT
|
63
63
|
- request:
|
64
64
|
method: post
|
65
|
-
uri: http://localhost:3000/api/v1/builds/
|
65
|
+
uri: http://localhost:3000/api/v1/builds/31424/snapshots/
|
66
66
|
body:
|
67
67
|
encoding: UTF-8
|
68
|
-
string: '{"data":{"type":"snapshots","attributes":{"name":"homepage"},"relationships":{"resources":{"data":[{"type":"resources","id":"
|
68
|
+
string: '{"data":{"type":"snapshots","attributes":{"name":"homepage"},"relationships":{"resources":{"data":[{"type":"resources","id":"b53960b166ed18f5ef9c65e387ce43f31b3e233b2732dd9e8e143058a7271369","attributes":{"resource-url":"/foo/test.html","mimetype":null,"is-root":true}}]}}}}'
|
69
69
|
headers:
|
70
70
|
User-Agent:
|
71
71
|
- Faraday v0.9.1
|
72
72
|
Accept:
|
73
73
|
- "*/*"
|
74
74
|
Date:
|
75
|
-
- Wed,
|
75
|
+
- Wed, 10 Jun 2015 05:47:48 GMT
|
76
76
|
Content-Type:
|
77
77
|
- application/vnd.api+json
|
78
78
|
Authorization:
|
@@ -80,8 +80,14 @@ http_interactions:
|
|
80
80
|
response:
|
81
81
|
status:
|
82
82
|
code: 201
|
83
|
-
message:
|
83
|
+
message: Created
|
84
84
|
headers:
|
85
|
+
Date:
|
86
|
+
- Wed, 10 Jun 2015 05:47:48 GMT
|
87
|
+
Status:
|
88
|
+
- 201 Created
|
89
|
+
Connection:
|
90
|
+
- close
|
85
91
|
X-Frame-Options:
|
86
92
|
- SAMEORIGIN
|
87
93
|
X-Xss-Protection:
|
@@ -101,35 +107,29 @@ http_interactions:
|
|
101
107
|
Content-Type:
|
102
108
|
- application/json; charset=utf-8
|
103
109
|
X-Request-Id:
|
104
|
-
-
|
110
|
+
- 07ca2efe-71bc-4770-a2e7-b422be5e9e3b
|
105
111
|
X-Runtime:
|
106
|
-
- '0.
|
107
|
-
|
108
|
-
-
|
109
|
-
Date:
|
110
|
-
- Wed, 03 Jun 2015 17:55:09 GMT
|
111
|
-
Content-Length:
|
112
|
-
- '1574'
|
113
|
-
Connection:
|
114
|
-
- Keep-Alive
|
112
|
+
- '0.024594'
|
113
|
+
Transfer-Encoding:
|
114
|
+
- chunked
|
115
115
|
body:
|
116
116
|
encoding: UTF-8
|
117
|
-
string: '{"data":{"id":"
|
117
|
+
string: '{"data":{"id":"3","type":"snapshots","attributes":{"name":"homepage","created-at":"2015-06-10T05:47:48.251Z","updated-at":"2015-06-10T05:47:48.251Z","finished-processing-at":null},"links":{"self":"/api/v1/snapshots/3"},"relationships":{"build":{"links":{"self":"/api/v1/snapshots/3/relationships/build","related":"/api/v1/snapshots/3/build"}},"screenshots":{"links":{"self":"/api/v1/snapshots/3/relationships/screenshots","related":"/api/v1/snapshots/3/screenshots"}},"missing-resources":{"links":{"self":"/api/v1/snapshots/3/relationships/missing-resources","related":"/api/v1/snapshots/3/missing-resources"},"data":[{"type":"resources","id":"b53960b166ed18f5ef9c65e387ce43f31b3e233b2732dd9e8e143058a7271369"}]}}},"included":[{"id":"b53960b166ed18f5ef9c65e387ce43f31b3e233b2732dd9e8e143058a7271369","type":"resources","attributes":{},"links":{"self":"/api/v1/resources/b53960b166ed18f5ef9c65e387ce43f31b3e233b2732dd9e8e143058a7271369"}}]}'
|
118
118
|
http_version:
|
119
|
-
recorded_at: Wed,
|
119
|
+
recorded_at: Wed, 10 Jun 2015 05:47:48 GMT
|
120
120
|
- request:
|
121
121
|
method: post
|
122
|
-
uri: http://localhost:3000/api/v1/builds/
|
122
|
+
uri: http://localhost:3000/api/v1/builds/31424/resources/
|
123
123
|
body:
|
124
124
|
encoding: UTF-8
|
125
|
-
string: '{"data":{"type":"resources","attributes":{"id":"
|
125
|
+
string: '{"data":{"type":"resources","attributes":{"id":"b53960b166ed18f5ef9c65e387ce43f31b3e233b2732dd9e8e143058a7271369","base64-content":"aGVsbG8gd29ybGQhIC9Vc2Vycy9mb3RpbmFraXMvc3JjL3BlcmN5LWNsaWVudC9zcGVjL2xpYi9wZXJjeS9jbGllbnQvcmVzb3VyY2VzX3NwZWMucmI="}}}'
|
126
126
|
headers:
|
127
127
|
User-Agent:
|
128
128
|
- Faraday v0.9.1
|
129
129
|
Accept:
|
130
130
|
- "*/*"
|
131
131
|
Date:
|
132
|
-
- Wed,
|
132
|
+
- Wed, 10 Jun 2015 05:47:48 GMT
|
133
133
|
Content-Type:
|
134
134
|
- application/vnd.api+json
|
135
135
|
Authorization:
|
@@ -137,8 +137,14 @@ http_interactions:
|
|
137
137
|
response:
|
138
138
|
status:
|
139
139
|
code: 201
|
140
|
-
message:
|
140
|
+
message: Created
|
141
141
|
headers:
|
142
|
+
Date:
|
143
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
144
|
+
Status:
|
145
|
+
- 201 Created
|
146
|
+
Connection:
|
147
|
+
- close
|
142
148
|
X-Frame-Options:
|
143
149
|
- SAMEORIGIN
|
144
150
|
X-Xss-Protection:
|
@@ -158,35 +164,29 @@ http_interactions:
|
|
158
164
|
Content-Type:
|
159
165
|
- application/json; charset=utf-8
|
160
166
|
X-Request-Id:
|
161
|
-
-
|
167
|
+
- 40daddeb-0add-4f2a-8d14-758b43be8589
|
162
168
|
X-Runtime:
|
163
|
-
- '
|
164
|
-
|
165
|
-
-
|
166
|
-
Date:
|
167
|
-
- Wed, 03 Jun 2015 17:55:09 GMT
|
168
|
-
Content-Length:
|
169
|
-
- '16'
|
170
|
-
Connection:
|
171
|
-
- Keep-Alive
|
169
|
+
- '1.314255'
|
170
|
+
Transfer-Encoding:
|
171
|
+
- chunked
|
172
172
|
body:
|
173
173
|
encoding: UTF-8
|
174
174
|
string: '{"success":true}'
|
175
175
|
http_version:
|
176
|
-
recorded_at: Wed,
|
176
|
+
recorded_at: Wed, 10 Jun 2015 05:47:49 GMT
|
177
177
|
- request:
|
178
178
|
method: post
|
179
|
-
uri: http://localhost:3000/api/v1/builds/
|
179
|
+
uri: http://localhost:3000/api/v1/builds/31424/resources/
|
180
180
|
body:
|
181
181
|
encoding: UTF-8
|
182
|
-
string: '{"data":{"type":"resources","attributes":{"id":"
|
182
|
+
string: '{"data":{"type":"resources","attributes":{"id":"b53960b166ed18f5ef9c65e387ce43f31b3e233b2732dd9e8e143058a7271369","base64-content":"aGVsbG8gd29ybGQhIC9Vc2Vycy9mb3RpbmFraXMvc3JjL3BlcmN5LWNsaWVudC9zcGVjL2xpYi9wZXJjeS9jbGllbnQvcmVzb3VyY2VzX3NwZWMucmI="}}}'
|
183
183
|
headers:
|
184
184
|
User-Agent:
|
185
185
|
- Faraday v0.9.1
|
186
186
|
Accept:
|
187
187
|
- "*/*"
|
188
188
|
Date:
|
189
|
-
- Wed,
|
189
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
190
190
|
Content-Type:
|
191
191
|
- application/vnd.api+json
|
192
192
|
Authorization:
|
@@ -194,8 +194,14 @@ http_interactions:
|
|
194
194
|
response:
|
195
195
|
status:
|
196
196
|
code: 409
|
197
|
-
message:
|
197
|
+
message: Conflict
|
198
198
|
headers:
|
199
|
+
Date:
|
200
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
201
|
+
Status:
|
202
|
+
- 409 Conflict
|
203
|
+
Connection:
|
204
|
+
- close
|
199
205
|
X-Frame-Options:
|
200
206
|
- SAMEORIGIN
|
201
207
|
X-Xss-Protection:
|
@@ -215,22 +221,16 @@ http_interactions:
|
|
215
221
|
Content-Type:
|
216
222
|
- application/json; charset=utf-8
|
217
223
|
X-Request-Id:
|
218
|
-
-
|
224
|
+
- 30a89483-bcda-4254-9fec-a8ad52c0cace
|
219
225
|
X-Runtime:
|
220
|
-
- '0.
|
221
|
-
|
222
|
-
-
|
223
|
-
Date:
|
224
|
-
- Wed, 03 Jun 2015 17:55:09 GMT
|
225
|
-
Content-Length:
|
226
|
-
- '165'
|
227
|
-
Connection:
|
228
|
-
- Keep-Alive
|
226
|
+
- '0.028442'
|
227
|
+
Transfer-Encoding:
|
228
|
+
- chunked
|
229
229
|
body:
|
230
230
|
encoding: UTF-8
|
231
231
|
string: '{"errors":[{"status":"conflict","detail":"Upload failed, resource with
|
232
|
-
SHA-256 ''
|
232
|
+
SHA-256 ''b53960b166ed18f5ef9c65e387ce43f31b3e233b2732dd9e8e143058a7271369''
|
233
233
|
already exists."}]}'
|
234
234
|
http_version:
|
235
|
-
recorded_at: Wed,
|
235
|
+
recorded_at: Wed, 10 Jun 2015 05:47:49 GMT
|
236
236
|
recorded_with: VCR 2.9.3
|
@@ -5,16 +5,16 @@ http_interactions:
|
|
5
5
|
uri: http://localhost:3000/api/v1/repos/fotinakis/percy-examples/builds/
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"data":{"type":"builds","attributes":{"commit-sha":"
|
9
|
-
|
10
|
-
version.","pull-request-number":null}}}'
|
8
|
+
string: '{"data":{"type":"builds","attributes":{"commit-sha":"65478abc7f79b22365c261076cb44478714c4751","commit-branch":"master","commit-committed-at":"2015-06-08
|
9
|
+
16:33:11 -0700","commit-author-name":"<COMMIT_AUTHOR_NAME>","commit-author-email":"<COMMIT_AUTHOR_EMAIL>","commit-committer-name":"<COMMIT_AUTHOR_NAME>","commit-committer-email":"<COMMIT_AUTHOR_EMAIL>","commit-message":"Bump
|
10
|
+
client version.","pull-request-number":null}}}'
|
11
11
|
headers:
|
12
12
|
User-Agent:
|
13
13
|
- Faraday v0.9.1
|
14
14
|
Accept:
|
15
15
|
- "*/*"
|
16
16
|
Date:
|
17
|
-
- Wed,
|
17
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
18
18
|
Content-Type:
|
19
19
|
- application/vnd.api+json
|
20
20
|
Authorization:
|
@@ -22,8 +22,14 @@ http_interactions:
|
|
22
22
|
response:
|
23
23
|
status:
|
24
24
|
code: 201
|
25
|
-
message:
|
25
|
+
message: Created
|
26
26
|
headers:
|
27
|
+
Date:
|
28
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
29
|
+
Status:
|
30
|
+
- 201 Created
|
31
|
+
Connection:
|
32
|
+
- close
|
27
33
|
X-Frame-Options:
|
28
34
|
- SAMEORIGIN
|
29
35
|
X-Xss-Protection:
|
@@ -43,36 +49,30 @@ http_interactions:
|
|
43
49
|
Content-Type:
|
44
50
|
- application/json; charset=utf-8
|
45
51
|
X-Request-Id:
|
46
|
-
-
|
52
|
+
- 7a83a40c-d415-4f48-94b2-b80739fe28cc
|
47
53
|
X-Runtime:
|
48
|
-
- '0.
|
49
|
-
|
50
|
-
-
|
51
|
-
Date:
|
52
|
-
- Wed, 03 Jun 2015 17:55:08 GMT
|
53
|
-
Content-Length:
|
54
|
-
- '1532'
|
55
|
-
Connection:
|
56
|
-
- Keep-Alive
|
54
|
+
- '0.026521'
|
55
|
+
Transfer-Encoding:
|
56
|
+
- chunked
|
57
57
|
body:
|
58
58
|
encoding: UTF-8
|
59
|
-
string: '{"data":{"id":"
|
60
|
-
version.","committed-at":"2015-06-
|
59
|
+
string: '{"data":{"id":"31426","type":"builds","attributes":{"build-number":6,"state":"pending","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:49.890Z","updated-at":"2015-06-10T05:47:49.890Z"},"links":{"self":"/api/v1/builds/31426"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31426/relationships/commit","related":"/api/v1/builds/31426/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31426/relationships/repo","related":"/api/v1/builds/31426/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31426/relationships/base-build","related":"/api/v1/builds/31426/base-build"},"data":{"type":"builds","id":"31421"}},"approved-by":{"links":{"self":"/api/v1/builds/31426/relationships/approved-by","related":"/api/v1/builds/31426/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31426/relationships/snapshots","related":"/api/v1/builds/31426/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31426/relationships/comparisons","related":"/api/v1/builds/31426/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31426/relationships/missing-resources","related":"/api/v1/builds/31426/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31426/finalize","approve-link":"/api/v1/builds/31426/approve"}},"included":[{"id":"2","type":"commits","attributes":{"sha":"65478abc7f79b22365c261076cb44478714c4751","branch":"master","message":"Bump
|
60
|
+
client version.","committed-at":"2015-06-08 16:33:11 -0700","author-name":"<COMMIT_AUTHOR_NAME>","committer-name":"<COMMIT_AUTHOR_NAME>","created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:46.000Z"},"links":{"self":"/api/v1/commits/2"}},{"id":"31421","type":"builds","attributes":{"build-number":1,"state":"finished","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:47.000Z"},"links":{"self":"/api/v1/builds/31421"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31421/relationships/commit","related":"/api/v1/builds/31421/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31421/relationships/repo","related":"/api/v1/builds/31421/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31421/relationships/base-build","related":"/api/v1/builds/31421/base-build"}},"approved-by":{"links":{"self":"/api/v1/builds/31421/relationships/approved-by","related":"/api/v1/builds/31421/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31421/relationships/snapshots","related":"/api/v1/builds/31421/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31421/relationships/comparisons","related":"/api/v1/builds/31421/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31421/relationships/missing-resources","related":"/api/v1/builds/31421/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31421/finalize","approve-link":"/api/v1/builds/31421/approve"}}]}'
|
61
61
|
http_version:
|
62
|
-
recorded_at: Wed,
|
62
|
+
recorded_at: Wed, 10 Jun 2015 05:47:49 GMT
|
63
63
|
- request:
|
64
64
|
method: post
|
65
|
-
uri: http://localhost:3000/api/v1/builds/
|
65
|
+
uri: http://localhost:3000/api/v1/builds/31426/snapshots/
|
66
66
|
body:
|
67
67
|
encoding: UTF-8
|
68
|
-
string: '{"data":{"type":"snapshots","attributes":{"name":"homepage"},"relationships":{"resources":{"data":[{"type":"resources","id":"
|
68
|
+
string: '{"data":{"type":"snapshots","attributes":{"name":"homepage"},"relationships":{"resources":{"data":[{"type":"resources","id":"e922f734dac13edaf56118975da188eb5d5fbd6ddb8b5ec4541df371976110b5","attributes":{"resource-url":"/foo/test.html","mimetype":null,"is-root":true}},{"type":"resources","id":"e922f734dac13edaf56118975da188eb5d5fbd6ddb8b5ec4541df371976110b5","attributes":{"resource-url":"/css/test.css","mimetype":null,"is-root":null}}]}}}}'
|
69
69
|
headers:
|
70
70
|
User-Agent:
|
71
71
|
- Faraday v0.9.1
|
72
72
|
Accept:
|
73
73
|
- "*/*"
|
74
74
|
Date:
|
75
|
-
- Wed,
|
75
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
76
76
|
Content-Type:
|
77
77
|
- application/vnd.api+json
|
78
78
|
Authorization:
|
@@ -80,8 +80,14 @@ http_interactions:
|
|
80
80
|
response:
|
81
81
|
status:
|
82
82
|
code: 201
|
83
|
-
message:
|
83
|
+
message: Created
|
84
84
|
headers:
|
85
|
+
Date:
|
86
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
87
|
+
Status:
|
88
|
+
- 201 Created
|
89
|
+
Connection:
|
90
|
+
- close
|
85
91
|
X-Frame-Options:
|
86
92
|
- SAMEORIGIN
|
87
93
|
X-Xss-Protection:
|
@@ -101,20 +107,14 @@ http_interactions:
|
|
101
107
|
Content-Type:
|
102
108
|
- application/json; charset=utf-8
|
103
109
|
X-Request-Id:
|
104
|
-
-
|
110
|
+
- 27556a42-dc02-4de7-a939-e77ffe14153c
|
105
111
|
X-Runtime:
|
106
|
-
- '0.
|
107
|
-
|
108
|
-
-
|
109
|
-
Date:
|
110
|
-
- Wed, 03 Jun 2015 17:55:08 GMT
|
111
|
-
Content-Length:
|
112
|
-
- '1760'
|
113
|
-
Connection:
|
114
|
-
- Keep-Alive
|
112
|
+
- '0.041105'
|
113
|
+
Transfer-Encoding:
|
114
|
+
- chunked
|
115
115
|
body:
|
116
116
|
encoding: UTF-8
|
117
|
-
string: '{"data":{"id":"
|
117
|
+
string: '{"data":{"id":"4","type":"snapshots","attributes":{"name":"homepage","created-at":"2015-06-10T05:47:49.926Z","updated-at":"2015-06-10T05:47:49.926Z","finished-processing-at":null},"links":{"self":"/api/v1/snapshots/4"},"relationships":{"build":{"links":{"self":"/api/v1/snapshots/4/relationships/build","related":"/api/v1/snapshots/4/build"}},"screenshots":{"links":{"self":"/api/v1/snapshots/4/relationships/screenshots","related":"/api/v1/snapshots/4/screenshots"}},"missing-resources":{"links":{"self":"/api/v1/snapshots/4/relationships/missing-resources","related":"/api/v1/snapshots/4/missing-resources"},"data":[{"type":"resources","id":"e922f734dac13edaf56118975da188eb5d5fbd6ddb8b5ec4541df371976110b5"}]}}},"included":[{"id":"e922f734dac13edaf56118975da188eb5d5fbd6ddb8b5ec4541df371976110b5","type":"resources","attributes":{},"links":{"self":"/api/v1/resources/e922f734dac13edaf56118975da188eb5d5fbd6ddb8b5ec4541df371976110b5"}}]}'
|
118
118
|
http_version:
|
119
|
-
recorded_at: Wed,
|
119
|
+
recorded_at: Wed, 10 Jun 2015 05:47:49 GMT
|
120
120
|
recorded_with: VCR 2.9.3
|
data/spec/cassettes/Percy_Client_Snapshots/_create_snapshot/fails_if_no_resources_are_given.yml
CHANGED
@@ -5,16 +5,16 @@ http_interactions:
|
|
5
5
|
uri: http://localhost:3000/api/v1/repos/fotinakis/percy-examples/builds/
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"data":{"type":"builds","attributes":{"commit-sha":"
|
9
|
-
|
10
|
-
version.","pull-request-number":null}}}'
|
8
|
+
string: '{"data":{"type":"builds","attributes":{"commit-sha":"65478abc7f79b22365c261076cb44478714c4751","commit-branch":"master","commit-committed-at":"2015-06-08
|
9
|
+
16:33:11 -0700","commit-author-name":"<COMMIT_AUTHOR_NAME>","commit-author-email":"<COMMIT_AUTHOR_EMAIL>","commit-committer-name":"<COMMIT_AUTHOR_NAME>","commit-committer-email":"<COMMIT_AUTHOR_EMAIL>","commit-message":"Bump
|
10
|
+
client version.","pull-request-number":null}}}'
|
11
11
|
headers:
|
12
12
|
User-Agent:
|
13
13
|
- Faraday v0.9.1
|
14
14
|
Accept:
|
15
15
|
- "*/*"
|
16
16
|
Date:
|
17
|
-
- Wed,
|
17
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
18
18
|
Content-Type:
|
19
19
|
- application/vnd.api+json
|
20
20
|
Authorization:
|
@@ -22,8 +22,14 @@ http_interactions:
|
|
22
22
|
response:
|
23
23
|
status:
|
24
24
|
code: 201
|
25
|
-
message:
|
25
|
+
message: Created
|
26
26
|
headers:
|
27
|
+
Date:
|
28
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
29
|
+
Status:
|
30
|
+
- 201 Created
|
31
|
+
Connection:
|
32
|
+
- close
|
27
33
|
X-Frame-Options:
|
28
34
|
- SAMEORIGIN
|
29
35
|
X-Xss-Protection:
|
@@ -43,26 +49,20 @@ http_interactions:
|
|
43
49
|
Content-Type:
|
44
50
|
- application/json; charset=utf-8
|
45
51
|
X-Request-Id:
|
46
|
-
-
|
52
|
+
- 561536a7-61d8-40ab-8c76-a6c7ba827f5b
|
47
53
|
X-Runtime:
|
48
|
-
- '0.
|
49
|
-
|
50
|
-
-
|
51
|
-
Date:
|
52
|
-
- Wed, 03 Jun 2015 17:55:08 GMT
|
53
|
-
Content-Length:
|
54
|
-
- '1532'
|
55
|
-
Connection:
|
56
|
-
- Keep-Alive
|
54
|
+
- '0.049243'
|
55
|
+
Transfer-Encoding:
|
56
|
+
- chunked
|
57
57
|
body:
|
58
58
|
encoding: UTF-8
|
59
|
-
string: '{"data":{"id":"
|
60
|
-
version.","committed-at":"2015-06-
|
59
|
+
string: '{"data":{"id":"31425","type":"builds","attributes":{"build-number":5,"state":"pending","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:49.763Z","updated-at":"2015-06-10T05:47:49.763Z"},"links":{"self":"/api/v1/builds/31425"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31425/relationships/commit","related":"/api/v1/builds/31425/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31425/relationships/repo","related":"/api/v1/builds/31425/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31425/relationships/base-build","related":"/api/v1/builds/31425/base-build"},"data":{"type":"builds","id":"31421"}},"approved-by":{"links":{"self":"/api/v1/builds/31425/relationships/approved-by","related":"/api/v1/builds/31425/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31425/relationships/snapshots","related":"/api/v1/builds/31425/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31425/relationships/comparisons","related":"/api/v1/builds/31425/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31425/relationships/missing-resources","related":"/api/v1/builds/31425/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31425/finalize","approve-link":"/api/v1/builds/31425/approve"}},"included":[{"id":"2","type":"commits","attributes":{"sha":"65478abc7f79b22365c261076cb44478714c4751","branch":"master","message":"Bump
|
60
|
+
client version.","committed-at":"2015-06-08 16:33:11 -0700","author-name":"<COMMIT_AUTHOR_NAME>","committer-name":"<COMMIT_AUTHOR_NAME>","created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:46.000Z"},"links":{"self":"/api/v1/commits/2"}},{"id":"31421","type":"builds","attributes":{"build-number":1,"state":"finished","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-06-10T05:47:46.000Z","updated-at":"2015-06-10T05:47:47.000Z"},"links":{"self":"/api/v1/builds/31421"},"relationships":{"commit":{"links":{"self":"/api/v1/builds/31421/relationships/commit","related":"/api/v1/builds/31421/commit"},"data":{"type":"commits","id":"2"}},"repo":{"links":{"self":"/api/v1/builds/31421/relationships/repo","related":"/api/v1/builds/31421/repo"}},"base-build":{"links":{"self":"/api/v1/builds/31421/relationships/base-build","related":"/api/v1/builds/31421/base-build"}},"approved-by":{"links":{"self":"/api/v1/builds/31421/relationships/approved-by","related":"/api/v1/builds/31421/approved-by"}},"snapshots":{"links":{"self":"/api/v1/builds/31421/relationships/snapshots","related":"/api/v1/builds/31421/snapshots"}},"comparisons":{"links":{"self":"/api/v1/builds/31421/relationships/comparisons","related":"/api/v1/builds/31421/comparisons"}},"missing-resources":{"links":{"self":"/api/v1/builds/31421/relationships/missing-resources","related":"/api/v1/builds/31421/missing-resources"}}},"meta":{"finalize-link":"/api/v1/builds/31421/finalize","approve-link":"/api/v1/builds/31421/approve"}}]}'
|
61
61
|
http_version:
|
62
|
-
recorded_at: Wed,
|
62
|
+
recorded_at: Wed, 10 Jun 2015 05:47:49 GMT
|
63
63
|
- request:
|
64
64
|
method: post
|
65
|
-
uri: http://localhost:3000/api/v1/builds/
|
65
|
+
uri: http://localhost:3000/api/v1/builds/31425/snapshots/
|
66
66
|
body:
|
67
67
|
encoding: UTF-8
|
68
68
|
string: '{"data":{"type":"snapshots","attributes":{"name":null},"relationships":{"resources":{"data":[]}}}}'
|
@@ -72,7 +72,7 @@ http_interactions:
|
|
72
72
|
Accept:
|
73
73
|
- "*/*"
|
74
74
|
Date:
|
75
|
-
- Wed,
|
75
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
76
76
|
Content-Type:
|
77
77
|
- application/vnd.api+json
|
78
78
|
Authorization:
|
@@ -80,8 +80,14 @@ http_interactions:
|
|
80
80
|
response:
|
81
81
|
status:
|
82
82
|
code: 400
|
83
|
-
message:
|
83
|
+
message: Bad Request
|
84
84
|
headers:
|
85
|
+
Date:
|
86
|
+
- Wed, 10 Jun 2015 05:47:49 GMT
|
87
|
+
Status:
|
88
|
+
- 400 Bad Request
|
89
|
+
Connection:
|
90
|
+
- close
|
85
91
|
X-Frame-Options:
|
86
92
|
- SAMEORIGIN
|
87
93
|
X-Xss-Protection:
|
@@ -101,22 +107,16 @@ http_interactions:
|
|
101
107
|
Content-Type:
|
102
108
|
- application/json; charset=utf-8
|
103
109
|
X-Request-Id:
|
104
|
-
-
|
110
|
+
- 944a3cee-8161-47fc-b4f9-a0531a571334
|
105
111
|
X-Runtime:
|
106
|
-
- '0.
|
107
|
-
|
108
|
-
-
|
109
|
-
Date:
|
110
|
-
- Wed, 03 Jun 2015 17:55:08 GMT
|
111
|
-
Content-Length:
|
112
|
-
- '177'
|
113
|
-
Connection:
|
114
|
-
- Keep-Alive
|
112
|
+
- '0.018033'
|
113
|
+
Transfer-Encoding:
|
114
|
+
- chunked
|
115
115
|
body:
|
116
116
|
encoding: UTF-8
|
117
117
|
string: '{"errors":[{"status":"bad_request","detail":"Exactly one resource with
|
118
118
|
''is-root'': true must be present in the ''resources'' array. Found 0 root
|
119
119
|
resources in 0 total resources."}]}'
|
120
120
|
http_version:
|
121
|
-
recorded_at: Wed,
|
121
|
+
recorded_at: Wed, 10 Jun 2015 05:47:49 GMT
|
122
122
|
recorded_with: VCR 2.9.3
|
@@ -1,4 +1,7 @@
|
|
1
1
|
RSpec.describe Percy::Client::Builds, :vcr do
|
2
|
+
let(:content) { "hello world! #{__FILE__}" }
|
3
|
+
let(:sha) { Digest::SHA256.hexdigest(content) }
|
4
|
+
|
2
5
|
describe '#create_build' do
|
3
6
|
before(:each) { ENV['PERCY_PULL_REQUEST'] = '123' }
|
4
7
|
after(:each) { ENV['PERCY_PULL_REQUEST'] = nil }
|
@@ -11,6 +14,24 @@ RSpec.describe Percy::Client::Builds, :vcr do
|
|
11
14
|
expect(build['data']['attributes']['state']).to eq('pending')
|
12
15
|
expect(build['data']['attributes']['is-pull-request']).to be_truthy
|
13
16
|
expect(build['data']['attributes']['pull-request-number']).to eq(123)
|
17
|
+
expect(build['data']['relationships']['missing-resources']).to be
|
18
|
+
expect(build['data']['relationships']['missing-resources']['data']).to_not be
|
19
|
+
end
|
20
|
+
it 'accepts optional resources' do
|
21
|
+
resources = []
|
22
|
+
resources << Percy::Client::Resource.new('/css/test.css', sha: sha)
|
23
|
+
|
24
|
+
build = Percy.create_build('fotinakis/percy-examples', resources: resources)
|
25
|
+
expect(build).to be
|
26
|
+
expect(build['data']).to be
|
27
|
+
expect(build['data']['id']).to be
|
28
|
+
expect(build['data']['type']).to eq('builds')
|
29
|
+
expect(build['data']['attributes']['state']).to eq('pending')
|
30
|
+
expect(build['data']['attributes']['is-pull-request']).to be_truthy
|
31
|
+
expect(build['data']['attributes']['pull-request-number']).to eq(123)
|
32
|
+
expect(build['data']['relationships']['missing-resources']).to be
|
33
|
+
expect(build['data']['relationships']['missing-resources']['data']).to be
|
34
|
+
expect(build['data']['relationships']['missing-resources']['data'][0]['id']).to eq(sha)
|
14
35
|
end
|
15
36
|
end
|
16
37
|
describe '#finalize_build' 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: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/percy/client/version.rb
|
134
134
|
- lib/percy/config.rb
|
135
135
|
- percy-client.gemspec
|
136
|
+
- spec/cassettes/Percy_Client_Builds/_create_build/accepts_optional_resources.yml
|
136
137
|
- spec/cassettes/Percy_Client_Builds/_create_build/creates_a_build.yml
|
137
138
|
- spec/cassettes/Percy_Client_Builds/_finalize_build/finalizes_a_build.yml
|
138
139
|
- spec/cassettes/Percy_Client_Resources/_upload_resource/returns_true_with_success.yml
|
@@ -172,6 +173,7 @@ signing_key:
|
|
172
173
|
specification_version: 4
|
173
174
|
summary: Percy::Client
|
174
175
|
test_files:
|
176
|
+
- spec/cassettes/Percy_Client_Builds/_create_build/accepts_optional_resources.yml
|
175
177
|
- spec/cassettes/Percy_Client_Builds/_create_build/creates_a_build.yml
|
176
178
|
- spec/cassettes/Percy_Client_Builds/_finalize_build/finalizes_a_build.yml
|
177
179
|
- spec/cassettes/Percy_Client_Resources/_upload_resource/returns_true_with_success.yml
|