diff --git a/tests/k8s/1-034_validate_webhook_notifications/01-assert.yaml b/tests/k8s/1-034_validate_webhook_notifications/01-assert.yaml index 9caf46bc2..e5538b7bf 100644 --- a/tests/k8s/1-034_validate_webhook_notifications/01-assert.yaml +++ b/tests/k8s/1-034_validate_webhook_notifications/01-assert.yaml @@ -1,7 +1,7 @@ apiVersion: argoproj.io/v1alpha1 kind: ArgoCD metadata: - name: argocd + name: example status: phase: Available notificationsController: Running diff --git a/tests/k8s/1-034_validate_webhook_notifications/01-install-argocd.yaml b/tests/k8s/1-034_validate_webhook_notifications/01-install-argocd.yaml index fbf2dd794..b805ecf93 100644 --- a/tests/k8s/1-034_validate_webhook_notifications/01-install-argocd.yaml +++ b/tests/k8s/1-034_validate_webhook_notifications/01-install-argocd.yaml @@ -1,7 +1,7 @@ apiVersion: argoproj.io/v1alpha1 kind: ArgoCD metadata: - name: argocd + name: example spec: notifications: enabled: true diff --git a/tests/k8s/1-034_validate_webhook_notifications/02-update-notifications-cm.yaml b/tests/k8s/1-034_validate_webhook_notifications/02-update-notifications-cm.yaml index 39aea3253..4b70e6265 100644 --- a/tests/k8s/1-034_validate_webhook_notifications/02-update-notifications-cm.yaml +++ b/tests/k8s/1-034_validate_webhook_notifications/02-update-notifications-cm.yaml @@ -10,7 +10,7 @@ data: test-webhook: method: POST body: | - {"created":"{{.app.metadata.name}}"} + {"created":"{{.app.metadata.name}}","type":"{{(call .repo.GetAppDetails).Type}}"} trigger.test-on-created: |- - description: Application is created. send: ["test-app-created"] diff --git a/tests/k8s/1-034_validate_webhook_notifications/04-create-app.yaml b/tests/k8s/1-034_validate_webhook_notifications/04-create-app.yaml index 9ae4ff956..932c9da75 100644 --- a/tests/k8s/1-034_validate_webhook_notifications/04-create-app.yaml +++ b/tests/k8s/1-034_validate_webhook_notifications/04-create-app.yaml @@ -22,4 +22,4 @@ commands: path: test/examples/nginx targetRevision: HEAD EOF -- script: sleep 5 \ No newline at end of file +- script: sleep 10 \ No newline at end of file diff --git a/tests/k8s/1-034_validate_webhook_notifications/05-verify-webhook-notification.yaml b/tests/k8s/1-034_validate_webhook_notifications/05-verify-webhook-notification.yaml index ab1d9436d..d93806d64 100644 --- a/tests/k8s/1-034_validate_webhook_notifications/05-verify-webhook-notification.yaml +++ b/tests/k8s/1-034_validate_webhook_notifications/05-verify-webhook-notification.yaml @@ -4,7 +4,7 @@ commands: # verify no x509 in notifications-controller logs - script: | #!/bin/bash - kubectl -n $NAMESPACE logs deployment.apps/argocd-notifications-controller | grep "x509" + kubectl -n $NAMESPACE logs deployment.apps/example-notifications-controller | grep "x509" PREV_CMD=$? if [ $PREV_CMD -eq 1 ]; then @@ -15,11 +15,10 @@ commands: # verify notification delivery - script: | #!/bin/bash - kubectl -n $NAMESPACE logs deployment.apps/webhook | grep '{"created":"my-app-3"}' - PREV_CMD=$? - if [ $PREV_CMD -eq 0 ]; then - exit 0 - else - exit 1 - fi + # delays could occur in receiving notification, hence retry before failing + for i in {1..5} + do + sleep 5 + kubectl -n $NAMESPACE logs deployment.apps/webhook | grep '{"created":"my-app-3","type":"Directory"}' && break + done \ No newline at end of file