File tree Expand file tree Collapse file tree 6 files changed +30
-19
lines changed
inference/qa/inference-service-tests
src/javaRestTest/java/org/elasticsearch/xpack/inference
src/test/java/org/elasticsearch/xpack/test/rest Expand file tree Collapse file tree 6 files changed +30
-19
lines changed Original file line number Diff line number Diff line change 8686 issue : https://github.com/elastic/elasticsearch/issues/120339
8787- class : org.elasticsearch.xpack.sql.expression.function.scalar.datetime.DateTimeToCharProcessorTests
8888 issue : https://github.com/elastic/elasticsearch/issues/120575
89- - class : org.elasticsearch.xpack.test.rest.XPackRestIT
90- method : test {p0=ml/3rd_party_deployment/Test start deployment fails while model download in progress}
91- issue : https://github.com/elastic/elasticsearch/issues/120810
9289- class : org.elasticsearch.xpack.security.authc.service.ServiceAccountIT
9390 method : testAuthenticateShouldNotFallThroughInCaseOfFailure
9491 issue : https://github.com/elastic/elasticsearch/issues/120902
@@ -113,12 +110,6 @@ tests:
113110- class : org.elasticsearch.indices.recovery.IndexRecoveryIT
114111 method : testSourceThrottling
115112 issue : https://github.com/elastic/elasticsearch/issues/123680
116- - class : org.elasticsearch.smoketest.MlWithSecurityIT
117- method : test {yaml=ml/3rd_party_deployment/Test start deployment fails while model download in progress}
118- issue : https://github.com/elastic/elasticsearch/issues/120814
119- - class : org.elasticsearch.smoketest.MlWithSecurityIT
120- method : test {yaml=ml/3rd_party_deployment/Test start and stop multiple deployments}
121- issue : https://github.com/elastic/elasticsearch/issues/124315
122113- class : org.elasticsearch.xpack.restart.MLModelDeploymentFullClusterRestartIT
123114 method : testDeploymentSurvivesRestart {cluster=OLD}
124115 issue : https://github.com/elastic/elasticsearch/issues/124160
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ dependencies {
2121 testImplementation project(xpackModule(' core' ))
2222 testImplementation(testArtifact(project(xpackModule(' core' ))))
2323 testImplementation(testArtifact(project(" :x-pack:plugin:security:qa:service-account" ), " javaRestTest" ))
24+ testImplementation(testArtifact(project(' :x-pack:plugin:inference:qa:inference-service-tests' ), " javaRestTest" ))
2425 testImplementation project(' :test:yaml-rest-runner' )
2526}
2627
Original file line number Diff line number Diff line change 11apply plugin : ' elasticsearch.internal-java-rest-test'
2+ apply plugin : ' elasticsearch.internal-test-artifact'
23
34dependencies {
45 javaRestTestImplementation project(path : xpackModule(' core' ))
Original file line number Diff line number Diff line change @@ -60,15 +60,7 @@ public class InferenceBaseRestTest extends ESRestTestCase {
6060
6161 @ Before
6262 public void setMlModelRepository () throws IOException {
63- logger .info ("setting ML model repository to: {}" , mlModelServer .getUrl ());
64- var request = new Request ("PUT" , "/_cluster/settings" );
65- request .setJsonEntity (Strings .format ("""
66- {
67- "persistent": {
68- "xpack.ml.model_repository": "%s"
69- }
70- }""" , mlModelServer .getUrl ()));
71- assertOK (client ().performRequest (request ));
63+ assertOK (mlModelServer .setMlModelRepository (adminClient ()));
7264 }
7365
7466 @ Override
Original file line number Diff line number Diff line change 1313import org .apache .http .HttpHeaders ;
1414import org .apache .http .HttpStatus ;
1515import org .apache .http .client .utils .URIBuilder ;
16+ import org .elasticsearch .client .Request ;
17+ import org .elasticsearch .client .Response ;
18+ import org .elasticsearch .client .RestClient ;
19+ import org .elasticsearch .common .Strings ;
1620import org .elasticsearch .logging .LogManager ;
1721import org .elasticsearch .logging .Logger ;
1822import org .elasticsearch .test .fixture .HttpHeaderParser ;
@@ -48,7 +52,19 @@ public class MlModelServer implements TestRule {
4852
4953 private int port ;
5054
51- public String getUrl () {
55+ public Response setMlModelRepository (RestClient restClient ) throws IOException {
56+ logger .info ("setting ML model repository to: {}" , getUrl ());
57+ var request = new Request ("PUT" , "/_cluster/settings" );
58+ request .setJsonEntity (Strings .format ("""
59+ {
60+ "persistent": {
61+ "xpack.ml.model_repository": "%s"
62+ }
63+ }""" , getUrl ()));
64+ return restClient .performRequest (request );
65+ }
66+
67+ private String getUrl () {
5268 return new URIBuilder ().setScheme ("http" ).setHost (HOST ).setPort (port ).toString ();
5369 }
5470
Original file line number Diff line number Diff line change 2525import org .elasticsearch .xpack .core .ml .job .persistence .AnomalyDetectorsIndexFields ;
2626import org .elasticsearch .xpack .core .ml .notifications .NotificationsIndex ;
2727import org .elasticsearch .xpack .core .rollup .job .RollupJob ;
28+ import org .elasticsearch .xpack .inference .MlModelServer ;
2829import org .junit .After ;
2930import org .junit .Before ;
31+ import org .junit .ClassRule ;
3032
3133import java .io .IOException ;
3234import java .util .Arrays ;
@@ -50,6 +52,14 @@ public abstract class AbstractXPackRestTest extends ESClientYamlSuiteTestCase {
5052 SecuritySettingsSourceField .TEST_PASSWORD_SECURE_STRING
5153 );
5254
55+ @ ClassRule
56+ public static MlModelServer mlModelServer = new MlModelServer ();
57+
58+ @ Before
59+ public void setMlModelRepository () throws IOException {
60+ assertOK (mlModelServer .setMlModelRepository (adminClient ()));
61+ }
62+
5363 public AbstractXPackRestTest (ClientYamlTestCandidate testCandidate ) {
5464 super (testCandidate );
5565 }
You can’t perform that action at this time.
0 commit comments