logstash/qa/integration/build.gradle
Andrea Selva 728289e862
Switched to Gradle 7 (#13184)
This commit:
- Updates the Gradle wrapper to version 7.2
- Remove the deprecated jcenter and where it was used to retrieve Gradle's plugins it switches to gradlePluginPortal
- Insert an explicit dependency from test task to the log4j.properties manipulation task ("copyProductionLog4jConfiguration") used in integration
2021-09-08 10:42:13 +02:00

81 lines
2.6 KiB
Groovy

/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
description = """Logstash Integration Tests"""
repositories {
mavenCentral()
}
buildscript {
repositories {
mavenCentral()
}
}
dependencies {
testImplementation project(':logstash-core')
testImplementation 'org.assertj:assertj-core:3.8.0'
testImplementation 'junit:junit:4.12'
}
test {
exclude '/**'
}
tasks.register("copyProductionLog4jConfiguration", Copy) {
description "Copy the production log4j config to be tested in QA (qa/integration/fixtures/logs_rollover)"
from "${projectDir}/../../config/log4j2.properties"
into "${projectDir}/fixtures/logs_rollover/"
filter {
// modify rollover policy to make it happen in integration test without need to generate tons of log lines
line -> line
.replace('appender.rolling.policies.size.size = 100MB',
'appender.rolling.policies.size.size = 1KB')
.replace('appender.rolling.filePattern = ${sys:ls.logs}/logstash-plain-%d{yyyy-MM-dd}-%i.log.gz',
'appender.rolling.filePattern = ${sys:ls.logs}/logstash-plain-%d{yyyy-MM-dd}.log')
.replace('appender.routing.pipeline.policy.size = 100MB',
'appender.routing.pipeline.policy.size = 1KB')
}
}
clean {
delete "${projectDir}/fixtures/logs_rollover/log4j2.properties"
}
tasks.register("integrationTests", Test) {
dependsOn copyProductionLog4jConfiguration
inputs.files fileTree("${projectDir}/services")
inputs.files fileTree("${projectDir}/framework")
inputs.files fileTree("${projectDir}/fixtures")
inputs.files fileTree("${projectDir}/specs")
systemProperty 'logstash.core.root.dir', projectDir.absolutePath
include '/org/logstash/integration/RSpecTests.class'
outputs.upToDateWhen {
if (project.hasProperty('integrationTests.rerun')) {
println "Rerunning Integration Tests"
return false
} else {
return true
}
}
}