-
Notifications
You must be signed in to change notification settings - Fork 25k
/
Copy pathbuild.gradle
209 lines (188 loc) · 11.5 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.VersionProperties
import org.elasticsearch.gradle.internal.info.BuildParams
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
import org.elasticsearch.gradle.util.GradleUtils
apply plugin: 'elasticsearch.internal-yaml-rest-test'
apply plugin: 'elasticsearch.yaml-rest-compat-test'
apply plugin: 'elasticsearch.validate-rest-spec'
apply plugin: 'elasticsearch.internal-test-artifact'
base {
archivesName = 'x-pack'
}
dependencies {
testImplementation project(xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation(testArtifact(project(":x-pack:plugin:security:qa:service-account"), "javaRestTest"))
testImplementation project(':test:yaml-rest-runner')
}
// let the yamlRestTests see the classpath of test
GradleUtils.extendSourceSet(project, "test", "yamlRestTest", tasks.named("yamlRestTest"))
int compatVersion = VersionProperties.getElasticsearchVersion().getMajor() - 1;
GradleUtils.extendSourceSet(project, "test", "yamlRestTestV${compatVersion}Compat")
restResources {
restApi {
include '*'
}
}
artifacts {
restXpackTests(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test"))
}
def restTestBlacklist = []
// TODO: fix this rest test to not depend on a hardcoded port!
restTestBlacklist.addAll(['getting_started/10_monitor_cluster_health/*'])
if (BuildParams.isSnapshotBuild() == false) {
// these tests attempt to install basic/internal licenses signed against the dev/public.key
// Since there is no infrastructure in place (anytime soon) to generate licenses using the production
// private key, these tests are blacklisted in non-snapshot test runs
restTestBlacklist.addAll(['xpack/15_basic/*', 'license/20_put_license/*', 'license/30_enterprise_license/*'])
// TODO: Remove the following when the following features are released. These tests include new privileges only available under feature flags
// which require snapshot builds:
// * Data Stream Lifecycle. manage_data_stream_lifecycle privilege is only available with dlm_feature_flag_enabled set
// We disable these tests for snapshot builds to maintain release build coverage.
restTestBlacklist.add('privileges/11_builtin/Test get builtin privileges')
}
tasks.withType(StandaloneRestIntegTestTask).configureEach {
usesDefaultDistribution()
}
tasks.named("yamlRestTest").configure {
systemProperty 'tests.rest.blacklist', restTestBlacklist.join(',')
}
tasks.named("yamlRestTestV7CompatTest").configure {
systemProperty 'tests.rest.blacklist', [
'unsigned_long/50_script_values/Scripted sort values',
'unsigned_long/50_script_values/script_score query',
'unsigned_long/50_script_values/Script query',
'aggregate-metrics/90_tsdb_mappings/aggregate_double_metric with time series mappings',
'aggregate-metrics/90_tsdb_mappings/aggregate_double_metric with wrong time series mappings',
'analytics/histogram/histogram with wrong time series mappings',
'analytics/histogram/histogram with time series mappings',
'analytics/boxplot/Basic Search',
'analytics/boxplot/Search With Runtime Field',
'analytics/boxplot/Search With Missing',
'analytics/moving_percentile/Basic Search TDigest',
'ml/evaluate_data_frame/Test outlier_detection auc_roc',
'ml/evaluate_data_frame/Test outlier_detection auc_roc given actual_field is int',
'ml/evaluate_data_frame/Test outlier_detection auc_roc include curve',
'ml/evaluate_data_frame/Test classification auc_roc',
'ml/evaluate_data_frame/Test classification auc_roc with default top_classes_field',
'security/authz/13_index_datemath/Test indexing documents with datemath, when forbidden',
'security/authz/13_index_datemath/Test indexing documents with datemath, when permitted',
'security/authz/13_index_datemath/Test bulk indexing with datemath when only some are allowed',
].join(',')
}
tasks.named("yamlRestTestV7CompatTransform").configure { task ->
task.skipTest(
"vectors/10_dense_vector_basic/Deprecated function signature",
"to support it, it would require to almost revert back the #48725 and complicate the code"
)
task.skipTest(
"vectors/20_dense_vector_special_cases/Indexing of Dense vectors should error when dims don't match defined in the mapping",
"Error message has changed"
)
task.skipTest("vectors/30_sparse_vector_basic/Cosine Similarity", "not supported for compatibility")
task.skipTest("vectors/30_sparse_vector_basic/Deprecated function signature", "not supported for compatibility")
task.skipTest("vectors/30_sparse_vector_basic/Dot Product", "not supported for compatibility")
task.skipTest("vectors/35_sparse_vector_l1l2/L1 norm", "not supported for compatibility")
task.skipTest("vectors/35_sparse_vector_l1l2/L2 norm", "not supported for compatibility")
task.skipTest("vectors/40_sparse_vector_special_cases/Dimensions can be sorted differently", "not supported for compatibility")
task.skipTest("vectors/40_sparse_vector_special_cases/Documents missing a vector field", "not supported for compatibility")
task.skipTest(
"vectors/40_sparse_vector_special_cases/Query vector has different dimensions from documents' vectors",
"not supported for compatibility"
)
task.skipTest("vectors/40_sparse_vector_special_cases/Sparse vectors should error with dense vector functions", "not supported for compatibility")
task.skipTest("vectors/40_sparse_vector_special_cases/Vectors of different dimensions and data types", "not supported for compatibility")
task.skipTest("vectors/50_vector_stats/Usage stats on vector fields", "not supported for compatibility")
task.skipTest(
"roles/30_prohibited_role_query/Test use prohibited query inside role query",
"put role request with a term lookup (deprecated) and type. Requires validation in REST layer"
)
task.skipTest("ml/jobs_crud/Test update job", "Behaviour change #89824 - added limit filter to categorization analyzer")
task.skipTest("ml/jobs_crud/Test create job with delimited format", "removing undocumented functionality")
task.skipTest("ml/jobs_crud/Test cannot create job with model snapshot id set", "Exception type has changed.")
task.skipTest("ml/validate/Test job config is invalid because model snapshot id set", "Exception type has changed.")
task.skipTest("ml/datafeeds_crud/Test update datafeed to point to missing job", "behaviour change #44752 - not allowing to update datafeed job_id")
task.skipTest(
"ml/datafeeds_crud/Test update datafeed to point to different job",
"behaviour change #44752 - not allowing to update datafeed job_id"
)
task.skipTest(
"ml/datafeeds_crud/Test update datafeed to point to job already attached to another datafeed",
"behaviour change #44752 - not allowing to update datafeed job_id"
)
task.skipTest(
"ml/trained_model_cat_apis/Test cat trained models",
"A type field was added to cat.ml_trained_models #73660, this is a backwards compatible change. Still this is a cat api, and we don't support them with rest api compatibility. (the test would be very hard to transform too)"
)
task.skipTest(
"ml/categorization_agg/Test categorization agg simple",
"categorize_text was changed in 8.3, but experimental prior to the change"
)
task.skipTest(
"ml/categorization_agg/Test categorization aggregation against unsupported field",
"categorize_text was changed in 8.3, but experimental prior to the change"
)
task.skipTest(
"ml/categorization_agg/Test categorization aggregation with poor settings",
"categorize_text was changed in 8.3, but experimental prior to the change"
)
task.skipTest("indices.freeze/30_usage/Usage stats on frozen indices", "#70192 -- the freeze index API is removed from 8.0")
task.skipTest("indices.freeze/20_stats/Translog stats on frozen indices", "#70192 -- the freeze index API is removed from 8.0")
task.skipTest("indices.freeze/10_basic/Basic", "#70192 -- the freeze index API is removed from 8.0")
task.skipTest("indices.freeze/10_basic/Test index options", "#70192 -- the freeze index API is removed from 8.0")
task.skipTest("sql/sql/Paging through results", "scrolling through search hit queries no longer produces empty last page in 8.2")
task.skipTest("sql/translate/Translate SQL", "query folding changed in v 8.5, added track_total_hits: -1")
task.skipTest("service_accounts/10_basic/Test get service accounts", "new service accounts are added")
task.skipTest("spatial/70_script_doc_values/diagonal length", "precision changed in 8.4.0")
task.skipTest("spatial/70_script_doc_values/geoshape value", "error message changed in 8.9.0")
task.skipTest("security/authz/14_cat_indices/Test empty request while single authorized index", "not supported for compatibility")
task.skipTestsByFilePattern("**/rollup/**", "The rollup yaml tests in the 7.x branch don't know how to fake a cluster with rollup usage")
task.skipTest("data_stream/10_basic/Create hidden data stream", "warning does not exist for compatibility")
task.replaceValueInMatch("_type", "_doc")
task.addAllowedWarningRegex("\\[types removal\\].*")
task.addAllowedWarningRegexForTest("Including \\[accept_enterprise\\] in get license.*", "Installing enterprise license")
task.addAllowedWarningRegex("bucket_span .* is not an integral .* of the number of seconds in 1d.* This is now deprecated.*")
task.replaceValueTextByKeyValue(
"catch",
'bad_request',
'/It is no longer possible to freeze indices, but existing frozen indices can still be unfrozen/',
"Cannot freeze write index for data stream"
)
task.replaceValueInMatch(
"error.reason",
"action [cluster:admin/xpack/security/api_key/invalidate] is unauthorized for user [api_key_user_1] with effective roles [user_role], this action is granted by the cluster privileges [manage_api_key,manage_security,all]",
"Test invalidate api key by realm name"
)
task.replaceValueInMatch(
"error.reason",
"action [cluster:admin/xpack/security/api_key/invalidate] is unauthorized for user [api_key_user_1] with effective roles [user_role], this action is granted by the cluster privileges [manage_api_key,manage_security,all]",
"Test invalidate api key by username"
)
}
tasks.register('enforceApiSpecsConvention').configure {
def mainApiSpecs = fileTree('src/test/resources/rest-api-spec/api')
doLast {
if (mainApiSpecs.files) {
throw new GradleException("There are REST specs in src/test source set. These should be moved to the :rest-api-spec project.")
}
}
}
tasks.register('enforceYamlTestConvention').configure {
def mainYamlFiles = fileTree('src/test/resources/rest-api-spec/test')
doLast {
if (mainYamlFiles.files) {
throw new GradleException("There are YAML tests in src/test source set. These should be moved to src/yamlRestTest.")
}
}
}
tasks.named("precommit").configure {
dependsOn 'enforceYamlTestConvention', 'enforceApiSpecsConvention'
}
tasks.named("yamlRestTestV7CompatTransform").configure({ task ->
task.skipTest("security/10_forbidden/Test bulk response with invalid credentials", "warning does not exist for compatibility")
task.skipTest("inference/inference_crud/Test get all", "Assertions on number of inference models break due to default configs")
task.skipTest("esql/60_usage/Basic ESQL usage output (telemetry)", "The telemetry output changed. We dropped a column. That's safe.")
task.skipTest("esql/80_text/reverse text", "The output type changed from TEXT to KEYWORD.")
task.skipTest("esql/80_text/values function", "The output type changed from TEXT to KEYWORD.")
})