Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ tests:
issue: https://github.com/elastic/elasticsearch/issues/120339
- class: org.elasticsearch.xpack.sql.expression.function.scalar.datetime.DateTimeToCharProcessorTests
issue: https://github.com/elastic/elasticsearch/issues/120575
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
method: test {p0=ml/3rd_party_deployment/Test start deployment fails while model download in progress}
issue: https://github.com/elastic/elasticsearch/issues/120810
- class: org.elasticsearch.xpack.security.authc.service.ServiceAccountIT
method: testAuthenticateShouldNotFallThroughInCaseOfFailure
issue: https://github.com/elastic/elasticsearch/issues/120902
Expand All @@ -113,12 +110,6 @@ tests:
- class: org.elasticsearch.indices.recovery.IndexRecoveryIT
method: testSourceThrottling
issue: https://github.com/elastic/elasticsearch/issues/123680
- class: org.elasticsearch.smoketest.MlWithSecurityIT
method: test {yaml=ml/3rd_party_deployment/Test start deployment fails while model download in progress}
issue: https://github.com/elastic/elasticsearch/issues/120814
- class: org.elasticsearch.smoketest.MlWithSecurityIT
method: test {yaml=ml/3rd_party_deployment/Test start and stop multiple deployments}
issue: https://github.com/elastic/elasticsearch/issues/124315
- class: org.elasticsearch.xpack.restart.MLModelDeploymentFullClusterRestartIT
method: testDeploymentSurvivesRestart {cluster=OLD}
issue: https://github.com/elastic/elasticsearch/issues/124160
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies {
testImplementation project(xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation(testArtifact(project(":x-pack:plugin:security:qa:service-account"), "javaRestTest"))
testImplementation(testArtifact(project(':x-pack:plugin:inference:qa:inference-service-tests'), "javaRestTest"))
testImplementation project(':test:yaml-rest-runner')
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'elasticsearch.internal-java-rest-test'
apply plugin: 'elasticsearch.internal-test-artifact'

dependencies {
javaRestTestImplementation project(path: xpackModule('core'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,7 @@ public class InferenceBaseRestTest extends ESRestTestCase {

@Before
public void setMlModelRepository() throws IOException {
logger.info("setting ML model repository to: {}", mlModelServer.getUrl());
var request = new Request("PUT", "/_cluster/settings");
request.setJsonEntity(Strings.format("""
{
"persistent": {
"xpack.ml.model_repository": "%s"
}
}""", mlModelServer.getUrl()));
assertOK(client().performRequest(request));
assertOK(mlModelServer.setMlModelRepository(adminClient()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
import org.apache.http.HttpHeaders;
import org.apache.http.HttpStatus;
import org.apache.http.client.utils.URIBuilder;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.logging.LogManager;
import org.elasticsearch.logging.Logger;
import org.elasticsearch.test.fixture.HttpHeaderParser;
Expand Down Expand Up @@ -48,7 +52,19 @@ public class MlModelServer implements TestRule {

private int port;

public String getUrl() {
public Response setMlModelRepository(RestClient restClient) throws IOException {
logger.info("setting ML model repository to: {}", getUrl());
var request = new Request("PUT", "/_cluster/settings");
request.setJsonEntity(Strings.format("""
{
"persistent": {
"xpack.ml.model_repository": "%s"
}
}""", getUrl()));
return restClient.performRequest(request);
}

private String getUrl() {
return new URIBuilder().setScheme("http").setHost(HOST).setPort(port).toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields;
import org.elasticsearch.xpack.core.ml.notifications.NotificationsIndex;
import org.elasticsearch.xpack.core.rollup.job.RollupJob;
import org.elasticsearch.xpack.inference.MlModelServer;
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;

import java.io.IOException;
import java.util.Arrays;
Expand All @@ -50,6 +52,14 @@ public abstract class AbstractXPackRestTest extends ESClientYamlSuiteTestCase {
SecuritySettingsSourceField.TEST_PASSWORD_SECURE_STRING
);

@ClassRule
public static MlModelServer mlModelServer = new MlModelServer();

@Before
public void setMlModelRepository() throws IOException {
assertOK(mlModelServer.setMlModelRepository(adminClient()));
}

public AbstractXPackRestTest(ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}
Expand Down