浏览代码

Split get data stream api yaml test in two tests. (#81590)

Split yaml test that verifies allow_custom_routing and replicated fields are included in get data stream api.
This is because `allow_custom_routing` field is only included from 8.0 and
`replicated` field is only included from 7.16. Each test has its own skip version section.
The current test was reused in bwc qa tests, which caused test failures.

Closes #81462
Martijn van Groningen 3 年之前
父节点
当前提交
616b417fb0
共有 1 个文件被更改,包括 48 次插入3 次删除
  1. 48 3
      x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml

+ 48 - 3
x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml

@@ -622,10 +622,10 @@ setup:
         index: logs-foobar
 
 ---
-"Get data stream api check existence of replicated and allow_custom_routing fields":
+"Get data stream api check existence of replicated field":
   - skip:
       version: " - 7.16.0"
-      reason: "replicated and allow_custom_routing fields only supported in 7.16+"
+      reason: "replicated field only supported in 7.16+"
 
   - do:
       indices.create_data_stream:
@@ -649,7 +649,6 @@ setup:
   - match: { data_streams.0.template: 'my-template1' }
   - match: { data_streams.0.hidden: false }
   - match: { data_streams.0.replicated: false }
-  - match: { data_streams.0.allow_custom_routing: false }
   - match: { data_streams.1.name: simple-data-stream2 }
   - match: { data_streams.1.timestamp_field.name: '@timestamp' }
   - match: { data_streams.1.generation: 1 }
@@ -658,6 +657,52 @@ setup:
   - match: { data_streams.1.template: 'my-template2' }
   - match: { data_streams.1.hidden: false }
   - match: { data_streams.1.replicated: false }
+
+  - do:
+      indices.delete_data_stream:
+        name: simple-data-stream1
+  - is_true: acknowledged
+
+  - do:
+      indices.delete_data_stream:
+        name: simple-data-stream2
+  - is_true: acknowledged
+
+---
+"Get data stream api check existence of allow_custom_routing field":
+  - skip:
+      version: " - 8.0.0"
+      reason: "allow_custom_routing field only supported in 8.0+"
+
+  - do:
+      indices.create_data_stream:
+        name: simple-data-stream1
+  - is_true: acknowledged
+
+  - do:
+      indices.create_data_stream:
+        name: simple-data-stream2
+  - is_true: acknowledged
+
+  - do:
+      indices.get_data_stream:
+        name: "*"
+  - match: { data_streams.0.name: simple-data-stream1 }
+  - match: { data_streams.0.timestamp_field.name: '@timestamp' }
+  - match: { data_streams.0.generation: 1 }
+  - length: { data_streams.0.indices: 1 }
+  - match: { data_streams.0.indices.0.index_name: '/\.ds-simple-data-stream1-(\d{4}\.\d{2}\.\d{2}-)?000001/' }
+  - match: { data_streams.0.status: 'GREEN' }
+  - match: { data_streams.0.template: 'my-template1' }
+  - match: { data_streams.0.hidden: false }
+  - match: { data_streams.0.allow_custom_routing: false }
+  - match: { data_streams.1.name: simple-data-stream2 }
+  - match: { data_streams.1.timestamp_field.name: '@timestamp' }
+  - match: { data_streams.1.generation: 1 }
+  - length: { data_streams.1.indices: 1 }
+  - match: { data_streams.1.indices.0.index_name: '/\.ds-simple-data-stream2-(\d{4}\.\d{2}\.\d{2}-)?000001/' }
+  - match: { data_streams.1.template: 'my-template2' }
+  - match: { data_streams.1.hidden: false }
   - match: { data_streams.1.allow_custom_routing: false }
 
   - do: