@@ -189,17 +189,13 @@ integTest {
189
189
systemProperty " password" , System . getProperty(" password" )
190
190
191
191
// Only tenant aware test if set
192
- if (System . getProperty(" tests.rest.tenantaware" ) != null ) {
192
+ if (System . getProperty(" tests.rest.tenantaware" ) == " true " ) {
193
193
filter {
194
194
includeTestsMatching " org.opensearch.ml.rest.*TenantAwareIT"
195
195
}
196
196
systemProperty " plugins.ml_commons.multi_tenancy_enabled" , " true"
197
197
}
198
198
199
- if (System . getProperty(" tests.rest.tenantaware" ) != null ) {
200
- environment " plugins.ml_commons.multi_tenancy_enabled" , " true"
201
- }
202
-
203
199
// Only rest case can run with remote cluster
204
200
if (System . getProperty(" tests.rest.cluster" ) != null && System . getProperty(" tests.rest.tenantaware" ) == null ) {
205
201
filter {
@@ -226,32 +222,28 @@ integTest {
226
222
227
223
// The 'doFirst' delays till execution time.
228
224
doFirst {
229
- if (System . getProperty(" tests.rest.tenantaware" ) != null ) {
225
+ if (System . getProperty(" tests.rest.tenantaware" ) == " true " ) {
230
226
def ymlFile = file(" $buildDir /testclusters/integTest-0/config/opensearch.yml" )
231
227
if (ymlFile. exists()) {
232
228
ymlFile. withWriterAppend {
233
229
writer ->
234
230
writer. write(" \n # Set multitenancy\n " )
235
231
writer. write(" plugins.ml_commons.multi_tenancy_enabled: true\n " )
236
232
}
237
- } else {
238
- throw new GradleException (" opensearch.yml not found at: $ymlFile " )
239
- }
240
- }
241
-
242
- // TODO this properly uses the remote client factory but needs a remote cluster set up
243
- if (System . getProperty(" tests.rest.cluster" ) != null && System . getProperty(" tests.rest.tenantaware" ) != null ) {
244
- def ymlFile = file(" $buildDir /testclusters/integTest-0/config/opensearch.yml" )
245
- if (ymlFile. exists()) {
246
- ymlFile. withWriterAppend { writer ->
247
- writer. write(" \n # Use a remote cluster\n " )
248
- writer. write(" plugins.ml_commons.remote_metadata_type: RemoteOpenSearch\n " )
249
- writer. write(" plugins.ml_commons.remote_metadata_endpoint: https://127.0.0.1:9200\n " )
233
+ // TODO this properly uses the remote client factory but needs a remote cluster set up
234
+ // TODO get the endpoint from a system property
235
+ if (System . getProperty(" tests.rest.cluster" ) != null ) {
236
+ ymlFile. withWriterAppend { writer ->
237
+ writer. write(" \n # Use a remote cluster\n " )
238
+ writer. write(" plugins.ml_commons.remote_metadata_type: RemoteOpenSearch\n " )
239
+ writer. write(" plugins.ml_commons.remote_metadata_endpoint: https://127.0.0.1:9200\n " )
240
+ }
250
241
}
251
242
} else {
252
243
throw new GradleException (" opensearch.yml not found at: $ymlFile " )
253
244
}
254
245
}
246
+
255
247
// Tell the test JVM if the cluster JVM is running under a debugger so that tests can
256
248
// use longer timeouts for requests.
257
249
def isDebuggingCluster = getDebug() || System . getProperty(" test.debug" ) != null
0 commit comments