Skip to content

Commit

Permalink
fix: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
saumilmac committed Jun 25, 2024
1 parent 265f7f2 commit 3500a9c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 150 deletions.
140 changes: 0 additions & 140 deletions charts/snyk-broker/tests/__snapshot__/broker_deployment_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -569,146 +569,6 @@ default values:
helm.sh/chart: snyk-broker-0.0.0
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
handles duplicative labels and adds new labels:
1: |
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-0.0.0
test: node1
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
template:
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
spec:
containers:
- env:
- name: BROKER_SERVER_URL
value: https://broker.test.snyk.io
- name: BROKER_HEALTHCHECK_PATH
value: /healthcheck
- name: BROKER_SYSTEMCHECK_PATH
value: /systemcheck
- name: BROKER_TOKEN
valueFrom:
secretKeyRef:
key: github-com-broker-token-key
name: github-com-broker-token-RELEASE-NAME
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
key: github-com-token-key
name: github-com-token-RELEASE-NAME
- name: PORT
value: "8000"
- name: BROKER_CLIENT_URL
value: http://brokerclient
- name: LOG_LEVEL
value: info
- name: LOG_ENABLE_BODY
value: "false"
- name: ACCEPT_CODE
value: "true"
- name: ACCEPT_IAC
value: tf,yaml,yml,json,tpl
- name: BROKER_DISPATCHER_BASE_URL
value: https://api.test.snyk.io
image: snyk/broker:github-com
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthcheck
port: 8000
scheme: HTTP
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 1
name: github-com-broker-RELEASE-NAME
ports:
- containerPort: 8000
name: http
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthcheck
port: 8000
scheme: HTTP
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 1
resources:
limits:
cpu: 1
memory: 256Mi
requests:
cpu: 1
memory: 256Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
volumeMounts: null
securityContext: {}
serviceAccountName: snyk-broker-RELEASE-NAME
volumes: null
2: |
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-0.0.0
test: node1
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
ports:
- port: 8000
targetPort: 8000
selector:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
type: ClusterIP
3: |
apiVersion: v1
data:
github-com-broker-token-key: MTIz
kind: Secret
metadata:
name: github-com-broker-token-RELEASE-NAME
type: Opaque
4: |
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-0.0.0
test: node1
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
preflight checks off:
1: |
apiVersion: apps/v1
Expand Down
25 changes: 25 additions & 0 deletions charts/snyk-broker/tests/broker_deployment_labels_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
suite: test broker deployment
chart:
version: 0.0.0
templates:
- broker_deployment.yaml
- broker_service.yaml
- serviceaccount.yaml

tests:
- it: handles duplicative labels and adds new labels
values:
- ./fixtures/default_values.yaml
set:
labels:
app.kubernetes.io/name: "my duplicated label"
test: node1
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-0.0.0
test: node1
11 changes: 1 addition & 10 deletions charts/snyk-broker/tests/broker_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,4 @@ tests:
values:
- ./fixtures/default_values_ha_on_4_replicas.yaml
asserts:
- matchSnapshot: {}
- it: handles duplicative labels and adds new labels
values:
- ./fixtures/default_values.yaml
set:
labels:
app.kubernetes.io/name: "my duplicated label"
test: node1
asserts:
- matchSnapshot: {}
- matchSnapshot: {}

0 comments on commit 3500a9c

Please sign in to comment.