[DOCS] Remove testenv annotations from doc snippet tests (#80023)

Removes `testenv` annotations and related code. These annotations originally let you skip x-pack snippet tests in the docs. However, that's no longer possible.

Relates to #79309, #31619
This commit is contained in:
James Rodewig 2021-11-05 18:38:50 -04:00 committed by GitHub
parent a4ab7f9d03
commit f56a0f4b66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
336 changed files with 1 additions and 357 deletions

View file

@ -264,19 +264,6 @@ class RestTestsFromSnippetsTask extends SnippetsTask {
current.println(" - stash_in_path")
current.println(" - stash_path_replace")
current.println(" - warnings")
if (test.testEnv != null) {
switch (test.testEnv) {
case 'basic':
case 'gold':
case 'platinum':
case 'enterprise':
current.println(" - xpack")
break;
default:
throw new InvalidUserDataException('Unsupported testEnv: '
+ test.testEnv)
}
}
}
if (test.skip) {
if (test.continued) {

View file

@ -73,7 +73,6 @@ class SnippetsTask extends DefaultTask {
Snippet snippet = null
StringBuilder contents = null
List substitutions = null
String testEnv = null
Closure emit = {
snippet.contents = contents.toString()
contents = null
@ -140,14 +139,10 @@ class SnippetsTask extends DefaultTask {
}
file.eachLine('UTF-8') { String line, int lineNumber ->
Matcher matcher
matcher = line =~ /\[testenv="([^"]+)"\]\s*/
if (matcher.matches()) {
testEnv = matcher.group(1)
}
if (line ==~ /-{4,}\s*/) { // Four dashes looks like a snippet
if (snippet == null) {
Path path = docs.dir.toPath().relativize(file.toPath())
snippet = new Snippet(path: path, start: lineNumber, testEnv: testEnv, name: name)
snippet = new Snippet(path: path, start: lineNumber, name: name)
if (lastLanguageLine == lineNumber - 1) {
snippet.language = lastLanguage
}
@ -333,7 +328,6 @@ class SnippetsTask extends DefaultTask {
int start
int end = NOT_FINISHED
String contents
String testEnv
Boolean console = null
boolean test = false
@ -362,9 +356,6 @@ class SnippetsTask extends DefaultTask {
}
if (test) {
result += '// TEST'
if (testEnv != null) {
result += "[testenv=$testEnv]"
}
if (catchPart) {
result += "[catch: $catchPart]"
}

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-bucket-multi-terms-aggregation]]
=== Multi Terms aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-metrics-boxplot-aggregation]]
=== Boxplot aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="gold"]
[[search-aggregations-metrics-geo-line]]
=== Geo-Line Aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-metrics-rate-aggregation]]
=== Rate aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-metrics-string-stats-aggregation]]
=== String stats aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-metrics-ttest-aggregation]]
=== T-test aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-metrics-top-metrics]]
=== Top metrics aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-bucket-correlation-aggregation]]
=== Bucket correlation aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-bucket-count-ks-test-aggregation]]
=== Bucket count K-S test correlation aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-pipeline-cumulative-cardinality-aggregation]]
=== Cumulative cardinality aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-pipeline-inference-bucket-aggregation]]
=== {infer-cap} bucket aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-pipeline-moving-percentiles-aggregation]]
=== Moving percentiles aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[search-aggregations-pipeline-normalize-aggregation]]
=== Normalize aggregation
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[autoscaling-apis]]
== Autoscaling APIs

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[autoscaling-delete-autoscaling-policy]]
=== Delete autoscaling policy API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[autoscaling-get-autoscaling-capacity]]
=== Get autoscaling capacity API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[autoscaling-get-autoscaling-policy]]
=== Get autoscaling policy API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[autoscaling-put-autoscaling-policy]]
=== Create or update autoscaling policy API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[autoscaling-deciders]]
== Autoscaling deciders

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[autoscaling-fixed-decider]]
=== Fixed decider

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[autoscaling-machine-learning-decider]]
=== Machine learning decider

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[autoscaling-proactive-storage-decider]]
=== Proactive storage decider

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="enterprise"]
[[xpack-autoscaling]]
= Autoscaling

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[cat-anomaly-detectors]]
=== cat anomaly detectors API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[cat-datafeeds]]
=== cat {dfeeds} API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[cat-dfanalytics]]
=== cat {dfanalytics} API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[cat-trained-model]]
=== cat trained model API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-delete-auto-follow-pattern]]
=== Delete auto-follow pattern API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-get-auto-follow-pattern]]
=== Get auto-follow pattern API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-pause-auto-follow-pattern]]
=== Pause auto-follow pattern API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-put-auto-follow-pattern]]
=== Create auto-follow pattern API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-resume-auto-follow-pattern]]
=== Resume auto-follow pattern API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-apis]]
== {ccr-cap} APIs

