1505c76388
This PS integrates layering functionality with rendered documents API endpoint. No new functionality was really added; instead, a lot of code was refactored to make layering work alongside substitution. The following changes have been made: - Moved document filtering functionality to deckhand.utils because rendered documents must be filtered twice: once to retrieve all documents necessary for rendering from the DB and again by the controller to filter out documents the user doesn't want returned - Additional LOG statements in the layering module - Additional layering unit tests - Additional functional tests - Removal of some stricter validations around layering: if a parent document is not found for a document, an error is no longer returned, as not all documents need to have a parent (that is, not all documents need to be rendered together, though this might need to be expanded on later: what if a document has a `parentSelector` but no parent is found?) Change-Id: I6c66ed824fba0216ba868a6101a72cfe3bdda181
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
# Tests success path for layering involving multiple source buckets.
|
|
#
|
|
# 1. Purges existing data to ensure test isolation
|
|
# 2. Adds documents to bucket a
|
|
# 3. Adds documents to bucket b
|
|
# 4. Verifies fully correctly layered document data
|
|
|
|
defaults:
|
|
request_headers:
|
|
content-type: application/x-yaml
|
|
response_headers:
|
|
content-type: application/x-yaml
|
|
|
|
tests:
|
|
- name: purge
|
|
desc: Begin testing from known state.
|
|
DELETE: /api/v1.0/revisions
|
|
status: 204
|
|
response_headers: null
|
|
|
|
- name: add_bucket_a
|
|
desc: Create documents for bucket a
|
|
PUT: /api/v1.0/buckets/a/documents
|
|
status: 200
|
|
data: <@resources/design-doc-layering-sample-split-bucket-a.yaml
|
|
|
|
- name: add_bucket_b
|
|
desc: Create documents for bucket b
|
|
PUT: /api/v1.0/buckets/b/documents
|
|
status: 200
|
|
data: <@resources/design-doc-layering-sample-split-bucket-b.yaml
|
|
|
|
- name: verify_layering
|
|
desc: Check for expected layering
|
|
GET: /api/v1.0/revisions/$RESPONSE['$.[0].status.revision']/rendered-documents
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.`len`: 1
|
|
$.[*].schema: example/Kind/v1
|
|
$.[*].metadata.name: site-1234
|
|
$.[*].metadata.schema: metadata/Document/v1
|
|
$.[*].data:
|
|
a:
|
|
z: 3
|
|
b: 4
|