mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Tests: Add support for alternative architectures
Enable filebeat and elasticsearch downloads to pull different architectures, Filebeat and Elasticsearch use different suffixes to denote their aarch64 architectures, with beats using arm64 and elasticsearch aarch64
This commit is contained in:
parent
1a0d5c961f
commit
af54d95df8
1 changed files with 24 additions and 16 deletions
40
build.gradle
40
build.gradle
|
@ -125,16 +125,27 @@ version = versionMap['logstash-core']
|
||||||
String artifactVersionsApi = "https://artifacts-api.elastic.co/v1/versions"
|
String artifactVersionsApi = "https://artifacts-api.elastic.co/v1/versions"
|
||||||
|
|
||||||
tasks.register("configureArchitecture") {
|
tasks.register("configureArchitecture") {
|
||||||
String arch = "x86_64"
|
String arch = System.properties['os.arch']
|
||||||
String osName = System.properties['os.name']
|
String osName = System.properties['os.name']
|
||||||
|
String beatsArch = arch
|
||||||
|
String esArch = arch
|
||||||
|
|
||||||
|
// For aarch64 architectures, beats and elasticsearch name their artifacts differently
|
||||||
|
if (arch == "aarch64") {i
|
||||||
|
beatsArch="arm64"
|
||||||
|
esArch="aarch64"
|
||||||
|
} else if (arch == "amd64") {
|
||||||
|
beatsArch="x86_64"
|
||||||
|
esArch="x86_64"
|
||||||
|
}
|
||||||
|
|
||||||
if (osName ==~ /Mac OS X/) {
|
if (osName ==~ /Mac OS X/) {
|
||||||
osName = "darwin"
|
osName = "darwin"
|
||||||
} else {
|
} else {
|
||||||
osName = "linux"
|
osName = "linux"
|
||||||
}
|
}
|
||||||
String architecture = "${osName}-${arch}"
|
project.ext.set("beatsArchitecture", "${osName}-${beatsArch}")
|
||||||
project.ext.set("architecture", architecture)
|
project.ext.set("esArchitecture", "${osName}-${esArch}")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("configureArtifactInfo") {
|
tasks.register("configureArtifactInfo") {
|
||||||
|
@ -159,8 +170,7 @@ tasks.register("configureArtifactInfo") {
|
||||||
def stackBuildVersion = dlBuilds["builds"][0]
|
def stackBuildVersion = dlBuilds["builds"][0]
|
||||||
|
|
||||||
project.ext.set("artifactApiVersionedBuildUrl", "${artifactVersionsApi}/${qualifiedVersion}/builds/${stackBuildVersion}")
|
project.ext.set("artifactApiVersionedBuildUrl", "${artifactVersionsApi}/${qualifiedVersion}/builds/${stackBuildVersion}")
|
||||||
project.ext.set("stackArtifactSuffix", "${qualifiedVersion}-${project.ext.get('architecture')}")
|
project.ext.set("stackArtifactSuffix", qualifiedVersion)
|
||||||
project.ext.set("stackArtifactSuffixNoArch", qualifiedVersion)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -334,15 +344,13 @@ tasks.register("installIntegrationTestGems") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tasks.register("downloadFilebeat", Download) {
|
tasks.register("downloadFilebeat", Download) {
|
||||||
dependsOn configureArtifactInfo
|
dependsOn configureArtifactInfo
|
||||||
description "Download Filebeat Snapshot for current branch version: ${version}"
|
description "Download Filebeat Snapshot for current branch version: ${version}"
|
||||||
|
|
||||||
project.ext.set("versionFound", true)
|
project.ext.set("versionFound", true)
|
||||||
|
|
||||||
String downloadedFilebeatName = "filebeat-${project.ext.get("stackArtifactSuffix")}"
|
String downloadedFilebeatName = "filebeat-${project.ext.get("stackArtifactSuffix")}-${project.ext.get("beatsArchitecture")}"
|
||||||
project.ext.set("unpackedFilebeatName", downloadedFilebeatName)
|
project.ext.set("unpackedFilebeatName", downloadedFilebeatName)
|
||||||
|
|
||||||
// find url of build artifact
|
// find url of build artifact
|
||||||
|
@ -381,12 +389,13 @@ tasks.register("copyFilebeat", Copy){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tasks.register("downloadEs", Download) {
|
tasks.register("downloadEs", Download) {
|
||||||
dependsOn configureArtifactInfo
|
dependsOn configureArtifactInfo
|
||||||
description "Download ES Snapshot for current branch version: ${version}"
|
description "Download ES Snapshot for current branch version: ${version}"
|
||||||
|
|
||||||
String downloadedElasticsearchName = "elasticsearch-${project.ext.get("stackArtifactSuffix")}"
|
String downloadedElasticsearchName = "elasticsearch-${project.ext.get("stackArtifactSuffix")}-${project.ext.get("esArchitecture")}"
|
||||||
project.ext.set("unpackedElasticsearchName", "elasticsearch-${project.ext.get("stackArtifactSuffixNoArch")}")
|
project.ext.set("unpackedElasticsearchName", "elasticsearch-${project.ext.get("stackArtifactSuffix")}")
|
||||||
|
|
||||||
// find url of build artifact
|
// find url of build artifact
|
||||||
String artifactApiUrl = "${project.ext.get("artifactApiVersionedBuildUrl")}/projects/elasticsearch/packages/${downloadedElasticsearchName}.tar.gz"
|
String artifactApiUrl = "${project.ext.get("artifactApiVersionedBuildUrl")}/projects/elasticsearch/packages/${downloadedElasticsearchName}.tar.gz"
|
||||||
|
@ -425,17 +434,16 @@ tasks.register("copyEs", Copy){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def rubyIntegrationSpecs = project.hasProperty("rubyIntegrationSpecs") ? ((String) project.property("rubyIntegrationSpecs")).split(/\s+/).join(",") : "specs/**/*_spec.rb"
|
def rubyIntegrationSpecs = project.hasProperty("rubyIntegrationSpecs") ? ((String) project.property("rubyIntegrationSpecs")).split(/\s+/).join(",") : "specs/**/*_spec.rb"
|
||||||
def integrationTestPwd = "${projectDir}/qa/integration"
|
def integrationTestPwd = "${projectDir}/qa/integration"
|
||||||
|
|
||||||
project(":logstash-integration-tests") {
|
project(":logstash-integration-tests") {
|
||||||
tasks.getByPath(":logstash-integration-tests:integrationTests").configure {
|
tasks.getByPath(":logstash-integration-tests:integrationTests").configure {
|
||||||
systemProperty 'org.logstash.integration.specs', rubyIntegrationSpecs
|
systemProperty 'org.logstash.integration.specs', rubyIntegrationSpecs
|
||||||
environment "FEATURE_FLAG", System.getenv('FEATURE_FLAG')
|
environment "FEATURE_FLAG", System.getenv('FEATURE_FLAG')
|
||||||
workingDir integrationTestPwd
|
workingDir integrationTestPwd
|
||||||
dependsOn installIntegrationTestGems
|
dependsOn installIntegrationTestGems
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("runIntegrationTests"){
|
tasks.register("runIntegrationTests"){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue