Skip to content

Add e2e tests verifying pod spec fields are propagated to generated pods#30

Draft
moshloop with Copilot wants to merge 1 commit into
mainfrom
copilot/create-e2e-tests-for-pod-spec
Draft

Add e2e tests verifying pod spec fields are propagated to generated pods#30
moshloop with Copilot wants to merge 1 commit into
mainfrom
copilot/create-e2e-tests-for-pod-spec

Conversation

Copilot AI commented Apr 15, 2026

Copy link
Copy Markdown

No e2e coverage existed to confirm that pod spec fields set on a BatchTrigger (tolerations, annotations, nodeSelector, securityContext, initContainers, resource limits, env vars) actually appear on the created pod.

New fixture: fixtures/pod-spec.yaml

A BatchTrigger with a pod template exercising a broad set of fields:

  • Metadata: static + templated annotations and labels
  • tolerations, nodeSelector, securityContext (runAsUser/runAsGroup/fsGroup)
  • serviceAccountName, initContainers
  • Container env (static + templated), resources.limits/requests

New test: "Should apply all pod spec fields to the generated pod"

Sends a message with pod_label, annotation_value, and env_value template variables, then asserts each field is present on the resulting pod:

Expect(pod.Spec.Tolerations).To(ContainElement(corev1.Toleration{
    Key: "dedicated", Operator: corev1.TolerationOpEqual,
    Value: "batch", Effect: corev1.TaintEffectNoSchedule,
}))
Expect(*pod.Spec.SecurityContext.RunAsUser).To(Equal(int64(1000)))
Expect(container.Env).To(ContainElement(corev1.EnvVar{Name: "DYNAMIC_ENV", Value: envValue}))
Expect(container.Resources.Limits[corev1.ResourceCPU]).To(Equal(resource.MustParse("100m")))

Also adds test-batch-runner-pod-spec to the LocalStack queue creation step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants