Expand functional tests for revision read

- Add tags to revisions detail and list endpoints.
- Add buckets to revisions detail and list endpoints.

Change-Id: If0fc9cec1f2382ae5dcf7ff7ebb60d0779df55dd
This commit is contained in:
Mark Burnett 2017-09-01 13:42:27 -05:00
parent 063aa01374
commit 7b77ca707e
3 changed files with 126 additions and 20 deletions

View File

@ -36,6 +36,26 @@ tests:
desc: Verify that revision was created for document above desc: Verify that revision was created for document above
GET: /api/v1.0/revisions/$RESPONSE['$.[0].status.revision'] GET: /api/v1.0/revisions/$RESPONSE['$.[0].status.revision']
status: 200 status: 200
response_multidoc_jsonpaths:
$.[0].id: $HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
$.[0].buckets: [mop]
$.[0].tags: []
skip: Not implemented.
# Validates whether revision was created.
# Required parameters:
# path: revision_id.
# Asserts that status code and response headers are correct.
- name: verify_revision_list
desc: Verify that revision was created for document above
GET: /api/v1.0/revisions/$RESPONSE['$.[0].status.revision']
status: 200
response_multidoc_jsonpaths:
$.[0].count: 1
$.[0].results[0].id: $HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
$.[0].results[0].buckets: [mop]
$.[0].results[0].tags: []
skip: Not implemented.
# Validates whether revision deletion works. # Validates whether revision deletion works.
# Required parameters: # Required parameters:

View File

@ -1,15 +1,27 @@
# Test success paths for revision tag create, read, update and delete. # Test success paths for revision tag create, read, update and delete.
# #
# 1. Purges existing data to ensure test isolation # 1. Purges existing data to ensure test isolation
# 2. Adds a document to a bucket to create a revision needed by these tests. # 2. Adds a document to a bucket to create a revision needed by these tests.
# 3. Creates a tag "foo" for the created revision. # 3. Creates a tag "foo" for the created revision.
# 4. Verifies: # 4. Verifies:
# - Tag "foo" was created for the revision # - Revision tags endpoint shows "foo" was created for the revision
# 5. Creates a tag "bar" with associated data for the same revision. # - Revision details show tag "foo"
# 6. Verifies: # - Revision list shows tag "foo"
# - Tag "bar" was created with expected data. # 5. Creates a tag "bar" with associated data for the same revision.
# 7. Delete tag "foo" and verify that only tag "bar" is listed afterward. # 6. Verifies:
# 8. Delete all tags and verify that no tags are listed. # - Revision tags endpoints show "bar" with expected data.
# - Revision details show tags "foo" and "bar"
# - Revision list shows tags "foo" and "bar"
# 7. Deletes tag "foo"
# 8. Verifies:
# - Only tag "bar" is listed afterward.
# - Revision details show only tag "bar"
# - Revision list shows only tag "bar"
# 8. Delete all tags
# 10. Verifies:
# - Revision tags endpoint shows no tags.
# - Revision details show no tags.
# - Revision list shows no tags.
defaults: defaults:
request_headers: request_headers:
@ -48,6 +60,22 @@ tests:
$[0].data: {} $[0].data: {}
$[0].tag: foo $[0].tag: foo
- name: verify_revision_detail_foo
desc: Verify showing created tag on revision detail
GET: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
status: 200
response_multidoc_jsonpaths:
$.[0].tags.foo.name: foo
skip: Not implemented.
- name: verify_revision_list_foo
desc: Verify showing created tag on revision list
GET: /api/v1.0/revisions
status: 200
response_multidoc_jsonpaths:
$.[0].tags [foo]
skip: Not implemented.
- name: create_tag_with_data - name: create_tag_with_data
desc: Create a tag with data for the revision desc: Create a tag with data for the revision
POST: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags/bar POST: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags/bar
@ -71,6 +99,23 @@ tests:
$.[1].tag: foo $.[1].tag: foo
$.[1].data: {} $.[1].data: {}
- name: verify_revision_detail_bar
desc: Verify showing created tag on revision detail
GET: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
status: 200
response_multidoc_jsonpaths:
$.[0].tags.bar.name: bar
$.[0].tags.foo.name: foo
skip: Not implemented.
- name: verify_revision_list_bar
desc: Verify showing created tag on revision list
GET: /api/v1.0/revisions
status: 200
response_multidoc_jsonpaths:
$.[0].tags [bar, foo]
skip: Not implemented.
- name: delete_tag - name: delete_tag
desc: Verify deleting tag works desc: Verify deleting tag works
DELETE: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags/foo DELETE: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags/foo
@ -86,11 +131,43 @@ tests:
$.[0].data.last: good $.[0].data.last: good
$.[0].data.random: data $.[0].data.random: data
- name: verify_revision_detail_deleted_foo
desc: Verify not showing deleted tag on revision detail
GET: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
status: 200
response_multidoc_jsonpaths:
$.[0].tags.bar.name: bar
skip: Not implemented.
- name: verify_revision_list_deleted_foo
desc: Verify not showing deleted tag on revision list
GET: /api/v1.0/revisions
status: 200
response_multidoc_jsonpaths:
$.[0].tags [bar]
skip: Not implemented.
- name: delete_all_tags - name: delete_all_tags
desc: Verify deleting tag works desc: Verify deleting tag works
DELETE: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags DELETE: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags
status: 204 status: 204
- name: verify_revision_detail_deleted_all
desc: Verify empty tags on revision detail
GET: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
status: 200
response_multidoc_jsonpaths:
$.[0].tags: {}
skip: Not implemented.
- name: verify_revision_list_deleted_all
desc: Verify empty tags on revision list
GET: /api/v1.0/revisions
status: 200
response_multidoc_jsonpaths:
$.[0].tags []
skip: Not implemented.
- name: verify_tag_delete_all - name: verify_tag_delete_all
desc: Verify all tags have been deleted desc: Verify all tags have been deleted
GET: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags GET: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags

