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
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:third-party:slack");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:async-search:qa:rest");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:autoscaling:qa:rest");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ccr:qa:downgrade-to-basic-license");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ccr:qa:multi-cluster");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ccr:qa:non-compliant-license");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ccr:qa:rest");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ccr:qa:restart");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ccr:qa:security");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:deprecation:qa:early-deprecation-rest");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:deprecation:qa:rest");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:downsample:qa:with-security");
Expand Down
68 changes: 45 additions & 23 deletions x-pack/plugin/ccr/build.gradle
Original file line number Diff line number Diff line change
@@ -1,46 +1,68 @@
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask

apply plugin: 'elasticsearch.internal-es-plugin'
apply plugin: 'elasticsearch.internal-cluster-test'
apply plugin: 'elasticsearch.internal-java-rest-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'
apply plugin: 'elasticsearch.internal-test-artifact'

esplugin {
name = 'x-pack-ccr'
description = 'Elasticsearch Expanded Pack Plugin - CCR'
classname ='org.elasticsearch.xpack.ccr.Ccr'
hasNativeController =false
requiresKeystore =true
classname = 'org.elasticsearch.xpack.ccr.Ccr'
hasNativeController = false
requiresKeystore = true
extendedPlugins = ['x-pack-core']
}

base {
archivesName = 'x-pack-ccr'
}

