From 10b734b7deb72f9ef83b4ee89462823e02f08a2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?=
 <charles.edouard@nirmata.com>
Date: Fri, 16 Feb 2024 22:14:04 +0100
Subject: [PATCH 1/2] fix: chainsaw bad conversion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
---
 .../opampbridge/chainsaw-test.yaml            |  9 ++++----
 tests/e2e-openshift/kafka/chainsaw-test.yaml  |  5 ++--
 .../monitoring/chainsaw-test.yaml             | 14 +++++------
 .../multi-cluster/chainsaw-test.yaml          |  5 ++--
 .../otlp-metrics-traces/chainsaw-test.yaml    | 17 ++++++--------
 .../chainsaw-test.yaml                        |  8 +++----
 .../chainsaw-test.yaml                        |  1 -
 .../chainsaw-test.yaml                        | 23 ++++++++++---------
 tests/e2e/smoke-daemonset/chainsaw-test.yaml  |  7 +++---
 .../smoke-targetallocator/chainsaw-test.yaml  |  8 +++----
 10 files changed, 45 insertions(+), 52 deletions(-)

diff --git a/tests/e2e-opampbridge/opampbridge/chainsaw-test.yaml b/tests/e2e-opampbridge/opampbridge/chainsaw-test.yaml
index 18649d9007..a428ab84db 100755
--- a/tests/e2e-opampbridge/opampbridge/chainsaw-test.yaml
+++ b/tests/e2e-opampbridge/opampbridge/chainsaw-test.yaml
@@ -6,12 +6,13 @@ metadata:
   name: opampbridge
 spec:
   steps:
-  - catch:
-    - podLogs:
-        selector: app.kubernetes.io/component=opentelemetry-opamp-bridge
-    name: step-00
+  - name: step-00
     try:
     - apply:
         file: 00-install.yaml
     - assert:
         file: 00-assert.yaml
+    catch:
+    - podLogs:
+        selector: app.kubernetes.io/component=opentelemetry-opamp-bridge
+    
\ No newline at end of file
diff --git a/tests/e2e-openshift/kafka/chainsaw-test.yaml b/tests/e2e-openshift/kafka/chainsaw-test.yaml
index 35da907129..71932c1823 100755
--- a/tests/e2e-openshift/kafka/chainsaw-test.yaml
+++ b/tests/e2e-openshift/kafka/chainsaw-test.yaml
@@ -36,8 +36,7 @@ spec:
         file: 04-generate-traces.yaml
     - assert:
         file: 04-assert.yaml
-  - catch:
+  - name: step-05
+    try:
     - script:
         content: ./tests/e2e-openshift/kafka/check_traces.sh
-    name: step-05
-    try: null
diff --git a/tests/e2e-openshift/monitoring/chainsaw-test.yaml b/tests/e2e-openshift/monitoring/chainsaw-test.yaml
index 3a8ffdd9fd..8c527ec871 100755
--- a/tests/e2e-openshift/monitoring/chainsaw-test.yaml
+++ b/tests/e2e-openshift/monitoring/chainsaw-test.yaml
@@ -6,13 +6,12 @@ metadata:
   name: monitoring
 spec:
   steps:
-  - catch:
-    - script:
-        content: ./tests/e2e-openshift/monitoring/check_user_workload_monitoring.sh
-    name: step-00
+  - name: step-00
     try:
     - apply:
         file: 00-workload-monitoring.yaml
+    - script:
+        content: ./tests/e2e-openshift/monitoring/check_user_workload_monitoring.sh
   - name: step-01
     try:
     - apply:
@@ -25,12 +24,11 @@ spec:
         file: 02-generate-traces.yaml
     - assert:
         file: 02-assert.yaml
-  - catch:
-    - script:
-        content: ./tests/e2e-openshift/monitoring/check_metrics.sh
-    name: step-03
+  - name: step-03
     try:
     - apply:
         file: 03-create-monitoring-roles.yaml
     - assert:
         file: 03-assert.yaml
