resources_test.yaml 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  1. suite: container resources test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should create the resources correctly
  6. set:
  7. image: &image
  8. repository: nginx
  9. tag: 1.19.0
  10. pullPolicy: IfNotPresent
  11. workload:
  12. workload-name1:
  13. enabled: true
  14. primary: true
  15. type: Deployment
  16. podSpec:
  17. containers:
  18. container-name1:
  19. enabled: true
  20. primary: true
  21. imageSelector: image
  22. probes: &probes
  23. liveness:
  24. enabled: false
  25. readiness:
  26. enabled: false
  27. startup:
  28. enabled: false
  29. asserts:
  30. - documentIndex: &deploymentDoc 0
  31. isKind:
  32. of: Deployment
  33. - documentIndex: *deploymentDoc
  34. isAPIVersion:
  35. of: apps/v1
  36. - documentIndex: *deploymentDoc
  37. isSubset:
  38. path: spec.template.spec.containers[0]
  39. content:
  40. resources:
  41. limits:
  42. cpu: 4000m
  43. memory: 8Gi
  44. requests:
  45. cpu: 10m
  46. memory: 50Mi
  47. - it: should override the default limits
  48. set:
  49. image: *image
  50. workload:
  51. workload-name1:
  52. enabled: true
  53. primary: true
  54. type: Deployment
  55. podSpec:
  56. containers:
  57. container-name1:
  58. enabled: true
  59. primary: true
  60. imageSelector: image
  61. probes: *probes
  62. resources:
  63. limits:
  64. cpu: 2000m
  65. memory: 4Gi
  66. asserts:
  67. - documentIndex: &deploymentDoc 0
  68. isKind:
  69. of: Deployment
  70. - documentIndex: *deploymentDoc
  71. isAPIVersion:
  72. of: apps/v1
  73. - documentIndex: *deploymentDoc
  74. isSubset:
  75. path: spec.template.spec.containers[0]
  76. content:
  77. resources:
  78. limits:
  79. cpu: 2000m
  80. memory: 4Gi
  81. requests:
  82. cpu: 10m
  83. memory: 50Mi
  84. - it: should override the default limits.cpu
  85. set:
  86. image: *image
  87. workload:
  88. workload-name1:
  89. enabled: true
  90. primary: true
  91. type: Deployment
  92. podSpec:
  93. containers:
  94. container-name1:
  95. enabled: true
  96. primary: true
  97. imageSelector: image
  98. probes: *probes
  99. resources:
  100. limits:
  101. cpu: 2000m
  102. asserts:
  103. - documentIndex: &deploymentDoc 0
  104. isKind:
  105. of: Deployment
  106. - documentIndex: *deploymentDoc
  107. isAPIVersion:
  108. of: apps/v1
  109. - documentIndex: *deploymentDoc
  110. isSubset:
  111. path: spec.template.spec.containers[0]
  112. content:
  113. resources:
  114. limits:
  115. cpu: 2000m
  116. memory: 8Gi
  117. requests:
  118. cpu: 10m
  119. memory: 50Mi
  120. - it: should override the default limits.memory
  121. set:
  122. image: *image
  123. workload:
  124. workload-name1:
  125. enabled: true
  126. primary: true
  127. type: Deployment
  128. podSpec:
  129. containers:
  130. container-name1:
  131. enabled: true
  132. primary: true
  133. imageSelector: image
  134. probes: *probes
  135. resources:
  136. limits:
  137. memory: 4Gi
  138. asserts:
  139. - documentIndex: &deploymentDoc 0
  140. isKind:
  141. of: Deployment
  142. - documentIndex: *deploymentDoc
  143. isAPIVersion:
  144. of: apps/v1
  145. - documentIndex: *deploymentDoc
  146. isSubset:
  147. path: spec.template.spec.containers[0]
  148. content:
  149. resources:
  150. limits:
  151. cpu: 4000m
  152. memory: 4Gi
  153. requests:
  154. cpu: 10m
  155. memory: 50Mi
  156. - it: should not render limits.cpu
  157. set:
  158. image: *image
  159. workload:
  160. workload-name1:
  161. enabled: true
  162. primary: true
  163. type: Deployment
  164. podSpec:
  165. containers:
  166. container-name1:
  167. enabled: true
  168. primary: true
  169. imageSelector: image
  170. probes: *probes
  171. resources:
  172. limits:
  173. cpu: 0
  174. asserts:
  175. - documentIndex: &deploymentDoc 0
  176. isKind:
  177. of: Deployment
  178. - documentIndex: *deploymentDoc
  179. isAPIVersion:
  180. of: apps/v1
  181. - documentIndex: *deploymentDoc
  182. isSubset:
  183. path: spec.template.spec.containers[0]
  184. content:
  185. resources:
  186. limits:
  187. memory: 8Gi
  188. requests:
  189. cpu: 10m
  190. memory: 50Mi
  191. - it: should not render limits.memory
  192. set:
  193. image: *image
  194. workload:
  195. workload-name1:
  196. enabled: true
  197. primary: true
  198. type: Deployment
  199. podSpec:
  200. containers:
  201. container-name1:
  202. enabled: true
  203. primary: true
  204. imageSelector: image
  205. probes: *probes
  206. resources:
  207. limits:
  208. memory: 0
  209. asserts:
  210. - documentIndex: &deploymentDoc 0
  211. isKind:
  212. of: Deployment
  213. - documentIndex: *deploymentDoc
  214. isAPIVersion:
  215. of: apps/v1
  216. - documentIndex: *deploymentDoc
  217. isSubset:
  218. path: spec.template.spec.containers[0]
  219. content:
  220. resources:
  221. limits:
  222. cpu: 4000m
  223. requests:
  224. cpu: 10m
  225. memory: 50Mi
  226. - it: should override the default requests
  227. set:
  228. image: *image
  229. workload:
  230. workload-name1:
  231. enabled: true
  232. primary: true
  233. type: Deployment
  234. podSpec:
  235. containers:
  236. container-name1:
  237. enabled: true
  238. primary: true
  239. imageSelector: image
  240. probes: *probes
  241. resources:
  242. requests:
  243. cpu: 200m
  244. memory: 1Gi
  245. asserts:
  246. - documentIndex: &deploymentDoc 0
  247. isKind:
  248. of: Deployment
  249. - documentIndex: *deploymentDoc
  250. isAPIVersion:
  251. of: apps/v1
  252. - documentIndex: *deploymentDoc
  253. isSubset:
  254. path: spec.template.spec.containers[0]
  255. content:
  256. resources:
  257. limits:
  258. cpu: 4000m
  259. memory: 8Gi
  260. requests:
  261. cpu: 200m
  262. memory: 1Gi
  263. - it: should override the default requests.cpu
  264. set:
  265. image: *image
  266. workload:
  267. workload-name1:
  268. enabled: true
  269. primary: true
  270. type: Deployment
  271. podSpec:
  272. containers:
  273. container-name1:
  274. enabled: true
  275. primary: true
  276. imageSelector: image
  277. probes: *probes
  278. resources:
  279. requests:
  280. cpu: 200m
  281. asserts:
  282. - documentIndex: &deploymentDoc 0
  283. isKind:
  284. of: Deployment
  285. - documentIndex: *deploymentDoc
  286. isAPIVersion:
  287. of: apps/v1
  288. - documentIndex: *deploymentDoc
  289. isSubset:
  290. path: spec.template.spec.containers[0]
  291. content:
  292. resources:
  293. limits:
  294. cpu: 4000m
  295. memory: 8Gi
  296. requests:
  297. cpu: 200m
  298. memory: 50Mi
  299. - it: should override the default requests.memory
  300. set:
  301. image: *image
  302. workload:
  303. workload-name1:
  304. enabled: true
  305. primary: true
  306. type: Deployment
  307. podSpec:
  308. containers:
  309. container-name1:
  310. enabled: true
  311. primary: true
  312. imageSelector: image
  313. probes: *probes
  314. resources:
  315. requests:
  316. memory: 1Gi
  317. asserts:
  318. - documentIndex: &deploymentDoc 0
  319. isKind:
  320. of: Deployment
  321. - documentIndex: *deploymentDoc
  322. isAPIVersion:
  323. of: apps/v1
  324. - documentIndex: *deploymentDoc
  325. isSubset:
  326. path: spec.template.spec.containers[0]
  327. content:
  328. resources:
  329. limits:
  330. cpu: 4000m
  331. memory: 8Gi
  332. requests:
  333. cpu: 10m
  334. memory: 1Gi
  335. - it: should assign GPU on the primary pod/container
  336. set:
  337. image: *image
  338. scaleGPU:
  339. - gpu:
  340. nvidia.com/gpu: 1
  341. global:
  342. ixChartContext:
  343. addNvidiaRuntimeClass: true
  344. nvidiaRuntimeClassName: nvidia
  345. workload:
  346. workload-name1:
  347. enabled: true
  348. primary: true
  349. type: Deployment
  350. podSpec:
  351. containers:
  352. container-name1:
  353. enabled: true
  354. primary: true
  355. imageSelector: image
  356. probes: *probes
  357. container-name2:
  358. enabled: true
  359. primary: false
  360. imageSelector: image
  361. probes: *probes
  362. workload-name2:
  363. enabled: true
  364. primary: false
  365. type: Deployment
  366. podSpec:
  367. containers:
  368. container-name1:
  369. enabled: true
  370. primary: true
  371. imageSelector: image
  372. probes: *probes
  373. asserts:
  374. - documentIndex: &deploymentDoc 0
  375. isKind:
  376. of: Deployment
  377. - documentIndex: *deploymentDoc
  378. isAPIVersion:
  379. of: apps/v1
  380. - documentIndex: *deploymentDoc
  381. equal:
  382. path: spec.template.spec.runtimeClassName
  383. value: nvidia
  384. - documentIndex: *deploymentDoc
  385. isSubset:
  386. path: spec.template.spec.containers[0]
  387. content:
  388. resources:
  389. limits:
  390. cpu: 4000m
  391. memory: 8Gi
  392. nvidia.com/gpu: "1"
  393. requests:
  394. cpu: 10m
  395. memory: 50Mi
  396. - documentIndex: *deploymentDoc
  397. isSubset:
  398. path: spec.template.spec.containers[1]
  399. content:
  400. resources:
  401. limits:
  402. cpu: 4000m
  403. memory: 8Gi
  404. requests:
  405. cpu: 10m
  406. memory: 50Mi
  407. - documentIndex: &otherDeploymentDoc 1
  408. isKind:
  409. of: Deployment
  410. - documentIndex: *otherDeploymentDoc
  411. isAPIVersion:
  412. of: apps/v1
  413. - documentIndex: *otherDeploymentDoc
  414. isNull:
  415. path: spec.template.spec.runtimeClassName
  416. - documentIndex: *otherDeploymentDoc
  417. isSubset:
  418. path: spec.template.spec.containers[0]
  419. content:
  420. resources:
  421. limits:
  422. cpu: 4000m
  423. memory: 8Gi
  424. requests:
  425. cpu: 10m
  426. memory: 50Mi
  427. - it: should assign GPU on the selected pod/container
  428. set:
  429. image: *image
  430. global:
  431. ixChartContext:
  432. addNvidiaRuntimeClass: true
  433. nvidiaRuntimeClassName: nvidia
  434. scaleGPU:
  435. - gpu:
  436. nvidia.com/gpu: 1
  437. targetSelector:
  438. workload-name2:
  439. - container-name1
  440. workload:
  441. workload-name1:
  442. enabled: true
  443. primary: true
  444. type: Deployment
  445. podSpec:
  446. containers:
  447. container-name1:
  448. enabled: true
  449. primary: true
  450. imageSelector: image
  451. probes: *probes
  452. container-name2:
  453. enabled: true
  454. primary: false
  455. imageSelector: image
  456. probes: *probes
  457. workload-name2:
  458. enabled: true
  459. primary: false
  460. type: Deployment
  461. podSpec:
  462. containers:
  463. container-name1:
  464. enabled: true
  465. primary: true
  466. imageSelector: image
  467. probes: *probes
  468. asserts:
  469. - documentIndex: &deploymentDoc 0
  470. isKind:
  471. of: Deployment
  472. - documentIndex: *deploymentDoc
  473. isAPIVersion:
  474. of: apps/v1
  475. - documentIndex: *deploymentDoc
  476. isNull:
  477. path: spec.template.spec.runtimeClassName
  478. - documentIndex: *deploymentDoc
  479. isSubset:
  480. path: spec.template.spec.containers[0]
  481. content:
  482. resources:
  483. limits:
  484. cpu: 4000m
  485. memory: 8Gi
  486. requests:
  487. cpu: 10m
  488. memory: 50Mi
  489. - documentIndex: *deploymentDoc
  490. isSubset:
  491. path: spec.template.spec.containers[1]
  492. content:
  493. resources:
  494. limits:
  495. cpu: 4000m
  496. memory: 8Gi
  497. requests:
  498. cpu: 10m
  499. memory: 50Mi
  500. - documentIndex: &otherDeploymentDoc 1
  501. isKind:
  502. of: Deployment
  503. - documentIndex: *otherDeploymentDoc
  504. isAPIVersion:
  505. of: apps/v1
  506. - documentIndex: *otherDeploymentDoc
  507. equal:
  508. path: spec.template.spec.runtimeClassName
  509. value: nvidia
  510. - documentIndex: *otherDeploymentDoc
  511. isSubset:
  512. path: spec.template.spec.containers[0]
  513. content:
  514. resources:
  515. limits:
  516. cpu: 4000m
  517. memory: 8Gi
  518. nvidia.com/gpu: "1"
  519. requests:
  520. cpu: 10m
  521. memory: 50Mi
  522. - it: should assign GPU on the selected pods/containers
  523. set:
  524. image: *image
  525. global:
  526. ixChartContext:
  527. addNvidiaRuntimeClass: true
  528. nvidiaRuntimeClassName: nvidia
  529. scaleGPU:
  530. - gpu:
  531. nvidia.com/gpu: 1
  532. targetSelector:
  533. workload-name1:
  534. - container-name1
  535. - container-name2
  536. workload:
  537. workload-name1:
  538. enabled: true
  539. primary: true
  540. type: Deployment
  541. podSpec:
  542. containers:
  543. container-name1:
  544. enabled: true
  545. primary: true
  546. imageSelector: image
  547. probes: *probes
  548. container-name2:
  549. enabled: true
  550. primary: false
  551. imageSelector: image
  552. probes: *probes
  553. workload-name2:
  554. enabled: true
  555. primary: false
  556. type: Deployment
  557. podSpec:
  558. containers:
  559. container-name1:
  560. enabled: true
  561. primary: true
  562. imageSelector: image
  563. probes: *probes
  564. asserts:
  565. - documentIndex: &deploymentDoc 0
  566. isKind:
  567. of: Deployment
  568. - documentIndex: *deploymentDoc
  569. isAPIVersion:
  570. of: apps/v1
  571. - documentIndex: *deploymentDoc
  572. equal:
  573. path: spec.template.spec.runtimeClassName
  574. value: nvidia
  575. - documentIndex: *deploymentDoc
  576. isSubset:
  577. path: spec.template.spec.containers[0]
  578. content:
  579. resources:
  580. limits:
  581. cpu: 4000m
  582. memory: 8Gi
  583. nvidia.com/gpu: "1"
  584. requests:
  585. cpu: 10m
  586. memory: 50Mi
  587. - documentIndex: *deploymentDoc
  588. isSubset:
  589. path: spec.template.spec.containers[1]
  590. content:
  591. resources:
  592. limits:
  593. cpu: 4000m
  594. memory: 8Gi
  595. nvidia.com/gpu: "1"
  596. requests:
  597. cpu: 10m
  598. memory: 50Mi
  599. - documentIndex: &otherDeploymentDoc 1
  600. isKind:
  601. of: Deployment
  602. - documentIndex: *otherDeploymentDoc
  603. isAPIVersion:
  604. of: apps/v1
  605. - documentIndex: *otherDeploymentDoc
  606. isNull:
  607. path: spec.template.spec.runtimeClassName
  608. - documentIndex: *otherDeploymentDoc
  609. isSubset:
  610. path: spec.template.spec.containers[0]
  611. content:
  612. resources:
  613. limits:
  614. cpu: 4000m
  615. memory: 8Gi
  616. requests:
  617. cpu: 10m
  618. memory: 50Mi
  619. - it: should assign GPU on the selected pod/container with multiple GPUs
  620. set:
  621. image: *image
  622. global:
  623. ixChartContext:
  624. addNvidiaRuntimeClass: true
  625. nvidiaRuntimeClassName: nvidia
  626. scaleGPU:
  627. - gpu:
  628. nvidia.com/gpu: 1
  629. amd.com/gpu: 0
  630. targetSelector:
  631. workload-name1:
  632. - container-name1
  633. - container-name2
  634. workload:
  635. workload-name1:
  636. enabled: true
  637. primary: true
  638. type: Deployment
  639. podSpec:
  640. containers:
  641. container-name1:
  642. enabled: true
  643. primary: true
  644. imageSelector: image
  645. probes: *probes
  646. container-name2:
  647. enabled: true
  648. primary: false
  649. imageSelector: image
  650. probes: *probes
  651. asserts:
  652. - documentIndex: &deploymentDoc 0
  653. isKind:
  654. of: Deployment
  655. - documentIndex: *deploymentDoc
  656. isAPIVersion:
  657. of: apps/v1
  658. - documentIndex: *deploymentDoc
  659. equal:
  660. path: spec.template.spec.runtimeClassName
  661. value: nvidia
  662. - documentIndex: *deploymentDoc
  663. isSubset:
  664. path: spec.template.spec.containers[0]
  665. content:
  666. resources:
  667. limits:
  668. cpu: 4000m
  669. memory: 8Gi
  670. nvidia.com/gpu: "1"
  671. requests:
  672. cpu: 10m
  673. memory: 50Mi
  674. - documentIndex: *deploymentDoc
  675. isSubset:
  676. path: spec.template.spec.containers[1]
  677. content:
  678. resources:
  679. limits:
  680. cpu: 4000m
  681. memory: 8Gi
  682. nvidia.com/gpu: "1"
  683. requests:
  684. cpu: 10m
  685. memory: 50Mi
  686. - it: should assign multiple GPU on the selected pod/container with multiple selected GPUs
  687. set:
  688. image: *image
  689. global:
  690. ixChartContext:
  691. addNvidiaRuntimeClass: true
  692. nvidiaRuntimeClassName: nvidia
  693. scaleGPU:
  694. - gpu:
  695. nvidia.com/gpu: 1
  696. amd.com/gpu: 0
  697. targetSelector:
  698. workload-name1:
  699. - container-name1
  700. - gpu:
  701. nvidia.com/gpu: 0
  702. amd.com/gpu: 1
  703. targetSelector:
  704. workload-name1:
  705. - container-name2
  706. workload:
  707. workload-name1:
  708. enabled: true
  709. primary: true
  710. type: Deployment
  711. podSpec:
  712. containers:
  713. container-name1:
  714. enabled: true
  715. primary: true
  716. imageSelector: image
  717. probes: *probes
  718. container-name2:
  719. enabled: true
  720. primary: false
  721. imageSelector: image
  722. probes: *probes
  723. asserts:
  724. - documentIndex: &deploymentDoc 0
  725. isKind:
  726. of: Deployment
  727. - documentIndex: *deploymentDoc
  728. isAPIVersion:
  729. of: apps/v1
  730. - documentIndex: *deploymentDoc
  731. equal:
  732. path: spec.template.spec.runtimeClassName
  733. value: nvidia
  734. - documentIndex: *deploymentDoc
  735. isSubset:
  736. path: spec.template.spec.containers[0]
  737. content:
  738. resources:
  739. limits:
  740. cpu: 4000m
  741. memory: 8Gi
  742. nvidia.com/gpu: "1"
  743. requests:
  744. cpu: 10m
  745. memory: 50Mi
  746. - documentIndex: *deploymentDoc
  747. isSubset:
  748. path: spec.template.spec.containers[1]
  749. content:
  750. resources:
  751. limits:
  752. cpu: 4000m
  753. memory: 8Gi
  754. amd.com/gpu: "1"
  755. requests:
  756. cpu: 10m
  757. memory: 50Mi
  758. # Failures
  759. - it: should fail with empty requests
  760. set:
  761. image: *image
  762. resources:
  763. requests:
  764. workload:
  765. workload-name1:
  766. enabled: true
  767. primary: true
  768. type: Deployment
  769. podSpec:
  770. containers:
  771. container-name1:
  772. enabled: true
  773. primary: true
  774. imageSelector: image
  775. probes: *probes
  776. asserts:
  777. - failedTemplate:
  778. errorMessage: Container - Expected non-empty <resources.requests>
  779. - it: should fail with empty requests.cpu
  780. set:
  781. image: *image
  782. resources:
  783. requests:
  784. cpu: ""
  785. workload:
  786. workload-name1:
  787. enabled: true
  788. primary: true
  789. type: Deployment
  790. podSpec:
  791. containers:
  792. container-name1:
  793. enabled: true
  794. primary: true
  795. imageSelector: image
  796. probes: *probes
  797. asserts:
  798. - failedTemplate:
  799. errorMessage: Container - Expected non-empty <resources.requests.cpu>
  800. - it: should fail with empty requests.memory
  801. set:
  802. image: *image
  803. resources:
  804. requests:
  805. cpu: 10m
  806. memory: ""
  807. workload:
  808. workload-name1:
  809. enabled: true
  810. primary: true
  811. type: Deployment
  812. podSpec:
  813. containers:
  814. container-name1:
  815. enabled: true
  816. primary: true
  817. imageSelector: image
  818. probes: *probes
  819. asserts:
  820. - failedTemplate:
  821. errorMessage: Container - Expected non-empty <resources.requests.memory>
  822. - it: should fail with invalid format in requests.cpu
  823. set:
  824. image: *image
  825. resources:
  826. requests:
  827. cpu: 10MB
  828. memory: 50Mi
  829. workload:
  830. workload-name1:
  831. enabled: true
  832. primary: true
  833. type: Deployment
  834. podSpec:
  835. containers:
  836. container-name1:
  837. enabled: true
  838. primary: true
  839. imageSelector: image
  840. probes: *probes
  841. asserts:
  842. - failedTemplate:
  843. errorMessage: Container - Expected <resources.requests.cpu> to have one of the following formats [(Plain Integer - eg. 1), (Float - eg. 0.5), (Milicpu - eg. 500m)], but got [10MB]
  844. - it: should fail with invalid format in limits.cpu
  845. set:
  846. image: *image
  847. resources:
  848. requests:
  849. cpu: 10m
  850. memory: 50Mi
  851. limits:
  852. cpu: 10MB
  853. memory: 8Gi
  854. workload:
  855. workload-name1:
  856. enabled: true
  857. primary: true
  858. type: Deployment
  859. podSpec:
  860. containers:
  861. container-name1:
  862. enabled: true
  863. primary: true
  864. imageSelector: image
  865. probes: *probes
  866. asserts:
  867. - failedTemplate:
  868. errorMessage: Container - Expected <resources.limits.cpu> to have one of the following formats [(Plain Integer - eg. 1), (Float - eg. 0.5), (Milicpu - eg. 500m)], but got [10MB]
  869. - it: should fail with invalid format in requests.memory
  870. set:
  871. image: *image
  872. resources:
  873. requests:
  874. cpu: 10m
  875. memory: 50MB
  876. limits:
  877. cpu: 4000m
  878. memory: 8Gi
  879. workload:
  880. workload-name1:
  881. enabled: true
  882. primary: true
  883. type: Deployment
  884. podSpec:
  885. containers:
  886. container-name1:
  887. enabled: true
  888. primary: true
  889. imageSelector: image
  890. probes: *probes
  891. asserts:
  892. - failedTemplate:
  893. errorMessage: Container - Expected <resources.requests.memory> to have one of the following formats [(Suffixed with E/P/T/G/M/K - eg. 1G), (Suffixed with Ei/Pi/Ti/Gi/Mi/Ki - eg. 1Gi), (Plain Integer in bytes - eg. 1024), (Exponent - eg. 134e6)], but got [50MB]
  894. - it: should fail with invalid format in limits.memory
  895. set:
  896. image: *image
  897. resources:
  898. requests:
  899. cpu: 10m
  900. memory: 50Mi
  901. limits:
  902. cpu: 4000m
  903. memory: 8GB
  904. workload:
  905. workload-name1:
  906. enabled: true
  907. primary: true
  908. type: Deployment
  909. podSpec:
  910. containers:
  911. container-name1:
  912. enabled: true
  913. primary: true
  914. imageSelector: image
  915. probes: *probes
  916. asserts:
  917. - failedTemplate:
  918. errorMessage: Container - Expected <resources.limits.memory> to have one of the following formats [(Suffixed with E/P/T/G/M/K - eg. 1G), (Suffixed with Ei/Pi/Ti/Gi/Mi/Ki - eg. 1Gi), (Plain Integer in bytes - eg. 1024), (Exponent - eg. 134e6)], but got [8GB]
  919. - it: should fail with empty gpu in defined entry
  920. set:
  921. image: *image
  922. scaleGPU:
  923. - gpu:
  924. targetSelector:
  925. workload-name1:
  926. - container-name1
  927. workload:
  928. workload-name1:
  929. enabled: true
  930. primary: true
  931. type: Deployment
  932. podSpec:
  933. containers:
  934. container-name1:
  935. enabled: true
  936. primary: true
  937. imageSelector: image
  938. probes: *probes
  939. asserts:
  940. - failedTemplate:
  941. errorMessage: Container - Expected non-empty <scaleGPU.gpu>
  942. - it: should fail with empty list under workload in targetSelector
  943. set:
  944. image: *image
  945. scaleGPU:
  946. - gpu:
  947. key: value
  948. targetSelector:
  949. workload-name1: []
  950. workload:
  951. workload-name1:
  952. enabled: true
  953. primary: true
  954. type: Deployment
  955. podSpec:
  956. containers:
  957. container-name1:
  958. enabled: true
  959. primary: true
  960. imageSelector: image
  961. probes: *probes
  962. asserts:
  963. - failedTemplate:
  964. errorMessage: Container - Expected non-empty list under pod in <scaleGPU.targetSelector>
  965. - it: should fail with empty value in gpu
  966. set:
  967. image: *image
  968. scaleGPU:
  969. - gpu:
  970. key: ""
  971. targetSelector:
  972. workload-name1:
  973. - container-name1
  974. workload:
  975. workload-name1:
  976. enabled: true
  977. primary: true
  978. type: Deployment
  979. podSpec:
  980. containers:
  981. container-name1:
  982. enabled: true
  983. primary: true
  984. imageSelector: image
  985. probes: *probes
  986. asserts:
  987. - failedTemplate:
  988. errorMessage: Container - Expected non-empty <scaleGPU> <value>
  989. - it: should fail with no value in gpu
  990. set:
  991. image: *image
  992. scaleGPU:
  993. - gpu:
  994. key:
  995. targetSelector:
  996. workload-name1:
  997. - container-name1
  998. workload:
  999. workload-name1:
  1000. enabled: true
  1001. primary: true
  1002. type: Deployment
  1003. podSpec:
  1004. containers:
  1005. container-name1:
  1006. enabled: true
  1007. primary: true
  1008. imageSelector: image
  1009. probes: *probes
  1010. asserts:
  1011. - failedTemplate:
  1012. errorMessage: Container - Expected non-empty <scaleGPU> <value>