// Integration Test classes that cannot run with the security manager
String[] noSecurityManagerITClasses = ["**/CloseFollowerIndexIT.class"]
dependencies {
compileOnly project(":server")

tasks.register('internalClusterTestNoSecurityManager', Test) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security manager isn't a thing anymore so we don't need this extra task.

testClassesDirs = sourceSets.internalClusterTest.output.classesDirs
classpath = sourceSets.internalClusterTest.runtimeClasspath
include noSecurityManagerITClasses
systemProperty 'tests.security.manager', 'false'
compileOnly project(path: xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation(testArtifact(project(xpackModule('monitoring'))))
testImplementation(project(":modules:analysis-common"))
testImplementation(project(":modules:data-streams"))
javaRestTestImplementation(testImplementation(testArtifact(project(xpackModule('core')))))

clusterModules project(":modules:analysis-common")
clusterModules project(":modules:mapper-extras")
clusterModules project(":modules:data-streams")
clusterModules project(":modules:ingest-common")
clusterModules project(xpackModule("monitoring"))
clusterModules project(xpackModule("ilm"))
clusterModules project(xpackModule("wildcard"))
clusterModules project(xpackModule("stack"))
clusterModules project(xpackModule("mapper-constant-keyword"))
clusterModules project(xpackModule("searchable-snapshots"))
}
tasks.named("check").configure { dependsOn 'internalClusterTestNoSecurityManager' }

tasks.named('internalClusterTest').configure {
exclude noSecurityManagerITClasses
restResources {
restApi {
include '_common', 'cluster', 'nodes', 'indices', 'index', 'info', 'ccr'
}
}

tasks.named('internalClusterTestTestingConventions').configure {
tasks.named('internalClusterTest') {
systemProperty 'tests.security.manager', 'false'
}

tasks.named('internalClusterTestTestingConventions') {
baseClass 'org.elasticsearch.xpack.CcrIntegTestCase'
baseClass 'org.elasticsearch.xpack.CcrSingleNodeTestCase'
baseClass 'org.elasticsearch.test.ESIntegTestCase'
}

addQaCheckDependencies(project)

dependencies {
compileOnly project(":server")
tasks.named("yamlRestTest") {
usesDefaultDistribution("uses _xpack info api")
}

compileOnly project(path: xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation(testArtifact(project(xpackModule('monitoring'))))
testImplementation(project(":modules:analysis-common"))
testImplementation(project(":modules:data-streams"))
tasks.withType(StandaloneRestIntegTestTask).configureEach {
// These fail in CI but only when run as part of checkPart2 and not individually.
// Tracked in : https://github.com/elastic/elasticsearch/issues/66661
buildParams.withFipsEnabledOnly(it)
}
20 changes: 0 additions & 20 deletions x-pack/plugin/ccr/qa/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

apply plugin: 'elasticsearch.java'

dependencies {
api project(':test:framework')
}

subprojects {
tasks.withType(Test).configureEach {
// These fail in CI but only when run as part of checkPart2 and not individually.
// Tracked in : https://github.com/elastic/elasticsearch/issues/66661
buildParams.withFipsEnabledOnly(it)
}
}
85 changes: 0 additions & 85 deletions x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle

This file was deleted.

116 changes: 9 additions & 107 deletions x-pack/plugin/ccr/qa/multi-cluster/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,115 +4,17 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
import org.elasticsearch.gradle.testclusters.TestClusterValueSource
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
import org.elasticsearch.gradle.testclusters.TestClustersRegistry
import org.elasticsearch.gradle.util.GradleUtils

import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE

apply plugin: 'elasticsearch.internal-testclusters'
apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.internal-java-rest-test'

dependencies {
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation project(xpackModule('ccr'))
testImplementation project(':x-pack:plugin:ccr:qa')
}

def clusterPath = getPath()
def leaderCluster = testClusters.register('leader-cluster') {
testDistribution = 'DEFAULT'
setting 'xpack.license.self_generated.type', 'trial'
setting 'xpack.security.enabled', 'true'
user username: 'admin', password: 'admin-password', role: 'superuser'
setting 'path.repo', "${layout.buildDirectory.asFile.get()}/cluster/shared/repo/leader-cluster"
}

def middleCluster = testClusters.register('middle-cluster') {
testDistribution = 'DEFAULT'
setting 'xpack.license.self_generated.type', 'trial'
setting 'xpack.security.enabled', 'true'
user username: 'admin', password: 'admin-password', role: 'superuser'

Provider<TestClustersRegistry> serviceProvider = GradleUtils.getBuildService(
project.gradle.sharedServices,
TestClustersPlugin.REGISTRY_SERVICE_NAME
)
def leaderInfo = project.getProviders().of(TestClusterValueSource.class) {
it.parameters.path.set(clusterPath)
it.parameters.clusterName.set("leader-cluster")
it.parameters.service = serviceProvider
}
def leaderUris = leaderInfo.map { it.getAllTransportPortURI() }
setting 'cluster.remote.leader_cluster.seeds',
{ "\"${leaderUris.get().join(",")}\"" }, IGNORE_VALUE
}

tasks.register("leader-cluster", RestIntegTestTask) {
mustRunAfter("precommit")
systemProperty 'tests.target_cluster', 'leader'
systemProperty 'tests.leader_cluster_repository_path', "${layout.buildDirectory.asFile.get()}/cluster/shared/repo/leader-cluster"
javaRestTestImplementation(testArtifact(project(xpackModule('core'))))
javaRestTestImplementation(testArtifact(project(xpackModule('ccr')), 'javaRestTest'))
javaRestTestImplementation project(xpackModule('ccr'))
}

tasks.register("middle-cluster", RestIntegTestTask) {
dependsOn "leader-cluster"
useCluster testClusters.named("leader-cluster")
systemProperty 'tests.target_cluster', 'middle'
systemProperty 'tests.leader_cluster_repository_path', "${layout.buildDirectory.asFile.get()}/cluster/shared/repo/leader-cluster"

def leaderUri = getClusterInfo('leader-cluster').map { it.allHttpSocketURI.get(0) }
nonInputProperties.systemProperty 'tests.leader_host', leaderUri
tasks.named("javaRestTest") {
usesDefaultDistribution("uses _xpack usage api")
// These fail in CI but only when run as part of checkPart2 and not individually.
// Tracked in : https://github.com/elastic/elasticsearch/issues/66661
buildParams.withFipsEnabledOnly(it)
}

tasks.register('follow-cluster', RestIntegTestTask) {
dependsOn "leader-cluster", "middle-cluster"
useCluster leaderCluster
useCluster middleCluster
systemProperty 'tests.target_cluster', 'follow'
systemProperty 'tests.leader_cluster_repository_path', "${layout.buildDirectory.asFile.get()}/cluster/shared/repo/leader-cluster"

def leaderUri = getClusterInfo('leader-cluster').map { it.allHttpSocketURI.get(0) }
def middleUri = getClusterInfo('middle-cluster').map { it.allHttpSocketURI.get(0) }
nonInputProperties.systemProperty 'tests.leader_host', leaderUri
nonInputProperties.systemProperty 'tests.middle_host', middleUri
}

testClusters.matching { it.name == "follow-cluster" }.configureEach {
testDistribution = 'DEFAULT'
setting 'xpack.monitoring.collection.enabled', 'true'
setting 'xpack.license.self_generated.type', 'trial'
setting 'xpack.security.enabled', 'true'
user username: 'admin', password: 'admin-password', role: 'superuser'

Provider<TestClustersRegistry> serviceProvider = GradleUtils.getBuildService(
project.gradle.sharedServices,
TestClustersPlugin.REGISTRY_SERVICE_NAME
)
def leaderUris = project.getProviders().of(TestClusterValueSource.class) {
it.parameters.path.set(clusterPath)
it.parameters.clusterName.set("leader-cluster")
it.parameters.service = serviceProvider
}.map { it.getAllTransportPortURI() }

def middleUris = project.getProviders().of(TestClusterValueSource.class) {
it.parameters.path.set(clusterPath)
it.parameters.clusterName.set("middle-cluster")
it.parameters.service = serviceProvider
}.map { it.getAllTransportPortURI() }

setting 'cluster.remote.leader_cluster.seeds',
{ "\"${leaderUris.get().join(",")}\"" }, IGNORE_VALUE
setting 'cluster.remote.middle_cluster.seeds',
{ "\"${middleUris.get().join(",")}\"" }, IGNORE_VALUE
}


testClusters.configureEach {
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
}

tasks.named("check").configure { dependsOn "follow-cluster" }
Loading