You've already forked reposilite-charts
Initial Commit
Some checks failed
Helm / helm-lint (push) Successful in 17s
Helm / helm-unittest (push) Successful in 17s
Markdown linter / markdown-link-checker (push) Failing after 21s
Markdown linter / markdown-lint (push) Failing after 15s
Generate README / generate-parameters (push) Successful in 28s
Some checks failed
Helm / helm-lint (push) Successful in 17s
Helm / helm-unittest (push) Successful in 17s
Markdown linter / markdown-link-checker (push) Failing after 21s
Markdown linter / markdown-lint (push) Failing after 15s
Generate README / generate-parameters (push) Successful in 28s
This commit is contained in:
152
unittests/hpa/hpa.yaml
Normal file
152
unittests/hpa/hpa.yaml
Normal file
@ -0,0 +1,152 @@
|
||||
chart:
|
||||
appVersion: 0.1.0
|
||||
version: 0.1.0
|
||||
suite: HPA template
|
||||
release:
|
||||
name: reposilite-unittest
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/hpa.yaml
|
||||
tests:
|
||||
- it: Skip rendering by default.
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: Rendering when enabled - default
|
||||
set:
|
||||
hpa.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- containsDocument:
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
name: reposilite-unittest
|
||||
namespace: testing
|
||||
- notExists:
|
||||
path: metadata.annotations
|
||||
- equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: reposilite-unittest
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: reposilite
|
||||
app.kubernetes.io/version: 0.1.0
|
||||
helm.sh/chart: reposilite-0.1.0
|
||||
- isSubset:
|
||||
path: spec.behavior
|
||||
content:
|
||||
scaleDown:
|
||||
policies:
|
||||
- type: Pods
|
||||
value: 1
|
||||
periodSeconds: 60
|
||||
stabilizationWindowSeconds: 300
|
||||
- lengthEqual:
|
||||
path: spec.metrics
|
||||
count: 2
|
||||
- contains:
|
||||
path: spec.metrics
|
||||
content:
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
averageUtilization: 65
|
||||
type: Utilization
|
||||
type: Resource
|
||||
- contains:
|
||||
path: spec.metrics
|
||||
content:
|
||||
resource:
|
||||
name: memory
|
||||
target:
|
||||
averageUtilization: 65
|
||||
type: Utilization
|
||||
type: Resource
|
||||
- equal:
|
||||
path: spec.maxReplicas
|
||||
value: 10
|
||||
- equal:
|
||||
path: spec.minReplicas
|
||||
value: 1
|
||||
- equal:
|
||||
path: spec.scaleTargetRef
|
||||
value:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: reposilite-unittest
|
||||
|
||||
- it: Rendering when enabled - custom values
|
||||
set:
|
||||
hpa.enabled: true
|
||||
hpa.annotations:
|
||||
foo: bar
|
||||
hpa.labels:
|
||||
bar: foo
|
||||
hpa.maxReplicas: 25
|
||||
hpa.minReplicas: 5
|
||||
hpa.metrics:
|
||||
- resource:
|
||||
name: cpu
|
||||
target:
|
||||
averageUtilization: 60
|
||||
type: Utilization
|
||||
type: Resource
|
||||
- resource:
|
||||
name: memory
|
||||
target:
|
||||
averageUtilization: 60
|
||||
type: Utilization
|
||||
type: Resource
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- containsDocument:
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
name: reposilite-unittest
|
||||
namespace: testing
|
||||
- equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
foo: bar
|
||||
- equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: reposilite-unittest
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: reposilite
|
||||
app.kubernetes.io/version: 0.1.0
|
||||
bar: foo
|
||||
helm.sh/chart: reposilite-0.1.0
|
||||
- contains:
|
||||
path: spec.metrics
|
||||
content:
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
averageUtilization: 60
|
||||
type: Utilization
|
||||
type: Resource
|
||||
- contains:
|
||||
path: spec.metrics
|
||||
content:
|
||||
resource:
|
||||
name: memory
|
||||
target:
|
||||
averageUtilization: 60
|
||||
type: Utilization
|
||||
type: Resource
|
||||
- equal:
|
||||
path: spec.maxReplicas
|
||||
value: 25
|
||||
- equal:
|
||||
path: spec.minReplicas
|
||||
value: 5
|
||||
- equal:
|
||||
path: spec.scaleTargetRef
|
||||
value:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: reposilite-unittest
|
Reference in New Issue
Block a user