From 2fa2093634f209da88876042b2a9daa6c37929c3 Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Sun, 7 Jan 2024 11:04:36 +0530 Subject: [PATCH 01/20] add collectors for metrics tests Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 7 +++++++ test/testmetrics/metrics/02-teststep-assert.yaml | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index c56170d909..e734e2cca2 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -13,3 +13,10 @@ spec: metadata: labels: component: podtato-head-entry +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: + - type: pod + selector: app=podtato-head + - command: kubectl logs -l app=podtato-head -n $NAMESPACE \ No newline at end of file diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index e6f95ad931..ae1ce56812 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -10,3 +10,7 @@ assert: # this checks that kubectl get resource succeeds - goodmetric3.yaml - goodmetric4.yaml - goodmetric5.yaml +collectors: + - type: pod + selector: app=test + - command: kubectl logs -l app=test -n $NAMESPACE \ No newline at end of file From a3c71f372324fbb61ac8f3af82771998d55f0495 Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Sun, 7 Jan 2024 15:59:44 +0530 Subject: [PATCH 02/20] yaml lint issue fix Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 3 ++- test/testmetrics/metrics/02-teststep-assert.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index e734e2cca2..073cb50dc5 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -19,4 +19,5 @@ kind: TestAssert collectors: - type: pod selector: app=podtato-head - - command: kubectl logs -l app=podtato-head -n $NAMESPACE \ No newline at end of file + - command: kubectl logs -l app=podtato-head -n $NAMESPACE + \ No newline at end of file diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index ae1ce56812..bafc7b064e 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -13,4 +13,5 @@ assert: # this checks that kubectl get resource succeeds collectors: - type: pod selector: app=test - - command: kubectl logs -l app=test -n $NAMESPACE \ No newline at end of file + - command: kubectl logs -l app=test -n $NAMESPACE + \ No newline at end of file From 67c71a446fb1e5b84678ad22c548b75529c730d4 Mon Sep 17 00:00:00 2001 From: Rizul Gupta <112455393+rizul2108@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:45:11 +0530 Subject: [PATCH 03/20] Update test/testmetrics/metrics/02-teststep-assert.yaml Co-authored-by: odubajDT <93584209+odubajDT@users.noreply.github.com> Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com> --- test/testmetrics/metrics/02-teststep-assert.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index bafc7b064e..ae1ce56812 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -13,5 +13,4 @@ assert: # this checks that kubectl get resource succeeds collectors: - type: pod selector: app=test - - command: kubectl logs -l app=test -n $NAMESPACE - \ No newline at end of file + - command: kubectl logs -l app=test -n $NAMESPACE \ No newline at end of file From f3786b96a827644d19930097079455f61631dea7 Mon Sep 17 00:00:00 2001 From: Rizul Gupta <112455393+rizul2108@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:45:21 +0530 Subject: [PATCH 04/20] Update test/testmetrics/metrics-hpa/01-assert.yaml Co-authored-by: odubajDT <93584209+odubajDT@users.noreply.github.com> Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com> --- test/testmetrics/metrics-hpa/01-assert.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index 073cb50dc5..e734e2cca2 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -19,5 +19,4 @@ kind: TestAssert collectors: - type: pod selector: app=podtato-head - - command: kubectl logs -l app=podtato-head -n $NAMESPACE - \ No newline at end of file + - command: kubectl logs -l app=podtato-head -n $NAMESPACE \ No newline at end of file From 78f338f592c135de3f7703ad07ddb61505ae0c5c Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:11:36 +0100 Subject: [PATCH 05/20] Update test/testmetrics/metrics-hpa/01-assert.yaml Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com> --- test/testmetrics/metrics-hpa/01-assert.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index e734e2cca2..4590aa9cc1 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -19,4 +19,4 @@ kind: TestAssert collectors: - type: pod selector: app=podtato-head - - command: kubectl logs -l app=podtato-head -n $NAMESPACE \ No newline at end of file + - command: kubectl logs -l app=podtato-head -n $NAMESPACE From 63e40d83d1c3ecd066fac805d257058128535cf0 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:11:43 +0100 Subject: [PATCH 06/20] Update test/testmetrics/metrics/02-teststep-assert.yaml Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com> --- test/testmetrics/metrics/02-teststep-assert.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index ae1ce56812..8d7428dd84 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -13,4 +13,4 @@ assert: # this checks that kubectl get resource succeeds collectors: - type: pod selector: app=test - - command: kubectl logs -l app=test -n $NAMESPACE \ No newline at end of file + - command: kubectl logs -l app=test -n $NAMESPACE From 0d0b8e2ff2d50ef3880eba4cf85b03ca2c3ddddc Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Thu, 11 Jan 2024 16:39:45 +0530 Subject: [PATCH 07/20] fixes left 2 issues Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 6 +++++- test/testmetrics/metrics/02-teststep-assert.yaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index 4590aa9cc1..3add97e911 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -19,4 +19,8 @@ kind: TestAssert collectors: - type: pod selector: app=podtato-head - - command: kubectl logs -l app=podtato-head -n $NAMESPACE + - command: | + kubectl logs -l app=metrics-operator -n $NAMESPACE + kubectl describe keptnmetric podtatometric -n $NAMESPACE + kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE + kubectl logs -l app=podtato-head -n $NAMESPACE diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index 8d7428dd84..35b0b3416b 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -13,4 +13,8 @@ assert: # this checks that kubectl get resource succeeds collectors: - type: pod selector: app=test - - command: kubectl logs -l app=test -n $NAMESPACE + - command: | + kubectl logs -l app=metrics-operator -n $NAMESPACE + kubectl describe keptnmetric podtatometric -n $NAMESPACE + kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE + kubectl logs -l app=test -n $NAMESPACE From ab5d5e043b38ec5d9d96f4838c87cce620f33a6f Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Fri, 12 Jan 2024 18:04:42 +0530 Subject: [PATCH 08/20] issue solve in metrics-operator cmd Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 2 +- test/testmetrics/metrics/02-teststep-assert.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index 3add97e911..f485655c23 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -20,7 +20,7 @@ collectors: - type: pod selector: app=podtato-head - command: | - kubectl logs -l app=metrics-operator -n $NAMESPACE + kubectl logs -l app=metrics-operator control-plane=lifecycle-operator kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE kubectl logs -l app=podtato-head -n $NAMESPACE diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index 35b0b3416b..b0f28616b6 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -14,7 +14,7 @@ collectors: - type: pod selector: app=test - command: | - kubectl logs -l app=metrics-operator -n $NAMESPACE + kubectl logs -l app=metrics-operator control-plane=lifecycle-operator kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE kubectl logs -l app=test -n $NAMESPACE From 558191b7e97c8343013e48aedfcf285e46b63c78 Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Sat, 13 Jan 2024 17:21:17 +0530 Subject: [PATCH 09/20] change one command Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 4 ++-- test/testmetrics/metrics/02-teststep-assert.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index f485655c23..1b4107acb9 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -20,7 +20,7 @@ collectors: - type: pod selector: app=podtato-head - command: | - kubectl logs -l app=metrics-operator control-plane=lifecycle-operator + kubectl logs -l control-plane=lifecycle-operator -n keptn-system kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE - kubectl logs -l app=podtato-head -n $NAMESPACE + kubectl describe pods -l app=podtato-head -n $NAMESPACE diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index b0f28616b6..d6120e1766 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -14,7 +14,7 @@ collectors: - type: pod selector: app=test - command: | - kubectl logs -l app=metrics-operator control-plane=lifecycle-operator + kubectl logs -l control-plane=lifecycle-operator -n keptn-system kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE - kubectl logs -l app=test -n $NAMESPACE + kubectl describe pods -l app=podtato-head -n $NAMESPACE From a9160704924ab2c3ef3db11cff970f2054249c65 Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Sun, 7 Jan 2024 11:04:36 +0530 Subject: [PATCH 10/20] add collectors for metrics tests Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 7 +++++++ test/testmetrics/metrics/02-teststep-assert.yaml | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index c56170d909..e734e2cca2 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -13,3 +13,10 @@ spec: metadata: labels: component: podtato-head-entry +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: + - type: pod + selector: app=podtato-head + - command: kubectl logs -l app=podtato-head -n $NAMESPACE \ No newline at end of file diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index e6f95ad931..ae1ce56812 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -10,3 +10,7 @@ assert: # this checks that kubectl get resource succeeds - goodmetric3.yaml - goodmetric4.yaml - goodmetric5.yaml +collectors: + - type: pod + selector: app=test + - command: kubectl logs -l app=test -n $NAMESPACE \ No newline at end of file From 69b7e29f9dae6874ea45190910da04f5351088f6 Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Sun, 7 Jan 2024 15:59:44 +0530 Subject: [PATCH 11/20] yaml lint issue fix Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 3 ++- test/testmetrics/metrics/02-teststep-assert.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index e734e2cca2..073cb50dc5 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -19,4 +19,5 @@ kind: TestAssert collectors: - type: pod selector: app=podtato-head - - command: kubectl logs -l app=podtato-head -n $NAMESPACE \ No newline at end of file + - command: kubectl logs -l app=podtato-head -n $NAMESPACE + \ No newline at end of file diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index ae1ce56812..bafc7b064e 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -13,4 +13,5 @@ assert: # this checks that kubectl get resource succeeds collectors: - type: pod selector: app=test - - command: kubectl logs -l app=test -n $NAMESPACE \ No newline at end of file + - command: kubectl logs -l app=test -n $NAMESPACE + \ No newline at end of file From 2ea3c8dd83d71ca242621ef74db06095ef727bcd Mon Sep 17 00:00:00 2001 From: Rizul Gupta <112455393+rizul2108@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:45:11 +0530 Subject: [PATCH 12/20] Update test/testmetrics/metrics/02-teststep-assert.yaml Co-authored-by: odubajDT <93584209+odubajDT@users.noreply.github.com> Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com> --- test/testmetrics/metrics/02-teststep-assert.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index bafc7b064e..ae1ce56812 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -13,5 +13,4 @@ assert: # this checks that kubectl get resource succeeds collectors: - type: pod selector: app=test - - command: kubectl logs -l app=test -n $NAMESPACE - \ No newline at end of file + - command: kubectl logs -l app=test -n $NAMESPACE \ No newline at end of file From a1f803bb034923fca889ec5459b7145033c02e5c Mon Sep 17 00:00:00 2001 From: Rizul Gupta <112455393+rizul2108@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:45:21 +0530 Subject: [PATCH 13/20] Update test/testmetrics/metrics-hpa/01-assert.yaml Co-authored-by: odubajDT <93584209+odubajDT@users.noreply.github.com> Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com> --- test/testmetrics/metrics-hpa/01-assert.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index 073cb50dc5..e734e2cca2 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -19,5 +19,4 @@ kind: TestAssert collectors: - type: pod selector: app=podtato-head - - command: kubectl logs -l app=podtato-head -n $NAMESPACE - \ No newline at end of file + - command: kubectl logs -l app=podtato-head -n $NAMESPACE \ No newline at end of file From 6ce1344ef0d17310190401f65454747bc69ac775 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:11:36 +0100 Subject: [PATCH 14/20] Update test/testmetrics/metrics-hpa/01-assert.yaml Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com> --- test/testmetrics/metrics-hpa/01-assert.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index e734e2cca2..4590aa9cc1 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -19,4 +19,4 @@ kind: TestAssert collectors: - type: pod selector: app=podtato-head - - command: kubectl logs -l app=podtato-head -n $NAMESPACE \ No newline at end of file + - command: kubectl logs -l app=podtato-head -n $NAMESPACE From 58f8ef359f94fe2a73fa87000f229f92b10968f7 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:11:43 +0100 Subject: [PATCH 15/20] Update test/testmetrics/metrics/02-teststep-assert.yaml Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com> --- test/testmetrics/metrics/02-teststep-assert.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index ae1ce56812..8d7428dd84 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -13,4 +13,4 @@ assert: # this checks that kubectl get resource succeeds collectors: - type: pod selector: app=test - - command: kubectl logs -l app=test -n $NAMESPACE \ No newline at end of file + - command: kubectl logs -l app=test -n $NAMESPACE From a5045be5bd3353b3a66c970b9477ae67a2716143 Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Thu, 11 Jan 2024 16:39:45 +0530 Subject: [PATCH 16/20] fixes left 2 issues Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 6 +++++- test/testmetrics/metrics/02-teststep-assert.yaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index 4590aa9cc1..3add97e911 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -19,4 +19,8 @@ kind: TestAssert collectors: - type: pod selector: app=podtato-head - - command: kubectl logs -l app=podtato-head -n $NAMESPACE + - command: | + kubectl logs -l app=metrics-operator -n $NAMESPACE + kubectl describe keptnmetric podtatometric -n $NAMESPACE + kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE + kubectl logs -l app=podtato-head -n $NAMESPACE diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index 8d7428dd84..35b0b3416b 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -13,4 +13,8 @@ assert: # this checks that kubectl get resource succeeds collectors: - type: pod selector: app=test - - command: kubectl logs -l app=test -n $NAMESPACE + - command: | + kubectl logs -l app=metrics-operator -n $NAMESPACE + kubectl describe keptnmetric podtatometric -n $NAMESPACE + kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE + kubectl logs -l app=test -n $NAMESPACE From 2a0b8d9d3be9c714c741e304e79104f159c068f3 Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Fri, 12 Jan 2024 18:04:42 +0530 Subject: [PATCH 17/20] issue solve in metrics-operator cmd Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 2 +- test/testmetrics/metrics/02-teststep-assert.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index 3add97e911..f485655c23 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -20,7 +20,7 @@ collectors: - type: pod selector: app=podtato-head - command: | - kubectl logs -l app=metrics-operator -n $NAMESPACE + kubectl logs -l app=metrics-operator control-plane=lifecycle-operator kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE kubectl logs -l app=podtato-head -n $NAMESPACE diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index 35b0b3416b..b0f28616b6 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -14,7 +14,7 @@ collectors: - type: pod selector: app=test - command: | - kubectl logs -l app=metrics-operator -n $NAMESPACE + kubectl logs -l app=metrics-operator control-plane=lifecycle-operator kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE kubectl logs -l app=test -n $NAMESPACE From d4e33563a3025c24713269dac9955bcfc659e4f4 Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Sat, 13 Jan 2024 17:21:17 +0530 Subject: [PATCH 18/20] change one command Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 4 ++-- test/testmetrics/metrics/02-teststep-assert.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index f485655c23..1b4107acb9 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -20,7 +20,7 @@ collectors: - type: pod selector: app=podtato-head - command: | - kubectl logs -l app=metrics-operator control-plane=lifecycle-operator + kubectl logs -l control-plane=lifecycle-operator -n keptn-system kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE - kubectl logs -l app=podtato-head -n $NAMESPACE + kubectl describe pods -l app=podtato-head -n $NAMESPACE diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index b0f28616b6..d6120e1766 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -14,7 +14,7 @@ collectors: - type: pod selector: app=test - command: | - kubectl logs -l app=metrics-operator control-plane=lifecycle-operator + kubectl logs -l control-plane=lifecycle-operator -n keptn-system kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE - kubectl logs -l app=test -n $NAMESPACE + kubectl describe pods -l app=podtato-head -n $NAMESPACE From 59c4b6f7f92851cf79164b481f39068c85aaa1f0 Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Wed, 17 Jan 2024 14:41:31 +0530 Subject: [PATCH 19/20] move deployment assert to seperate file Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 17 +---------------- test/testmetrics/metrics-hpa/deployment.yaml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 test/testmetrics/metrics-hpa/deployment.yaml diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index 1b4107acb9..5322e9cdae 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -1,19 +1,4 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: podtato-head-entry - labels: - app: podtato-head -spec: - selector: - matchLabels: - component: podtato-head-entry - replicas: 3 - template: - metadata: - labels: - component: podtato-head-entry ---- +assert: deployment.yaml apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: diff --git a/test/testmetrics/metrics-hpa/deployment.yaml b/test/testmetrics/metrics-hpa/deployment.yaml new file mode 100644 index 0000000000..c56170d909 --- /dev/null +++ b/test/testmetrics/metrics-hpa/deployment.yaml @@ -0,0 +1,15 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: podtato-head-entry + labels: + app: podtato-head +spec: + selector: + matchLabels: + component: podtato-head-entry + replicas: 3 + template: + metadata: + labels: + component: podtato-head-entry From 29e4230609afb170d49f362dd6f124412cad255a Mon Sep 17 00:00:00 2001 From: Rizul Gupta Date: Thu, 18 Jan 2024 00:11:38 +0530 Subject: [PATCH 20/20] change label of logs cmd Signed-off-by: Rizul Gupta --- test/testmetrics/metrics-hpa/01-assert.yaml | 2 +- test/testmetrics/metrics/02-teststep-assert.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testmetrics/metrics-hpa/01-assert.yaml b/test/testmetrics/metrics-hpa/01-assert.yaml index 5322e9cdae..d7695db62e 100644 --- a/test/testmetrics/metrics-hpa/01-assert.yaml +++ b/test/testmetrics/metrics-hpa/01-assert.yaml @@ -5,7 +5,7 @@ collectors: - type: pod selector: app=podtato-head - command: | - kubectl logs -l control-plane=lifecycle-operator -n keptn-system + kubectl logs -l app=metrics-operator -n keptn-system kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE kubectl describe pods -l app=podtato-head -n $NAMESPACE diff --git a/test/testmetrics/metrics/02-teststep-assert.yaml b/test/testmetrics/metrics/02-teststep-assert.yaml index d6120e1766..a7b57ee878 100644 --- a/test/testmetrics/metrics/02-teststep-assert.yaml +++ b/test/testmetrics/metrics/02-teststep-assert.yaml @@ -14,7 +14,7 @@ collectors: - type: pod selector: app=test - command: | - kubectl logs -l control-plane=lifecycle-operator -n keptn-system + kubectl logs -l app=metrics-operator -n keptn-system kubectl describe keptnmetric podtatometric -n $NAMESPACE kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE kubectl describe pods -l app=podtato-head -n $NAMESPACE