From 68cd0759187993bf5ba473628443419db0e539da Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Fri, 31 Jan 2025 23:06:13 -0500 Subject: [PATCH] clean up test resources && fix failing test Signed-off-by: Atif Ali --- .../01-assert.yaml | 10 ++---- .../04-cleanup.yaml | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 tests/k8s/1-046_validate_application_tracking/04-cleanup.yaml diff --git a/tests/k8s/1-046_validate_application_tracking/01-assert.yaml b/tests/k8s/1-046_validate_application_tracking/01-assert.yaml index df3da48a9..e46a70aa6 100644 --- a/tests/k8s/1-046_validate_application_tracking/01-assert.yaml +++ b/tests/k8s/1-046_validate_application_tracking/01-assert.yaml @@ -40,20 +40,14 @@ data: installationID: "instance-2" resource.tracking.method: "annotation" --- -# Check first namespace labels +# Check first namespace apiVersion: v1 kind: Namespace metadata: name: source-ns-1 - labels: - argocd.argoproj.io/managed-by: test-1-046-argocd-1 - argocd.argoproj.io/tracking-id: instance-1 --- -# Check second namespace labels +# Check second namespace apiVersion: v1 kind: Namespace metadata: name: source-ns-2 - labels: - argocd.argoproj.io/managed-by: test-1-046-argocd-2 - argocd.argoproj.io/tracking-id: instance-2 diff --git a/tests/k8s/1-046_validate_application_tracking/04-cleanup.yaml b/tests/k8s/1-046_validate_application_tracking/04-cleanup.yaml new file mode 100644 index 000000000..24c31b9b7 --- /dev/null +++ b/tests/k8s/1-046_validate_application_tracking/04-cleanup.yaml @@ -0,0 +1,35 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +delete: +# Delete test namespaces +- apiVersion: v1 + kind: Namespace + name: test-1-046-argocd-1 +- apiVersion: v1 + kind: Namespace + name: test-1-046-argocd-2 +- apiVersion: v1 + kind: Namespace + name: source-ns-1 +- apiVersion: v1 + kind: Namespace + name: source-ns-2 +# Delete ArgoCD instances +- apiVersion: argoproj.io/v1beta1 + kind: ArgoCD + name: argocd-1 + namespace: test-1-046-argocd-1 +- apiVersion: argoproj.io/v1beta1 + kind: ArgoCD + name: argocd-2 + namespace: test-1-046-argocd-2 +# Delete Applications +- apiVersion: argoproj.io/v1alpha1 + kind: Application + name: test-app + namespace: test-1-046-argocd-1 +- apiVersion: argoproj.io/v1alpha1 + kind: Application + name: test-app + namespace: test-1-046-argocd-2 +timeout: 120 # Give enough time for cascade deletion