Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Create tests for template logic #1306

Open
jandubois opened this issue Sep 8, 2020 · 0 comments
Open

Create tests for template logic #1306

jandubois opened this issue Sep 8, 2020 · 0 comments
Labels
Status: Validation Need to brainstorm before starting Type: Enhancement New feature or request

Comments

@jandubois
Copy link
Member

The kubecf templates contain complex logic that is currently only covered by smoke and acceptance tests.

There should be unit tests in the kubecf repo itself that verify that when the template generated ops files are applied to the deployment manifest, the results are what is expected.

This means we need to use helm template to render the YAML files, but then also apply the ops against the manifest. There is code in https://github.com/cloudfoundry-incubator/kubecf/blob/cf682c1/scripts/image_list.rb#L176-L191 that does this using bosh interpolate. This only works because we are not yet making use of the qcopy and qmove ops that have been added to the operator in cloudfoundry-incubator/quarks-operator#900.

Ideally we would want to use quarks-operator interpolate, but until such a feature exist we can also use @mook-as's tool at https://github.com/mook-as/go-patch-cmd.

Each test should be a YAML config file plus a ruby script, that reads the interpolated deployment manifest and verifies that expected structures exist and have the expected content (or don't exist, as the case may be).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: Validation Need to brainstorm before starting Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants