Skip to content

Commit 1d099c3

Browse files
authored
[DOCS] Remove testenv annotations from doc snippet tests (#80023) (#80459)
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 # Conflicts: # docs/reference/ingest/range-enrich-policy-type-ex.asciidoc # docs/reference/migration/apis/feature_upgrade.asciidoc # docs/reference/ml/df-analytics/apis/get-trained-model-deployment-stats.asciidoc # docs/reference/ml/df-analytics/apis/infer-trained-model-deployment.asciidoc # docs/reference/ml/df-analytics/apis/put-trained-model-definition-part.asciidoc # docs/reference/ml/df-analytics/apis/put-trained-model-vocabulary.asciidoc # docs/reference/ml/df-analytics/apis/start-trained-model-deployment.asciidoc # docs/reference/ml/df-analytics/apis/stop-trained-model-deployment.asciidoc # docs/reference/slm/apis/slm-delete.asciidoc # docs/reference/slm/apis/slm-execute-retention.asciidoc # docs/reference/slm/apis/slm-execute.asciidoc # docs/reference/slm/apis/slm-get-status.asciidoc # docs/reference/slm/apis/slm-get.asciidoc # docs/reference/slm/apis/slm-start.asciidoc # docs/reference/slm/apis/slm-stats.asciidoc # docs/reference/slm/apis/slm-stop.asciidoc # docs/reference/sql/endpoints/client-apps/tableau-desktop.asciidoc # docs/reference/sql/endpoints/client-apps/tableau-server.asciidoc # docs/reference/transform/apis/upgrade-transforms.asciidoc
1 parent 4a1851c commit 1d099c3

File tree

324 files changed

+1
-345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+1
-345
lines changed

build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/RestTestsFromSnippetsTask.groovy

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,6 @@ class RestTestsFromSnippetsTask extends SnippetsTask {
258258
current.println(" - stash_in_path")
259259
current.println(" - stash_path_replace")
260260
current.println(" - warnings")
261-
if (test.testEnv != null) {
262-
switch (test.testEnv) {
263-
case 'basic':
264-
case 'gold':
265-
case 'platinum':
266-
case 'enterprise':
267-
current.println(" - xpack")
268-
break;
269-
default:
270-
throw new InvalidUserDataException('Unsupported testEnv: '
271-
+ test.testEnv)
272-
}
273-
}
274261
}
275262
if (test.skip) {
276263
if (test.continued) {

build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/SnippetsTask.groovy

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class SnippetsTask extends DefaultTask {
7272
Snippet snippet = null
7373
StringBuilder contents = null
7474
List substitutions = null
75-
String testEnv = null
7675
Closure emit = {
7776
snippet.contents = contents.toString()
7877
contents = null
@@ -134,14 +133,10 @@ class SnippetsTask extends DefaultTask {
134133
}
135134
file.eachLine('UTF-8') { String line, int lineNumber ->
136135
Matcher matcher
137-
matcher = line =~ /\[testenv="([^"]+)"\]\s*/
138-
if (matcher.matches()) {
139-
testEnv = matcher.group(1)
140-
}
141136
if (line ==~ /-{4,}\s*/) { // Four dashes looks like a snippet
142137
if (snippet == null) {
143138
Path path = docs.dir.toPath().relativize(file.toPath())
144-
snippet = new Snippet(path: path, start: lineNumber, testEnv: testEnv, name: name)
139+
snippet = new Snippet(path: path, start: lineNumber, name: name)
145140
if (lastLanguageLine == lineNumber - 1) {
146141
snippet.language = lastLanguage
147142
}
@@ -327,7 +322,6 @@ class SnippetsTask extends DefaultTask {
327322
int start
328323
int end = NOT_FINISHED
329324
String contents
330-
String testEnv
331325

332326
Boolean console = null
333327
boolean test = false
@@ -356,9 +350,6 @@ class SnippetsTask extends DefaultTask {
356350
}
357351
if (test) {
358352
result += '// TEST'
359-
if (testEnv != null) {
360-
result += "[testenv=$testEnv]"
361-
}
362353
if (catchPart) {
363354
result += "[catch: $catchPart]"
364355
}

docs/reference/aggregations/bucket/multi-terms-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/metrics/boxplot-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/metrics/geoline-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/metrics/rate-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/metrics/string-stats-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/metrics/t-test-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/metrics/top-metrics-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/pipeline/bucket-correlation-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/pipeline/bucket-count-ks-test-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/pipeline/cumulative-cardinality-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/pipeline/inference-bucket-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/pipeline/moving-percentiles-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/aggregations/pipeline/normalize-aggregation.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/apis/autoscaling-apis.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/apis/delete-autoscaling-policy.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/apis/get-autoscaling-capacity.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/apis/get-autoscaling-policy.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/apis/put-autoscaling-policy.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/autoscaling-deciders.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/deciders/fixed-decider.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/deciders/machine-learning-decider.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/deciders/proactive-storage-decider.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/autoscaling/index.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/cat/anomaly-detectors.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/cat/datafeeds.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/cat/dataframeanalytics.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/cat/trainedmodel.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/auto-follow/delete-auto-follow-pattern.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/auto-follow/get-auto-follow-pattern.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/auto-follow/pause-auto-follow-pattern.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/auto-follow/put-auto-follow-pattern.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/auto-follow/resume-auto-follow-pattern.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/ccr-apis.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/follow-request-body.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/follow/get-follow-info.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/follow/get-follow-stats.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/follow/post-forget-follower.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/follow/post-pause-follow.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/follow/post-resume-follow.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/follow/post-unfollow.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/follow/put-follow.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/apis/get-ccr-stats.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/auto-follow.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/getting-started.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/index.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/managing.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/ccr/upgrading.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/commands/migrate-tool.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/eql/delete-async-eql-search-api.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/eql/detect-threats-with-eql.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/eql/eql-search-api.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/eql/eql.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/eql/functions.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/eql/get-async-eql-search-api.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/eql/get-async-eql-status-api.asciidoc

Lines changed: 0 additions & 1 deletion

docs/reference/eql/pipes.asciidoc

Lines changed: 0 additions & 1 deletion

0 commit comments

Comments
 (0)