Skip to content

Commit

Permalink
feat(pass-businessid): add unit test for multi-container having busin…
Browse files Browse the repository at this point in the history
…essid as PodMetadata
  • Loading branch information
thomas.lee committed Dec 4, 2024
1 parent a805700 commit 3ace714
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cronjob/tests/cronjob_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,13 @@ tests:
businessid: ~
asserts:
- failedTemplate:
errorMessage: businessid must be provided
errorMessage: businessid must be provided
- it: should render an multi-container argo cron workflow
values:
- ./values/cronjob/argo_multi_container.yaml
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.workflowSpec.templates[1].metadata.labels.businessid
value: "some-business-id"
102 changes: 102 additions & 0 deletions cronjob/tests/values/cronjob/argo_multi_container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: simple-cron-workflow
schedule: 1 * * * *
kind: CronWorkflow
businessid: "some-business-id"
startingDeadlineSeconds: {}
job:
retries: 1
timeout: 1800
retryPolicy: OnFailure
ttlStrategy:
secondsAfterCompletion: 600
podGC:
strategy: OnPodCompletion
annotations: {}
image:
repository: test/testImage
tag: latest
command:
- bundle
- exec
- rails
- test
args:
- abc
resources:
requests:
cpu: 300m
memory: 2Gi
exitNotifications:
slackApp:
portalDomain: https://argo.com
webhookUrl: https://webhook/service/test
mention:
onFailure:
- U0123ABC123
- S0345DEF345
onSuccess:
- U0123ABC123
- S0345DEF345
newRelic:
image:
repository: test/test-newrelic-agent
tag: latest
licenseKey: 12345testtest1234test
appName: Test App
healthcheckIo:
uuid: arf21-323s-232d-23dasd
env:
RAILS_ENV: staging
envSecrets:
MONGODB_USER: mongodb
envFrom:
configMapRef:
- test-1-env
- test-2-env
secretRef:
- test-1-secret
- test-2-secret
serviceaccount:
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/my-service-account
name: my-service-account
pdb:
enable: true
minAvailable: 9999
securityContextForPod:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
nodeSelector:
nodegroup: ec-eks-db-cpu-node-autoscaling-group
tolerations:
- key: shop-callback-node
operator: Equal
value: "true"
effect: NoSchedule
dnsConfig:
options:
- name: ndots
value: "5"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node.kubernetes.io/instance-type
operator: In
values:
- m6i.2xlarge
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
a: 1
topologyKey: topology.kubernetes.io/zone
containers:
- name: multi-step-test-container
image:
repository: test/testImage
tag: latest
args:
- echo "Hello, World!"

0 comments on commit 3ace714

Please sign in to comment.