Skip to content

Commit

Permalink
additional test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bacher <[email protected]>
  • Loading branch information
bacherfl committed Dec 13, 2022
1 parent 8b6b3b0 commit 66a462b
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/integration/workload-instance-failing-pre-task/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnAppVersion
metadata:
name: podtato-head-1.3
status:
currentPhase: AppDeploy
postDeploymentEvaluationStatus: Pending
postDeploymentStatus: Pending
preDeploymentEvaluationStatus: Succeeded
preDeploymentStatus: Succeeded
status: Progressing
workloadOverallStatus: Progressing
---
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnWorkloadInstance
metadata:
name: podtato-head-podtato-head-entry-0.1.0
status:
currentPhase: WorkloadPreDeployTasks
deploymentStatus: Pending
preDeploymentEvaluationStatus: Pending
preDeploymentStatus: Progressing
status: Progressing
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnApp
metadata:
name: podtato-head
spec:
version: "1.3"
workloads:
- name: podtato-head-entry
version: 0.1.0
postDeploymentTasks:
- post-deployment-hello
---
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnTaskDefinition
metadata:
name: check-entry-service
spec:
function:
httpRef:
url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/http.ts
parameters:
map:
url: http://podtato-head-entry:9000
---
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: check-entry-service # this will check itself for being available and thus will fail
spec:
terminationGracePeriodSeconds: 5
initContainers:
- name: init-myservice
image: busybox:1.28
command: ['sh', '-c', 'sleep 30']
containers:
- name: server
image: ghcr.io/podtato-head/entry:latest
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled'
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnAppVersion
metadata:
name: podtato-head-1.3
status:
currentPhase: AppDeploy
postDeploymentEvaluationStatus: Pending
postDeploymentStatus: Pending
preDeploymentEvaluationStatus: Succeeded
preDeploymentStatus: Succeeded
status: Progressing
workloadOverallStatus: Progressing
---
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnWorkloadInstance
metadata:
name: podtato-head-podtato-head-entry-0.1.0
status:
currentPhase: WorkloadPreDeployEvaluations
deploymentStatus: Pending
preDeploymentEvaluationStatus: Pending
preDeploymentStatus: Succeeded
status: Progressing
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnApp
metadata:
name: podtato-head
spec:
version: "1.3"
workloads:
- name: podtato-head-entry
version: 0.1.0
postDeploymentTasks:
- post-deployment-hello
---
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-evaluations: missing-evaluation
spec:
terminationGracePeriodSeconds: 5
initContainers:
- name: init-myservice
image: busybox:1.28
command: ['sh', '-c', 'sleep 30']
containers:
- name: server
image: ghcr.io/podtato-head/entry:latest
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled'

0 comments on commit 66a462b

Please sign in to comment.