View File

@ -710,15 +710,19 @@ count: 7
next: https://deckhand/api/v1.0/revisions?limit=2&offset=2 next: https://deckhand/api/v1.0/revisions?limit=2&offset=2
prev: null prev: null
results: results:
- id: 0 - id: 1
url: https://deckhand/api/v1.0/revisions/0 url: https://deckhand/api/v1.0/revisions/1
createdAt: 2017-07-14T21:23Z createdAt: 2017-07-14T21:23Z
buckets: [mop]
tags: [a, b, c]
validationPolicies: validationPolicies:
site-deploy-validation: site-deploy-validation:
status: failed status: failed
- id: 1 - id: 2
url: https://deckhand/api/v1.0/revisions/1 url: https://deckhand/api/v1.0/revisions/2
createdAt: 2017-07-16T01:15Z createdAt: 2017-07-16T01:15Z
buckets: [flop, mop]
tags: [b]
validationPolicies: validationPolicies:
site-deploy-validation: site-deploy-validation:
status: succeeded status: succeeded
@ -748,24 +752,29 @@ Sample response:
```yaml ```yaml
--- ---
id: 0 id: 1
url: https://deckhand/api/v1.0/revisions/0 url: https://deckhand/api/v1.0/revisions/1
createdAt: 2017-07-14T021:23Z createdAt: 2017-07-14T021:23Z
buckets: [mop]
tags:
a:
name: a
url: https://deckhand/api/v1.0/revisions/1/tags/a
validationPolicies: validationPolicies:
site-deploy-validation: site-deploy-validation:
url: https://deckhand/api/v1.0/revisions/0/documents?schema=deckhand/ValidationPolicy/v1&name=site-deploy-validation url: https://deckhand/api/v1.0/revisions/1/documents?schema=deckhand/ValidationPolicy/v1&name=site-deploy-validation
status: failed status: failed
validations: validations:
- name: deckhand-schema-validation - name: deckhand-schema-validation
url: https://deckhand/api/v1.0/revisions/0/validations/deckhand-schema-validation/0 url: https://deckhand/api/v1.0/revisions/1/validations/deckhand-schema-validation/0
status: success status: success
- name: drydock-site-validation - name: drydock-site-validation
status: missing status: missing
- name: promenade-site-validation - name: promenade-site-validation
url: https://deckhand/api/v1.0/revisions/0/validations/promenade-site-validation/0 url: https://deckhand/api/v1.0/revisions/1/validations/promenade-site-validation/0
status: expired status: expired
- name: armada-deployability-validation - name: armada-deployability-validation
url: https://deckhand/api/v1.0/revisions/0/validations/armada-deployability-validation/0 url: https://deckhand/api/v1.0/revisions/1/validations/armada-deployability-validation/0
status: failed status: failed
... ...
``` ```