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
19 changes: 1 addition & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.java-rest-test'
apply plugin: 'opensearch.pluginzip'
apply plugin: 'opensearch.java-agent'
apply from: 'build-tools/opensearchplugin-coverage.gradle'
apply from: 'gradle/formatting.gradle'

Expand Down Expand Up @@ -87,7 +88,6 @@ opensearchplugin {
}

configurations {
agent
opensearchPlugin
}

Expand Down Expand Up @@ -202,10 +202,6 @@ dependencies {
exclude group: 'com.google.guava'
}

agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
agent "org.opensearch:opensearch-agent:${opensearch_version}"
agent "net.bytebuddy:byte-buddy:${versions.bytebuddy}"

opensearchPlugin "org.opensearch.plugin:opensearch-security:${security_plugin_version}@zip"
}

Expand All @@ -221,16 +217,6 @@ def _numNodes = findProperty('numNodes') as Integer ?: 1
def opensearch_tmp_dir = rootProject.file('build/private/opensearch_tmp').absoluteFile
opensearch_tmp_dir.mkdirs()

task prepareAgent(type: Copy) {
from(configurations.agent)
into "$buildDir/agent"
}

tasks.test {
dependsOn prepareAgent
jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
}

task integTest(type: RestIntegTestTask) {
description = "Run tests against a cluster"
testClassesDirs = sourceSets.test.output.classesDirs
Expand All @@ -246,7 +232,6 @@ integTest {
exclude "${it}"
}
}
dependsOn "prepareAgent"
systemProperty 'tests.security.manager', 'false'
systemProperty 'java.io.tmpdir', es_tmp_dir.absolutePath

Expand All @@ -273,8 +258,6 @@ integTest {
if (System.getProperty("test.debug") != null) {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=8000'
}

jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
}
Zip bundle = (Zip) project.getTasks().getByName("bundlePlugin");
integTest.dependsOn(bundle)
Expand Down
25 changes: 1 addition & 24 deletions sample-extension-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.java-rest-test'
apply plugin: 'opensearch.java-agent'

import org.opensearch.gradle.test.RestIntegTestTask
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask
Expand Down Expand Up @@ -33,16 +34,8 @@ repositories {
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
}

configurations {
agent
}

dependencies {
compileOnly project(path: ":${rootProject.name}-spi", configuration: 'shadow')

agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
agent "org.opensearch:opensearch-agent:${opensearch_version}"
agent "net.bytebuddy:byte-buddy:1.17.5"
}

def es_tmp_dir = rootProject.file('build/private/es_tmp').absoluteFile
Expand Down Expand Up @@ -177,16 +170,10 @@ String bwcDownloadUrl = "https://aws.oss.sonatype.org/service/local/artifact/mav

List<Provider<RegularFile>> plugins = []

task prepareAgent(type: Copy) {
from(configurations.agent)
into "$buildDir/agent"
}

// Ensure the artifact for the current project version is available to be used for the bwc tests
task prepareBwcTests {
dependsOn bundle
dependsOn rootBundle
dependsOn prepareAgent
doLast {
plugins = [
rootProject.getObjects().fileProperty().value(rootBundle.getArchiveFile()),
Expand All @@ -208,8 +195,6 @@ task prepareBwcTests {
systemProperty 'tests.plugin_bwc_version', bwcPluginVersion
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}$i".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}$i".getName()}")

jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
}
}

Expand All @@ -230,8 +215,6 @@ task "${baseName}#mixedClusterTask"(type: StandaloneRestIntegTestTask) {
systemProperty 'tests.plugin_bwc_version', bwcPluginVersion
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}")

jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
}

// Upgrade the second node to new OpenSearch version with upgraded plugin version after the first node is upgraded.
Expand All @@ -251,8 +234,6 @@ task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTas
systemProperty 'tests.plugin_bwc_version', bwcPluginVersion
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}")

jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
}

// Upgrade the third node to new OpenSearch version with upgraded plugin version after the second node is upgraded.
Expand All @@ -273,8 +254,6 @@ task "${baseName}#rollingUpgradeClusterTask"(type: StandaloneRestIntegTestTask)
systemProperty 'tests.plugin_bwc_version', bwcPluginVersion
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}")

jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
}

// Upgrade all the nodes of the old cluster to new OpenSearch version with upgraded plugin version
Expand All @@ -292,8 +271,6 @@ task "${baseName}#fullRestartClusterTask"(type: StandaloneRestIntegTestTask) {
systemProperty 'tests.plugin_bwc_version', bwcPluginVersion
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}1".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}1".getName()}")

jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
}

// A bwc test suite which runs all the bwc tasks combined
Expand Down
Loading