mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-05 18:46:22 -03:00
actually add tets
This commit is contained in:
324
library/common-test/tests/chartContext/data_test.yaml
Normal file
324
library/common-test/tests/chartContext/data_test.yaml
Normal file
@@ -0,0 +1,324 @@
|
||||
suite: chart context data test
|
||||
templates:
|
||||
- common.yaml
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should pass with service default values
|
||||
set:
|
||||
enabled: true
|
||||
port: 12345
|
||||
service:
|
||||
my-service:
|
||||
enabled: "{{ .Values.enabled }}"
|
||||
primary: true
|
||||
ports:
|
||||
my-port:
|
||||
enabled: "{{ .Values.enabled }}"
|
||||
primary: true
|
||||
port: "{{ .Values.port }}"
|
||||
asserts:
|
||||
- documentIndex: &configMapDoc 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-chart-context
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: data
|
||||
value:
|
||||
podCIDR: 172.16.0.0/16
|
||||
svcCIDR: 172.17.0.0/16
|
||||
appUrl: http://127.0.0.1:12345
|
||||
appHost: "127.0.0.1"
|
||||
appPort: "12345"
|
||||
appPath: /
|
||||
appProtocol: http
|
||||
|
||||
- it: should pass with service loadBalancer values
|
||||
set:
|
||||
ip: 1.2.3.4
|
||||
service:
|
||||
my-service:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: LoadBalancer
|
||||
loadBalancerIP: "{{ .Values.ip }}"
|
||||
ports:
|
||||
my-port:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: 12345
|
||||
asserts:
|
||||
- documentIndex: &configMapDoc 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-chart-context
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: data
|
||||
value:
|
||||
podCIDR: 172.16.0.0/16
|
||||
svcCIDR: 172.17.0.0/16
|
||||
appUrl: http://1.2.3.4:12345
|
||||
appHost: "1.2.3.4"
|
||||
appPort: "12345"
|
||||
appPath: /
|
||||
appProtocol: http
|
||||
|
||||
- it: should pass with ingress
|
||||
set:
|
||||
enabled: true
|
||||
host: example.com
|
||||
path: /some-path
|
||||
operator:
|
||||
verify:
|
||||
enabled: false
|
||||
ingress:
|
||||
my-ingress:
|
||||
enabled: "{{ .Values.enabled }}"
|
||||
primary: true
|
||||
integrations:
|
||||
traefik:
|
||||
enabled: false
|
||||
hosts:
|
||||
- host: "{{ .Values.host }}"
|
||||
paths:
|
||||
- path: "{{ .Values.path }}"
|
||||
service:
|
||||
my-service:
|
||||
enabled: true
|
||||
primary: true
|
||||
ports:
|
||||
my-port:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: 12345
|
||||
asserts:
|
||||
- documentIndex: &configMapDoc 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-chart-context
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: data
|
||||
value:
|
||||
podCIDR: 172.16.0.0/16
|
||||
svcCIDR: 172.17.0.0/16
|
||||
appUrl: https://example.com
|
||||
appHost: "example.com"
|
||||
appPort: "443"
|
||||
appPath: /some-path
|
||||
appProtocol: https
|
||||
|
||||
- it: should pass with ingress and traefik integration
|
||||
set:
|
||||
operator:
|
||||
verify:
|
||||
enabled: false
|
||||
ingress:
|
||||
my-ingress:
|
||||
enabled: true
|
||||
primary: true
|
||||
integrations:
|
||||
traefik:
|
||||
enabled: true
|
||||
entrypoints:
|
||||
- web
|
||||
enableFixedMiddlewares: false
|
||||
hosts:
|
||||
- host: example.com
|
||||
paths:
|
||||
- path: /some-path
|
||||
service:
|
||||
my-service:
|
||||
enabled: true
|
||||
primary: true
|
||||
ports:
|
||||
my-port:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: 12345
|
||||
asserts:
|
||||
- documentIndex: &configMapDoc 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-chart-context
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: data
|
||||
value:
|
||||
podCIDR: 172.16.0.0/16
|
||||
svcCIDR: 172.17.0.0/16
|
||||
appUrl: http://example.com
|
||||
appHost: "example.com"
|
||||
appPort: "80"
|
||||
appPath: /some-path
|
||||
appProtocol: http
|
||||
|
||||
- it: should pass with ingress and tls and traefik integration
|
||||
set:
|
||||
operator:
|
||||
verify:
|
||||
enabled: false
|
||||
ingress:
|
||||
my-ingress:
|
||||
enabled: true
|
||||
primary: true
|
||||
integrations:
|
||||
traefik:
|
||||
enabled: true
|
||||
entrypoints:
|
||||
- web
|
||||
enableFixedMiddlewares: false
|
||||
hosts:
|
||||
- host: example.com
|
||||
paths:
|
||||
- path: /some-path
|
||||
tls:
|
||||
- hosts:
|
||||
- example.com
|
||||
secretName: example-tls
|
||||
service:
|
||||
my-service:
|
||||
enabled: true
|
||||
primary: true
|
||||
ports:
|
||||
my-port:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: 12345
|
||||
asserts:
|
||||
- documentIndex: &configMapDoc 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-chart-context
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: data
|
||||
value:
|
||||
podCIDR: 172.16.0.0/16
|
||||
svcCIDR: 172.17.0.0/16
|
||||
appUrl: https://example.com
|
||||
appHost: "example.com"
|
||||
appPort: "443"
|
||||
appPath: /some-path
|
||||
appProtocol: https
|
||||
|
||||
- it: should pass with ingress and tls and traefik integration
|
||||
set:
|
||||
operator:
|
||||
verify:
|
||||
enabled: false
|
||||
ingress:
|
||||
my-ingress:
|
||||
enabled: true
|
||||
primary: true
|
||||
integrations:
|
||||
traefik:
|
||||
enabled: true
|
||||
entrypoints:
|
||||
- web
|
||||
enableFixedMiddlewares: false
|
||||
hosts:
|
||||
- host: example.com
|
||||
paths:
|
||||
- path: /some-path
|
||||
tls:
|
||||
- hosts:
|
||||
- example.com
|
||||
secretName: example-tls
|
||||
service:
|
||||
my-service:
|
||||
enabled: true
|
||||
primary: true
|
||||
ports:
|
||||
my-port:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: 12345
|
||||
asserts:
|
||||
- documentIndex: &configMapDoc 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-chart-context
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: data
|
||||
value:
|
||||
podCIDR: 172.16.0.0/16
|
||||
svcCIDR: 172.17.0.0/16
|
||||
appUrl: https://example.com
|
||||
appHost: "example.com"
|
||||
appPort: "443"
|
||||
appPath: /some-path
|
||||
appProtocol: https
|
||||
|
||||
- it: should pass with ingress and certManager integration and traefik integration
|
||||
set:
|
||||
operator:
|
||||
verify:
|
||||
enabled: false
|
||||
ingress:
|
||||
my-ingress:
|
||||
enabled: true
|
||||
primary: true
|
||||
integrations:
|
||||
certManager:
|
||||
enabled: true
|
||||
certificateIssuer: some-issuer
|
||||
traefik:
|
||||
enabled: true
|
||||
entrypoints:
|
||||
- web
|
||||
enableFixedMiddlewares: false
|
||||
hosts:
|
||||
- host: example.com
|
||||
paths:
|
||||
- path: /some-path
|
||||
service:
|
||||
my-service:
|
||||
enabled: true
|
||||
primary: true
|
||||
ports:
|
||||
my-port:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: 12345
|
||||
asserts:
|
||||
- documentIndex: &configMapDoc 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-chart-context
|
||||
- documentIndex: *configMapDoc
|
||||
equal:
|
||||
path: data
|
||||
value:
|
||||
podCIDR: 172.16.0.0/16
|
||||
svcCIDR: 172.17.0.0/16
|
||||
appUrl: https://example.com
|
||||
appHost: "example.com"
|
||||
appPort: "443"
|
||||
appPath: /some-path
|
||||
appProtocol: https
|
||||
Reference in New Issue
Block a user