Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-klimko committed Jan 11, 2024
1 parent d86f52f commit a4ba2a8
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions charts/cf-common-test/tests/deployment/container_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,79 @@ tests:
- equal:
path: spec.template.spec.containers[0].image
value: myregistry.io/codefresh/cf-api:latest

- it: Test main container TPL env without overrides
values:
- values.yaml
- values-tpl.yaml
set:
global:
tpl: value
asserts:
- equal:
path: spec.template.spec.containers[0].env[1].name
value: TPL_VAR_ONE
- equal:
path: spec.template.spec.containers[0].env[1].value
value: value

- it: Test main container TPL env with overrides
values:
- values.yaml
- values-tpl.yaml
set:
global:
tpl: value
container:
env:
TPL_VAR_ONE:
valueFrom:
secretKeyRef:
name: some-secret-one
key: some-key-one
env:
TPL_VAR_TWO:
valueFrom:
secretKeyRef:
name: some-secret-two
key: some-key-two
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: TPL_VAR_ONE
valueFrom:
secretKeyRef:
name: some-secret-one
key: some-key-one
- contains:
path: spec.template.spec.containers[0].env
content:
name: TPL_VAR_TWO
valueFrom:
secretKeyRef:
name: some-secret-two
key: some-key-two

- it: Test main container TPL env with overrides (backward compatibility)
values:
- values.yaml
- values-tpl.yaml
set:
global:
tpl: value
env:
TPL_VAR_ONE:
valueFrom:
secretKeyRef:
name: some-secret-one
key: some-key-one
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: TPL_VAR_ONE
valueFrom:
secretKeyRef:
name: some-secret-one
key: some-key-one

0 comments on commit a4ba2a8

Please sign in to comment.