chore(tests): explicitly set namespace on test (#487)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

In continuation of #486 
Sets a specific `namespace` on tests and adapts the tests in 1-2 cases
that the namespace was being tested.

**⚙️ 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

**🧪 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 corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 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

** App addition**

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

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ 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._
This commit is contained in:
Stavros Kois
2023-07-08 11:58:26 +03:00
committed by GitHub
parent 2a6714bddf
commit 8bee4dc6ab
125 changed files with 129 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should render permissions job
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: addon enabled should pass
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: addon enabled should pass
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: addon vpn gluetun enabled with config and env should pass
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with secret created for certificate
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with certificate created with labels and annotations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct name
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with name longer than 63 characters
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with custom-conf
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with hibernate
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with key-value data
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with configmap created with labels and annotations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct name
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with name longer than 63 characters
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the correct multiple args
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the correct command in scalar
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the correct fixed envs
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the correct envFrom
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the correct envList
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
# Failures
- it: should fail with dupe env in env and envList

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the correct env
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct image
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with lifecycle
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct container name
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the correct ports without selector
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the probes correctly
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the resources correctly
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create the securityContext correctly
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with termination set
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass without tty and stdin
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with more than one primary container on a workload
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with shared volume on multiple workloads and containers with targetSelectAll
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with cronjob created with labels and annotations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with workload enabled
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with invalid concurrencyPolicy
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with daemonset created with labels and annotations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with workload enabled
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with invalid strategy
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with defaults
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with deployment created with labels and annotations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with workload enabled
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with invalid strategy
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct annotations without selector
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct name NetworkAttachmentDefinition
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with targetSelector not a list
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with extra tpl
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with data
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with secret created with labels and annotations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct name
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with name longer than 63 characters
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: default metadata should pass
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: default should pass
asserts:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: default should pass
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: default should pass
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: default should pass
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct init container
set:

View File

@@ -4,6 +4,7 @@ templates:
release:
upgrade: true
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct init container
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct init container name
set:

View File

@@ -4,6 +4,7 @@ templates:
release:
upgrade: true
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct init container name
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
# Failures
- it: should fail with empty type on init container

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with job created with labels and annotations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with workload enabled
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with invalid completionMode
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: default should pass
set:

View File

@@ -5,6 +5,7 @@ chart:
version: &version v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with key-value data
set:

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with pvc created with labels and annotations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct name
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should create pvc
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with annotations not a dict
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with automountServiceAccountToken disabled from "global"
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty dnsConfig
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty dnsPolicy
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with enableServiceLinks disabled from "global"
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty hostAliases
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with hostnetwork disabled from "global"
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with hostpid disabled from "global"
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty hostname
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should assign multiple imagePullSecret to primary pod
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty nodeSelector
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty priorityClassName
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with restartPolicy empty
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty runtimeClassName
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty schedulerName
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with securityContext from "global"
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should assign serviceAccount to primary pod
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with shareProcessNamespace disabled from "global"
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty terminationGracePeriodSeconds
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with empty tolerations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with configmap volume
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with device volume
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with emptyDir volume
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with hostPath volume
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with ixVolume volume
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with nfs volume
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with pvc volume
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with secret volume
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with rules and subjects added with tpl and primary rbac/sa
set:
@@ -81,7 +82,7 @@ tests:
value:
- kind: ServiceAccount
name: test-release-name-common-test
namespace: NAMESPACE
namespace: test-release-namespace
- kind: a-kind
name: a-name
apiGroup: rbac.authorization.k8s.io
@@ -176,10 +177,10 @@ tests:
value:
- kind: ServiceAccount
name: test-release-name-common-test-my-other-sa
namespace: NAMESPACE
namespace: test-release-namespace
- kind: ServiceAccount
name: test-release-name-common-test
namespace: NAMESPACE
namespace: test-release-namespace
- apiGroup: rbac.authorization.k8s.io
kind: a-kind
name: a-name
@@ -249,4 +250,4 @@ tests:
value:
- kind: ServiceAccount
name: test-release-name-common-test-my-other-sa
namespace: NAMESPACE
namespace: test-release-namespace

View File

@@ -5,6 +5,7 @@ chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with rbac created with labels and annotations
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct name
set:

View File

@@ -3,6 +3,7 @@ templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with name longer than 63 characters
set:

Some files were not shown because too many files have changed in this diff Show More