Skip to content

Commit

Permalink
Use historical features for Yaml REST tests for cat apis where applic…
Browse files Browse the repository at this point in the history
…able (#106323)
  • Loading branch information
mosche committed Mar 18, 2024
1 parent 7a7cbe4 commit 1c8bf79
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@
---
"Deprecated local parameter":
- skip:
version: "- 8.11.99"
features: ["warnings"]
- requires:
cluster_features: ["cat_aliases_local_deprecated"]
test_runner_features: ["warnings"]
reason: verifying deprecation warnings from 8.12.0 onwards

- do:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"Test cat aliases output with a hidden index with a hidden alias":
- skip:
version: "- 7.6.99"
- requires:
cluster_features: ["cat_aliases_hidden"]
reason: "hidden indices and aliases were added in 7.7.0"

- do:
Expand Down Expand Up @@ -57,8 +57,8 @@
$/
---
"Test cat aliases output with a hidden index with a visible alias":
- skip:
version: "- 7.6.99"
- requires:
cluster_features: ["cat_aliases_hidden"]
reason: "hidden indices and aliases were added in 7.7.0"

- do:
Expand Down Expand Up @@ -104,8 +104,8 @@
---
"Test cat aliases output with a visible index with a hidden alias":
- skip:
version: "- 7.6.99"
- requires:
cluster_features: ["cat_aliases_hidden"]
reason: "hidden indices and aliases were added in 7.7.0"

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@
---
"Node roles":

- skip:
version: " - 8.9.99"
- requires:
cluster_features: ["cat_allocation_node_role"]
reason: "node.role column added in 8.10.0"

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/^$/
---
"Test cat indices output":
- skip:
version: " - 8.10.99"
- requires:
cluster_features: ["cat_indices_dataset_size"]
reason: dataset size was added in 8.11.0

- do:
Expand Down Expand Up @@ -71,9 +71,10 @@
---
"Test cat indices output for closed index (pre 7.2.0)":
- skip:
version: "7.2.0 - "
reason: "closed indices are replicated starting version 7.2.0"
features: ["allowed_warnings"]
cluster_features: ["cat_indices_replicate_closed"]
- requires:
test_runner_features: ["allowed_warnings"]

- do:
indices.create:
Expand Down Expand Up @@ -115,9 +116,10 @@
---
"Test cat indices output for closed index":
- skip:
version: " - 7.1.99"
reason: "closed indices are replicated starting version 7.2.0"
features: ["allowed_warnings"]
cluster_features: ["cat_indices_replicate_closed"]
- requires:
test_runner_features: ["allowed_warnings"]

- do:
indices.create:
Expand Down Expand Up @@ -307,8 +309,8 @@
---
"Test cat indices with invalid health parameter":
- skip:
version: " - 7.7.1"
- requires:
cluster_features: ["cat_indices_validate_health_param"]
reason: "fixed in 7.7.1+"

- do:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"Test cat indices output for hidden index":
- skip:
version: "- 8.10.99"
- requires:
cluster_features: ["cat_indices_dataset_size"]
reason: "dataset size was added in 8.11.0"
- do:
indices.create:
Expand Down Expand Up @@ -41,8 +41,8 @@
---
"Test cat indices output for dot-hidden index and dot-prefixed pattern":
- skip:
version: "- 8.10.99"
- requires:
cluster_features: ["cat_indices_dataset_size"]
reason: "dataset size was added in 8.11.0"
- do:
indices.create:
Expand Down Expand Up @@ -80,8 +80,8 @@
---
"Test cat indices output with a hidden index with a visible alias":
- skip:
version: "- 8.10.99"
- requires:
cluster_features: ["cat_indices_dataset_size"]
reason: "dataset size was added in 8.11.0"

- do:
Expand Down Expand Up @@ -145,8 +145,8 @@
$/
---
"Test cat indices output with a hidden index with a hidden alias":
- skip:
version: "- 8.10.99"
- requires:
cluster_features: ["cat_indices_dataset_size"]
reason: "dataset size was added in 8.11.0"

- do:
Expand Down Expand Up @@ -209,8 +209,8 @@
$/
---
"Test cat indices output with a hidden index, dot-hidden alias and dot pattern":
- skip:
version: "- 8.10.99"
- requires:
cluster_features: ["cat_indices_dataset_size"]
reason: "dataset size was added in 8.11.0"

- do:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"Help":
- skip:
version: " - 7.11.99"
- requires:
cluster_features: ["cat_plugins_new_format"]
reason: output format changed in 7.12.0

- do:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"Test cat recovery output":
- skip:
version: " - 7.99.99"
- requires:
cluster_features: ["cat_recovery_new_bytes_format"]
reason: format of bytes output changed in 8.0.0

- do:
Expand Down Expand Up @@ -81,10 +81,10 @@
---
"Test cat recovery output for closed index":
- skip:
version: " - 7.99.99"
- requires:
cluster_features: ["cat_recovery_new_bytes_format"]
reason: format of bytes output changed in 8.0.0
features: ["allowed_warnings"]
test_runner_features: ["allowed_warnings"]

- do:
indices.create:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"Help":
- skip:
version: " - 8.10.99"
- requires:
cluster_features: ["cat_shards_dataset_size"]
reason: dataset size was added in 8.11.0
- do:
cat.shards:
Expand Down Expand Up @@ -90,8 +90,8 @@
$/
---
"Test cat shards output":
- skip:
version: " - 8.10.99"
- requires:
cluster_features: [ "cat_shards_dataset_size" ]
reason: dataset size was added in 8.11.0

- do:
Expand Down Expand Up @@ -187,8 +187,8 @@
---
"Test cat shards sort":
- skip:
version: " - 8.10.99"
- requires:
cluster_features: [ "cat_shards_dataset_size" ]
reason: dataset size was added in 8.11.0

- do:
Expand Down Expand Up @@ -240,8 +240,8 @@
---
"Test cat shards with hidden indices":
- skip:
version: " - 8.2.99"
- requires:
cluster_features: ["cat_shards_fix_hidden_indices"]
reason: hidden indices were misreported in versions before 8.3.0

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
---
"Test cat tasks output with X-Opaque-Id":
- skip:
version: " - 7.9.99"
- requires:
cluster_features: ["cat_tasks_x_opaque_id"]
reason: support for opaque_id was added in 7.10.0
features: headers
test_runner_features: ["headers"]

- do:
headers: { "X-Opaque-Id": "TestID" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"Help":
- skip:
version: " - 7.7.99"
- requires:
cluster_features: ["cat_templates_v2"]
reason: "format changed in 7.8 to accomodate V2 index templates"

- do:
Expand Down Expand Up @@ -31,8 +31,8 @@
---
"Normal templates":
- skip:
version: " - 7.7.99"
- requires:
cluster_features: [ "cat_templates_v2" ]
reason: "format changed in 7.8 to accomodate V2 index templates"

- do:
Expand Down Expand Up @@ -82,8 +82,8 @@
---
"Filtered templates":
- skip:
version: " - 7.7.99"
- requires:
cluster_features: [ "cat_templates_v2" ]
reason: "format changed in 7.8 to accomodate V2 index templates"

- do:
Expand Down Expand Up @@ -124,8 +124,8 @@
---
"Column headers":
- skip:
version: " - 7.7.99"
- requires:
cluster_features: [ "cat_templates_v2" ]
reason: "format changed in 7.8 to accomodate V2 index templates"

- do:
Expand Down Expand Up @@ -162,8 +162,8 @@
---
"Select columns":
- skip:
version: " - 7.7.99"
- requires:
cluster_features: [ "cat_templates_v2" ]
reason: "format changed in 7.8 to accomodate V2 index templates"

- do:
Expand Down Expand Up @@ -196,10 +196,10 @@
---
"Sort templates":
- skip:
version: " - 7.7.99"
- requires:
cluster_features: [ "cat_templates_v2" ]
reason: "format changed in 7.8 to accomodate V2 index templates"
features: default_shards, no_xpack
test_runner_features: default_shards, no_xpack

- do:
indices.put_template:
Expand Down Expand Up @@ -249,10 +249,10 @@
---
"Multiple template":
- skip:
version: " - 7.7.99"
- requires:
cluster_features: [ "cat_templates_v2" ]
reason: "format changed in 7.8 to accomodate V2 index templates"
features: default_shards, no_xpack
test_runner_features: default_shards, no_xpack

- do:
indices.put_template:
Expand Down Expand Up @@ -285,10 +285,10 @@
---
"Mixture of legacy and composable templates":
- skip:
version: " - 7.7.99"
- requires:
cluster_features: [ "cat_templates_v2" ]
reason: "format changed in 7.8 to accomodate V2 index templates"
features: allowed_warnings
test_runner_features: allowed_warnings

- do:
cluster.put_component_template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,51 @@
public class YamlTestLegacyFeatures implements FeatureSpecification {

private static final NodeFeature CAT_ALIASES_SHOW_WRITE_INDEX = new NodeFeature("cat_aliases_show_write_index");
private static final NodeFeature CAT_ALIASES_HIDDEN = new NodeFeature("cat_aliases_hidden");
private static final NodeFeature CAT_ALIASES_LOCAL_DEPRECATED = new NodeFeature("cat_aliases_local_deprecated");

private static final NodeFeature CAT_ALLOCATION_NODE_ROLE = new NodeFeature("cat_allocation_node_role");

private static final NodeFeature CAT_INDICES_DATASET_SIZE = new NodeFeature("cat_indices_dataset_size");
private static final NodeFeature CAT_INDICES_REPLICATE_CLOSED = new NodeFeature("cat_indices_replicate_closed");
private static final NodeFeature CAT_INDICES_VALIDATE_HEALTH_PARAM = new NodeFeature("cat_indices_validate_health_param");

private static final NodeFeature CAT_PLUGINS_NEW_FORMAT = new NodeFeature("cat_plugins_new_format");

private static final NodeFeature CAT_RECOVERY_NEW_BYTES_FORMAT = new NodeFeature("cat_recovery_new_bytes_format");

private static final NodeFeature CAT_SHARDS_DATASET_SIZE = new NodeFeature("cat_shards_dataset_size");
private static final NodeFeature CAT_SHARDS_FIX_HIDDEN_INDICES = new NodeFeature("cat_shards_fix_hidden_indices");

private static final NodeFeature CAT_TASKS_X_OPAQUE_ID = new NodeFeature("cat_tasks_x_opaque_id");

private static final NodeFeature CAT_TEMPLATES_V2 = new NodeFeature("cat_templates_v2");
private static final NodeFeature CAT_TEMPLATE_NAME_VALIDATION = new NodeFeature("cat_template_name_validation");

@Override
public Map<NodeFeature, Version> getHistoricalFeatures() {
return Map.ofEntries(Map.entry(CAT_ALIASES_SHOW_WRITE_INDEX, Version.V_7_4_0));
return Map.ofEntries(
Map.entry(CAT_ALIASES_SHOW_WRITE_INDEX, Version.V_7_4_0),
Map.entry(CAT_ALIASES_HIDDEN, Version.V_7_7_0),
Map.entry(CAT_ALIASES_LOCAL_DEPRECATED, Version.V_8_12_0),

Map.entry(CAT_ALLOCATION_NODE_ROLE, Version.V_8_10_0),

Map.entry(CAT_INDICES_REPLICATE_CLOSED, Version.V_7_2_0),
Map.entry(CAT_INDICES_VALIDATE_HEALTH_PARAM, Version.V_7_8_0),
Map.entry(CAT_INDICES_DATASET_SIZE, Version.V_8_11_0),

Map.entry(CAT_PLUGINS_NEW_FORMAT, Version.V_7_12_0),

Map.entry(CAT_RECOVERY_NEW_BYTES_FORMAT, Version.V_8_0_0),

Map.entry(CAT_SHARDS_FIX_HIDDEN_INDICES, Version.V_8_3_0),
Map.entry(CAT_SHARDS_DATASET_SIZE, Version.V_8_11_0),

Map.entry(CAT_TASKS_X_OPAQUE_ID, Version.V_7_10_0),

Map.entry(CAT_TEMPLATES_V2, Version.V_7_8_0),
Map.entry(CAT_TEMPLATE_NAME_VALIDATION, Version.V_7_16_0)
);
}
}

0 comments on commit 1c8bf79

Please sign in to comment.