177675e96f
Currently it doesn't seem document replacement works exactly as expected: The parent-replacement document can receive layering and substitution data prior to being replaced. Currently, Deckhand does not account for this scenario. A child-replacement depends on its parent-replacement the same way any child depends on its parent: so that the child layers with its parent only after the parent has received all layering and substitution data. But other documents that depend on the parent-replacement actually depend on the child-replacement instead as the child-replacement replaces its parent. So the dependency chain is: PR -> CR -> anything that layers with PR. A unit and functional test have been added for regression. Co-Authored-By: Felipe Monteiro <felipe.monteiro@att.com> Change-Id: I353393f416aa6e441d84add9ebedcd152944d7e8
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
# Tests success path for advanced replacement scenario, where
|
|
# parent-replacement document receives substitutions and is then layered
|
|
# with by its child-replacement document, which replaces its parent.
|
|
#
|
|
# 1. Purges existing data to ensure test isolation.
|
|
# 2. Adds initial documents with replacement scenario described above.
|
|
# 3. Verifies correctly layered, substituted and replaced data.
|
|
|
|
defaults:
|
|
request_headers:
|
|
content-type: application/x-yaml
|
|
response_headers:
|
|
content-type: application/x-yaml
|
|
verbose: true
|
|
|
|
tests:
|
|
- name: purge
|
|
desc: Begin testing from known state.
|
|
DELETE: /api/v1.0/revisions
|
|
status: 204
|
|
response_headers: null
|
|
|
|
- name: initialize
|
|
desc: Create initial documents
|
|
PUT: /api/v1.0/buckets/mop/documents
|
|
status: 200
|
|
data: <@resources/replacement.yaml
|
|
|
|
- name: verify_replacement_document_receives_substitution
|
|
desc: |
|
|
Tests success path for advanced replacement scenario, where
|
|
parent-replacement document receives substitutions and is then layered
|
|
with by its child-replacement document, which replaces its parent.
|
|
GET: /api/v1.0/revisions/$RESPONSE['$.[0].status.revision']/rendered-documents
|
|
query_parameters:
|
|
schema: armada/Chart/v1
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.`len`: 1
|
|
$.[*].metadata.name: example-chart-01
|
|
$.[*].metadata.layeringDefinition.layer: site
|
|
$.[*].data:
|
|
chart:
|
|
details:
|
|
data: bar
|
|
values:
|
|
tls:
|
|
certificate: |
|
|
CERTIFICATE DATA
|
|
key: |
|
|
KEY DATA
|