Files
truecharts/charts/library/common-test/tests/pod/volume_emptyDIr_test.yaml
T
Kjeld Schouten 57eab2e1c5 fix(common): Improve common resources limit ratios (#38546)
**Description**
Some users report that the current ratios between requests and limits
where a bit too strict.
This increases the ratio to 20x on CPU and 12x on ram, lowing requests
and increasing limits slightly.

Its important to note that CPU is easier to share among containers, so
has the higher ratio on purpose.
The new ratio allows more room for multithreading on a container

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code
- [ ] 📜 Documentation Changes

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made changes to the documentation
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning
- [ ] I made sure the title starts with `feat(chart-name):`,
`fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or
`fix(docs):`

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._

---------

Signed-off-by: Kjeld Schouten <info@kjeldschouten.nl>
2025-09-07 14:29:50 +02:00

204 lines
5.1 KiB
YAML

suite: pod emptyDir volume test
templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with emptyDir volume
set:
some_medium: Memory
some_size: 2Gi
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
persistence:
emptyDir-vol:
enabled: true
type: emptyDir
medium: "{{ .Values.some_medium }}"
size: "{{ .Values.some_size }}"
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: emptyDir-vol
emptyDir:
medium: Memory
sizeLimit: 2Gi
- it: should pass with emptyDir volume bare bones
set:
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
persistence:
emptyDir-vol:
enabled: true
type: emptyDir
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: emptyDir-vol
emptyDir: {}
- it: should pass with emptyDir volume with medium set
set:
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
persistence:
emptyDir-vol:
enabled: true
type: emptyDir
medium: Memory
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: emptyDir-vol
emptyDir:
medium: Memory
sizeLimit: 2400Mi
- it: should pass with emptyDir volume with size set
set:
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
persistence:
emptyDir-vol:
enabled: true
type: emptyDir
size: 3Gi
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: emptyDir-vol
emptyDir:
sizeLimit: 3Gi
- it: should pass with emptyDir volume with medium Memory and size from resource limits
set:
resources:
limits:
memory: 500Mi
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
persistence:
emptyDir-vol:
enabled: true
type: emptyDir
medium: Memory
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: emptyDir-vol
emptyDir:
medium: Memory
sizeLimit: 500Mi
- it: should pass with emptyDir volume with medium Memory and size override
set:
resources:
limits:
memory: 500Mi
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
persistence:
emptyDir-vol:
enabled: true
type: emptyDir
medium: Memory
size: 1Gi
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: emptyDir-vol
emptyDir:
medium: Memory
sizeLimit: 1Gi
# Failures
- it: should fail with invalid medium in emptyDir
set:
workload:
some-workload:
enabled: true
primary: true
type: Deployment
podSpec: {}
persistence:
volume1:
enabled: true
type: emptyDir
medium: not-a-valid-medium
asserts:
- failedTemplate:
errorMessage: Persistence - Expected [medium] to be one of ["", Memory], but got [not-a-valid-medium] on [emptyDir] type
- it: should fail with invalid size format
set:
workload:
some-workload:
enabled: true
primary: true
type: Deployment
podSpec: {}
persistence:
volume1:
enabled: true
type: emptyDir
size: not-a-valid-size
asserts:
- failedTemplate:
errorMessage: Persistence Expected [size] 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 [not-a-valid-size]