+    - script:
+        content: ./tests/e2e-openshift/monitoring/check_metrics.sh
diff --git a/tests/e2e-openshift/multi-cluster/chainsaw-test.yaml b/tests/e2e-openshift/multi-cluster/chainsaw-test.yaml
index 4fe86735ad..67cc6fc848 100755
--- a/tests/e2e-openshift/multi-cluster/chainsaw-test.yaml
+++ b/tests/e2e-openshift/multi-cluster/chainsaw-test.yaml
@@ -40,8 +40,7 @@ spec:
         file: 04-generate-traces.yaml
     - assert:
         file: 04-assert.yaml
-  - catch:
+  - name: step-05
+    try:
     - script:
         content: ./tests/e2e-openshift/multi-cluster/check_traces.sh
-    name: step-05
-    try: null
diff --git a/tests/e2e-openshift/otlp-metrics-traces/chainsaw-test.yaml b/tests/e2e-openshift/otlp-metrics-traces/chainsaw-test.yaml
index 22ee039c00..0c67bc4c13 100755
--- a/tests/e2e-openshift/otlp-metrics-traces/chainsaw-test.yaml
+++ b/tests/e2e-openshift/otlp-metrics-traces/chainsaw-test.yaml
@@ -12,13 +12,12 @@ spec:
         file: 00-install-jaeger.yaml
     - assert:
         file: 00-assert.yaml
-  - catch:
-    - script:
-        content: ./tests/e2e-openshift/otlp-metrics-traces/check_user_workload_monitoring.sh
-    name: step-01
+  - name: step-01
     try:
     - apply:
         file: 01-workload-monitoring.yaml
+    - script:
+        content: ./tests/e2e-openshift/otlp-metrics-traces/check_user_workload_monitoring.sh
   - name: step-02
     try:
     - apply:
@@ -31,13 +30,11 @@ spec:
         file: 03-metrics-traces-gen.yaml
     - assert:
         file: 03-assert.yaml
-  - catch:
+  - name: step-04
+    try:
     - script:
         content: ./tests/e2e-openshift/otlp-metrics-traces/check_traces.sh
-    name: step-04
-    try: null
-  - catch:
+  - name: step-05
+    try:
     - script:
         content: ./tests/e2e-openshift/otlp-metrics-traces/check_metrics.sh
-    name: step-05
-    try: null
diff --git a/tests/e2e-targetallocator/targetallocator-features/chainsaw-test.yaml b/tests/e2e-targetallocator/targetallocator-features/chainsaw-test.yaml
index 448a767f97..555326724d 100755
--- a/tests/e2e-targetallocator/targetallocator-features/chainsaw-test.yaml
+++ b/tests/e2e-targetallocator/targetallocator-features/chainsaw-test.yaml
@@ -11,16 +11,16 @@ spec:
         openshift.io/sa.scc.uid-range: 1000/1000
         openshift.io/sa.scc.supplemental-groups: 3000/1000
   steps:
-  - catch:
-    - podLogs:
-        selector: app.kubernetes.io/component=opentelemetry-targetallocator
-    name: step-00
+  - name: step-00
     try:
     - apply:
         template: true
         file: 00-install.yaml
     - assert:
         file: 00-assert.yaml
+    catch:
+    - podLogs:
+        selector: app.kubernetes.io/component=opentelemetry-targetallocator
   - name: step-01
     try:
     - sleep:
diff --git a/tests/e2e-targetallocator/targetallocator-kubernetessd/chainsaw-test.yaml b/tests/e2e-targetallocator/targetallocator-kubernetessd/chainsaw-test.yaml
index 8c8881d89c..9790df366d 100755
--- a/tests/e2e-targetallocator/targetallocator-kubernetessd/chainsaw-test.yaml
+++ b/tests/e2e-targetallocator/targetallocator-kubernetessd/chainsaw-test.yaml
@@ -13,7 +13,6 @@ spec:
         file: 00-install.yaml
     - assert:
         file: 00-assert.yaml
-    catch:
     - script:
         content: ./tests/e2e/smoke-daemonset/check-daemonset.sh
     - podLogs:
diff --git a/tests/e2e/prometheus-config-validation/chainsaw-test.yaml b/tests/e2e/prometheus-config-validation/chainsaw-test.yaml
index dbe4717c47..3e5473d696 100755
--- a/tests/e2e/prometheus-config-validation/chainsaw-test.yaml
+++ b/tests/e2e/prometheus-config-validation/chainsaw-test.yaml
@@ -17,7 +17,13 @@ spec:
     try:
     - apply:
         file: 01-promreceiver-labeldrop.yaml
-  - catch:
+  - name: step-02
+    try:
+    - apply:
+        file: 02-promreceiver-allocatorconfig-extra.yaml
+    - assert:
+        file: 02-assert.yaml
+    catch:
     - podLogs:
         selector: app.kubernetes.io/component=opentelemetry-targetallocator
     - podLogs:
@@ -26,13 +32,13 @@ spec:
         container: manager
         namespace: opentelemetry-operator-system
         selector: app.kubernetes.io/name=opentelemetry-operator
-    name: step-02
+  - name: step-03
     try:
     - apply:
-        file: 02-promreceiver-allocatorconfig-extra.yaml
+        file: 03-promreceiver-nopromconfig.yaml
     - assert:
-        file: 02-assert.yaml
-  - catch:
+        file: 03-assert.yaml
+    catch:
     - podLogs:
         selector: app.kubernetes.io/component=opentelemetry-targetallocator
     - podLogs:
@@ -41,9 +47,4 @@ spec:
         container: manager
         namespace: opentelemetry-operator-system
         selector: app.kubernetes.io/name=opentelemetry-operator
-    name: step-03
-    try:
-    - apply:
-        file: 03-promreceiver-nopromconfig.yaml
-    - assert:
-        file: 03-assert.yaml
+    
\ No newline at end of file
diff --git a/tests/e2e/smoke-daemonset/chainsaw-test.yaml b/tests/e2e/smoke-daemonset/chainsaw-test.yaml
index 2a01a5fb5e..a2b75b13ed 100755
--- a/tests/e2e/smoke-daemonset/chainsaw-test.yaml
+++ b/tests/e2e/smoke-daemonset/chainsaw-test.yaml
@@ -6,12 +6,11 @@ metadata:
   name: smoke-daemonset
 spec:
   steps:
-  - catch:
-    - script:
-        content: ./tests/e2e/smoke-daemonset/check-daemonset.sh
-    name: step-00
+  - name: step-00
     try:
     - apply:
         file: 00-install.yaml
     - assert:
         file: 00-assert.yaml
+    - script:
+        content: ./tests/e2e/smoke-daemonset/check-daemonset.sh
diff --git a/tests/e2e/smoke-targetallocator/chainsaw-test.yaml b/tests/e2e/smoke-targetallocator/chainsaw-test.yaml
index d324b8e407..242d3ef257 100755
--- a/tests/e2e/smoke-targetallocator/chainsaw-test.yaml
+++ b/tests/e2e/smoke-targetallocator/chainsaw-test.yaml
@@ -6,16 +6,16 @@ metadata:
   name: smoke-targetallocator
 spec:
   steps:
-  - catch:
-    - podLogs:
-        selector: app.kubernetes.io/component=opentelemetry-targetallocator
-    name: step-00
+  - name: step-00
     try:
     - apply:
         template: true
         file: 00-install.yaml
     - assert:
         file: 00-assert.yaml
+    catch:
+    - podLogs:
+        selector: app.kubernetes.io/component=opentelemetry-targetallocator
   - name: step-01
     try:
     - apply:

From fef4400388903233bf0002e6f1579ea69b07ef7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?=
 <charles.edouard@nirmata.com>
Date: Fri, 16 Feb 2024 22:26:25 +0100
Subject: [PATCH 2/2] fix
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
---
 tests/e2e/smoke-daemonset/chainsaw-test.yaml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tests/e2e/smoke-daemonset/chainsaw-test.yaml b/tests/e2e/smoke-daemonset/chainsaw-test.yaml
index a2b75b13ed..fd1fc16417 100644
--- a/tests/e2e/smoke-daemonset/chainsaw-test.yaml
+++ b/tests/e2e/smoke-daemonset/chainsaw-test.yaml
@@ -12,5 +12,3 @@ spec:
         file: 00-install.yaml
     - assert:
         file: 00-assert.yaml
-    - script:
-        content: ./tests/e2e/smoke-daemonset/check-daemonset.sh