Browse Source

[Profiling] Add backwards-compatibility test (#99730)

With this commit we add a basic backwards-compatibility test that checks
whether indices and data streams can be properly upgraded to the latest
version.

Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.de>

---------
Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.de>
Daniel Mitterdorfer 2 years ago
parent
commit
98756e0818

+ 37 - 0
rest-api-spec/src/main/resources/rest-api-spec/api/profiling.status.json

@@ -0,0 +1,37 @@
+{
+  "profiling.status":{
+    "documentation":{
+      "url":"https://www.elastic.co/guide/en/observability/current/universal-profiling.html",
+      "description":"Returns basic information about the status of Universal Profiling."
+    },
+    "stability":"stable",
+    "visibility":"private",
+    "headers":{
+      "accept": ["application/json"]
+    },
+    "url":{
+      "paths":[
+        {
+          "path":"/_profiling/status",
+          "methods":[
+            "GET"
+          ]
+        }
+      ]
+    },
+    "params":{
+      "master_timeout":{
+        "type":"time",
+        "description":"Explicit operation timeout for connection to master node"
+      },
+      "timeout":{
+        "type":"time",
+        "description":"Explicit operation timeout"
+      },
+      "wait_for_resources_created":{
+        "type":"boolean",
+        "description":"Whether to return immediately or wait until resources have been created"
+      }
+    }
+  }
+}

+ 24 - 0
x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/150_profiling.yml

@@ -0,0 +1,24 @@
+---
+"Test Profiling Index Management creates indices":
+  - skip:
+      version: " - 8.10.99"
+      reason:  status check API has been introduced with 8.11.0
+
+  - do:
+      profiling.status:
+        wait_for_resources_created: false
+  - is_false: 'resource_management.enabled'
+  - is_false: 'resources.created'
+
+  - do:
+      cluster.put_settings:
+        body:
+          transient:
+            xpack.profiling.templates.enabled: "true"
+        flat_settings: true
+
+  - do:
+      profiling.status:
+        wait_for_resources_created: true
+  - is_true: 'resource_management.enabled'
+  - is_true: 'resources.created'

+ 18 - 0
x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/150_profiling.yml

@@ -0,0 +1,18 @@
+---
+"Test Profiling Index Management updates indices":
+  - skip:
+      version: " - 8.10.99"
+      reason:  status check API has been introduced with 8.11.0
+
+  - do:
+      cluster.put_settings:
+        body:
+          transient:
+            xpack.profiling.templates.enabled: "true"
+        flat_settings: true
+
+  - do:
+      profiling.status:
+        wait_for_resources_created: true
+  - is_true: 'resource_management.enabled'
+  - is_true: 'resources.created'