View file

@ -1,4 +1,3 @@
[testenv="platinum"]
`settings`::
(object) Settings to override from the leader index. Note that certain
settings can not be overrode (e.g., `index.number_of_shards`).

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-get-follow-info]]
=== Get follower info API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-get-follow-stats]]
=== Get follower stats API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-post-forget-follower]]
=== Forget follower API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-post-pause-follow]]
=== Pause follower API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-post-resume-follow]]
=== Resume follower API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-post-unfollow]]
=== Unfollow API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-put-follow]]
=== Create follower API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-get-stats]]
=== Get {ccr} stats API
[subs="attributes"]

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-auto-follow]]
=== Manage auto-follow patterns
To replicate time series indices, you configure an auto-follow pattern so that

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-getting-started-tutorial]]
=== Tutorial: Set up {ccr}
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[xpack-ccr]]
== {ccr-cap}
With {ccr}, you can replicate indices across clusters to:

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-managing]]
=== Manage {ccr}

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[ccr-upgrading]]
=== Upgrading clusters using {ccr}
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[delete-async-eql-search-api]]
=== Delete async EQL search API

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[eql-ex-threat-detection]]
== Example: Detect threats with EQL

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[eql-search-api]]
=== EQL search API

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[eql]]
= EQL search
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[eql-function-ref]]
== EQL function reference
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[get-async-eql-search-api]]
=== Get async EQL search API

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[get-async-eql-status-api]]
=== Get async EQL status API

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[eql-pipe-ref]]
== EQL pipe reference
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[eql-syntax]]
== EQL syntax reference
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="platinum"]
[[graph-explore-api]]
== Graph explore API

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[security-backup]]
=== Back up a cluster's security configuration
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-delete-lifecycle]]
=== Delete lifecycle policy API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-explain-lifecycle]]
=== Explain lifecycle API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-get-lifecycle]]
=== Get lifecycle policy API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-get-status]]
=== Get {ilm} status API

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-migrate-to-data-tiers]]
=== Migrate to data tiers routing API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-move-to-step]]
=== Move to lifecycle step API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-put-lifecycle]]
=== Create or update lifecycle policy API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-remove-policy]]
=== Remove policy from index API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-retry-policy]]
=== Retry policy execution API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-start]]
=== Start {ilm} API

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-stop]]
=== Stop {ilm} API

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[index-lifecycle-error-handling]]
== Troubleshooting {ilm} errors

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-actions]]
== Index lifecycle actions

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[index-lifecycle-and-snapshots]]
== Restore a managed data stream or index

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-concepts]]
== {ilm-init} concepts

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-index-lifecycle]]
=== Index lifecycle
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[overview-index-lifecycle-management]]
== {ilm-init} overview

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[getting-started-index-lifecycle-management]]
== Tutorial: Automate rollover with {ilm-init}

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ilm-with-existing-indices]]
== Manage existing indices

View file

@ -1,5 +1,4 @@
[[index-rollover]]
[testenv="basic"]
=== Rollover
When indexing time series data like logs or metrics, you can't write to a single index indefinitely.

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[index-lifecycle-management]]
= {ilm-init}: Manage the index lifecycle

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[set-up-lifecycle-policy]]
== Configure a lifecycle policy [[ilm-policy-definition]]

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[start-stop-ilm]]
== Start and stop {ilm}

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[update-lifecycle-policy]]
=== Lifecycle policy updates
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[indices-reload-analyzers]]
== Reload search analyzers API

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[unfreeze-index-api]]
=== Unfreeze index API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[delete-enrich-policy-api]]
=== Delete enrich policy API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[enrich-stats-api]]
=== Enrich stats API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[execute-enrich-policy-api]]
=== Execute enrich policy API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[get-enrich-policy-api]]
=== Get enrich policy API
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[put-enrich-policy-api]]
=== Create enrich policy API
++++

View file

@ -1,4 +1,3 @@
[testenv="basic"]
[[ingest-enriching-data]]
== Enrich your data

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[geo-match-enrich-policy-type]]
=== Example: Enrich your data based on geolocation

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[match-enrich-policy-type]]
=== Example: Enrich your data based on exact values

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[ingest-circle-processor]]
=== Circle processor
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[community-id-processor]]
=== Community ID processor
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[enrich-processor]]
=== Enrich processor
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[fingerprint-processor]]
=== Fingerprint processor
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[inference-processor]]
=== {infer-cap} processor
++++

View file

@ -1,5 +1,4 @@
[role="xpack"]
[testenv="basic"]
[[network-direction-processor]]
=== Network direction processor
++++

Some files were not shown because too many files have changed in this diff Show more