From 38967eab511ecf07cd5c2dbdd5e4376df72128ea Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Sat, 17 Dec 2022 11:25:51 +0200 Subject: [PATCH] add some more tests --- .../resources_test.yaml | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/library/common-test/tests/container_in_deployment/resources_test.yaml b/library/common-test/tests/container_in_deployment/resources_test.yaml index a2f4c979..4dc12490 100644 --- a/library/common-test/tests/container_in_deployment/resources_test.yaml +++ b/library/common-test/tests/container_in_deployment/resources_test.yaml @@ -56,7 +56,7 @@ tests: cpu: 20m memory: 100Mi - - it: should pass with only one resource changed + - it: should pass with only limits.cpu resource changed documentIndex: *deploymentDoc set: resources: @@ -73,6 +73,74 @@ tests: cpu: 10m memory: 50Mi + - it: should pass with only limits.memory resource changed + documentIndex: *deploymentDoc + set: + resources: + limits: + memory: 4Gi + asserts: + - equal: + path: spec.template.spec.containers[0].resources + value: + limits: + cpu: 4000m + memory: 4Gi + requests: + cpu: 10m + memory: 50Mi + + - it: should pass with only requests.cpu resource changed + documentIndex: *deploymentDoc + set: + resources: + requests: + cpu: 20m + asserts: + - equal: + path: spec.template.spec.containers[0].resources + value: + limits: + cpu: 4000m + memory: 8Gi + requests: + cpu: 20m + memory: 50Mi + + - it: should pass with only requests.memory resource changed + documentIndex: *deploymentDoc + set: + resources: + requests: + memory: 25Mi + asserts: + - equal: + path: spec.template.spec.containers[0].resources + value: + limits: + cpu: 4000m + memory: 8Gi + requests: + cpu: 10m + memory: 25Mi + + - it: should pass with only scaleGOU resource changed + documentIndex: *deploymentDoc + set: + scaleGPU: + gpu.intel.com/i915: "1" + asserts: + - equal: + path: spec.template.spec.containers[0].resources + value: + limits: + cpu: 4000m + memory: 8Gi + gpu.intel.com/i915: "1" + requests: + cpu: 10m + memory: 50Mi + - it: should pass with changed resources and added GPU documentIndex: *deploymentDoc set: