From 92c7c0028c21d34c3338f425a1fb34771b44023e Mon Sep 17 00:00:00 2001 From: odubajDT Date: Thu, 29 Feb 2024 07:58:10 +0100 Subject: [PATCH] add more tests Signed-off-by: odubajDT --- .../00-assert.yaml | 2 +- .../00-assert.yaml | 23 +++++++++ .../00-install.yaml | 48 +++++++++++++++++++ .../chainsaw-test.yaml | 17 +++++++ 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 test/chainsaw/integration/workload-version-missing-task/00-assert.yaml create mode 100644 test/chainsaw/integration/workload-version-missing-task/00-install.yaml create mode 100755 test/chainsaw/integration/workload-version-missing-task/chainsaw-test.yaml diff --git a/test/chainsaw/integration/workload-version-missing-evaluation/00-assert.yaml b/test/chainsaw/integration/workload-version-missing-evaluation/00-assert.yaml index 266819b56a..3420a52cb6 100644 --- a/test/chainsaw/integration/workload-version-missing-evaluation/00-assert.yaml +++ b/test/chainsaw/integration/workload-version-missing-evaluation/00-assert.yaml @@ -6,7 +6,7 @@ status: currentPhase: AppDeploy postDeploymentEvaluationStatus: Pending postDeploymentStatus: Pending - preDeploymentEvaluationStatus: Unknown + preDeploymentEvaluationStatus: Succeeded preDeploymentStatus: Succeeded status: Progressing workloadOverallStatus: Progressing diff --git a/test/chainsaw/integration/workload-version-missing-task/00-assert.yaml b/test/chainsaw/integration/workload-version-missing-task/00-assert.yaml new file mode 100644 index 0000000000..db5bdbb3a8 --- /dev/null +++ b/test/chainsaw/integration/workload-version-missing-task/00-assert.yaml @@ -0,0 +1,23 @@ +apiVersion: lifecycle.keptn.sh/v1beta1 +kind: KeptnAppVersion +metadata: + name: podtato-head-1.3-6b86b273 +status: + currentPhase: AppDeploy + postDeploymentEvaluationStatus: Pending + postDeploymentStatus: Pending + preDeploymentEvaluationStatus: Succeeded + preDeploymentStatus: Succeeded + status: Progressing + workloadOverallStatus: Progressing +--- +apiVersion: lifecycle.keptn.sh/v1beta1 +kind: KeptnWorkloadVersion +metadata: + name: podtato-head-podtato-head-entry-0.1.0 +status: + currentPhase: WorkloadPreDeployTasks + deploymentStatus: Pending + preDeploymentEvaluationStatus: Pending + preDeploymentStatus: Pending + status: Progressing diff --git a/test/chainsaw/integration/workload-version-missing-task/00-install.yaml b/test/chainsaw/integration/workload-version-missing-task/00-install.yaml new file mode 100644 index 0000000000..9a3cbf1baa --- /dev/null +++ b/test/chainsaw/integration/workload-version-missing-task/00-install.yaml @@ -0,0 +1,48 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: podtato-head-entry + labels: + app: podtato-head +spec: + selector: + matchLabels: + component: podtato-head-entry + template: + metadata: + labels: + component: podtato-head-entry + annotations: + keptn.sh/app: podtato-head + keptn.sh/workload: podtato-head-entry + keptn.sh/version: 0.1.0 + keptn.sh/pre-deployment-tasks: missing-task + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: ghcr.io/podtato-head/entry:0.2.8 + imagePullPolicy: Always + ports: + - containerPort: 9000 + env: + - name: PODTATO_PORT + value: "9000" +--- +apiVersion: v1 +kind: Service +metadata: + name: podtato-head-entry + labels: + app: podtato-head +spec: + selector: + component: podtato-head-entry + ports: + - name: http + port: 9000 + protocol: TCP + targetPort: 9000 + type: LoadBalancer + # change to NodePort if no LoadBalancer controller is available + # type: NodePort diff --git a/test/chainsaw/integration/workload-version-missing-task/chainsaw-test.yaml b/test/chainsaw/integration/workload-version-missing-task/chainsaw-test.yaml new file mode 100755 index 0000000000..0e6f1cb79e --- /dev/null +++ b/test/chainsaw/integration/workload-version-missing-task/chainsaw-test.yaml @@ -0,0 +1,17 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: workload-version-missing-task +spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled + steps: + - name: step-00 + try: + - apply: + file: 00-install.yaml + - assert: + file: 00-assert.yaml