Skip to content

Commit 2a77551

Browse files
authored
Add allowed warnings to index template v2 YAML tests (#54535) (#54541)
There is a setting in `ESClientYamlSuiteTestCase` under `usually()` that can install a `global` template changing the number of shards for all indices. This can cause warnings when installing v2 templates (see #54367). This adds these as optional warnings so they don't cause failures regardless of whether the global template is installed or not. These warnings can be removed when our internal template usage has been moved to index templates v2 Relates to #53101
1 parent d6f9d7b commit 2a77551

File tree

2 files changed

+25
-10
lines changed
  • rest-api-spec/src/main/resources/rest-api-spec/test

2 files changed

+25
-10
lines changed

rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_index_template/10_basic.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
setup:
22
- skip:
3-
version: " - 7.99.99"
4-
reason: "index template v2 API has not been backported"
3+
version: " - 7.7.99"
4+
reason: "index template v2 API unavailable before 7.8"
5+
features: allowed_warnings
56

67
- do:
8+
allowed_warnings:
9+
- "index template [test] has index patterns [test-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [test] will take precedence during new index creation"
710
indices.put_index_template:
811
name: test
912
body:
@@ -35,10 +38,13 @@ setup:
3538
---
3639
"Get all tindex emplates":
3740
- skip:
38-
version: " - 7.99.99"
39-
reason: "index template v2 API has not been backported"
41+
version: " - 7.7.99"
42+
reason: "index template v2 API unavailable before 7.8"
43+
features: allowed_warnings
4044

4145
- do:
46+
allowed_warnings:
47+
- "index template [test2] has index patterns [test2-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [test2] will take precedence during new index creation"
4248
indices.put_index_template:
4349
name: test2
4450
body:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/10_basic.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
22
"Put index template":
33
- skip:
4-
version: " - 7.99.99"
5-
reason: "index template v2 API has not been backported"
4+
version: " - 7.7.99"
5+
reason: "index template v2 API unavailable before 7.8"
6+
features: allowed_warnings
67

78
- do:
9+
allowed_warnings:
10+
- "index template [test] has index patterns [test-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [test] will take precedence during new index creation"
811
indices.put_index_template:
912
name: test
1013
body:
@@ -30,10 +33,13 @@
3033
---
3134
"Put multiple index templates":
3235
- skip:
33-
version: " - 7.99.99"
34-
reason: "index template v2 API has not been backported"
36+
version: " - 7.7.99"
37+
reason: "index template v2 API unavailable before 7.8"
38+
features: allowed_warnings
3539

3640
- do:
41+
allowed_warnings:
42+
- "index template [test] has index patterns [test-*, test2-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [test] will take precedence during new index creation"
3743
indices.put_index_template:
3844
name: test
3945
body:
@@ -67,10 +73,13 @@
6773
---
6874
"Put index template with 'create' flag":
6975
- skip:
70-
version: " - 7.99.99"
71-
reason: "index template v2 API has not been backported"
76+
version: " - 7.7.99"
77+
reason: "index template v2 API unavailable before 7.8"
78+
features: allowed_warnings
7279

7380
- do:
81+
allowed_warnings:
82+
- "index template [test2] has index patterns [test-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [test2] will take precedence during new index creation"
7483
indices.put_index_template:
7584
name: test2
7685
body:

0 commit comments

Comments
 (0)