2017-12-13 10:19:31 -05:00
|
|
|
import org.elasticsearch.gradle.precommit.PrecommitTasks
|
|
|
|
import org.elasticsearch.gradle.test.RunTask
|
|
|
|
|
|
|
|
description = 'Integration tests for SQL'
|
|
|
|
apply plugin: 'elasticsearch.build'
|
2018-01-17 15:48:58 -05:00
|
|
|
archivesBaseName = 'qa-sql'
|
2017-12-13 10:19:31 -05:00
|
|
|
|
|
|
|
dependencies {
|
2018-01-18 09:33:16 -05:00
|
|
|
compile "org.elasticsearch.test:framework:${version}"
|
2017-12-13 10:19:31 -05:00
|
|
|
|
2018-01-16 13:26:06 -05:00
|
|
|
// TODO: Restore shading when https://github.com/elastic/elasticsearch/pull/27955 gets in
|
2018-02-07 23:50:12 -05:00
|
|
|
testCompile "org.elasticsearch.plugin:x-pack-core:${version}"
|
|
|
|
compile xpackProject('plugin:sql:jdbc')
|
2017-12-13 10:19:31 -05:00
|
|
|
compile "net.sourceforge.csvjdbc:csvjdbc:1.0.34"
|
|
|
|
runtime "com.h2database:h2:1.4.194"
|
|
|
|
// used for running debug tests
|
|
|
|
runtime 'org.antlr:antlr4-runtime:4.5.3'
|
|
|
|
|
2018-01-17 15:48:58 -05:00
|
|
|
/* There are *no* CLI testing dependencies because we
|
|
|
|
* communicate with a fixture to fork a new CLI process
|
|
|
|
* when we need it. */
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/* disable unit tests because these are all integration tests used
|
|
|
|
* other qa projects. */
|
|
|
|
test.enabled = false
|
|
|
|
|
|
|
|
dependencyLicenses.enabled = false
|
|
|
|
|
|
|
|
// the main files are actually test files, so use the appropriate forbidden api sigs
|
|
|
|
forbiddenApisMain {
|
|
|
|
signaturesURLs = [PrecommitTasks.getResource('/forbidden/es-all-signatures.txt'),
|
|
|
|
PrecommitTasks.getResource('/forbidden/es-test-signatures.txt')]
|
|
|
|
}
|
|
|
|
|
|
|
|
thirdPartyAudit.excludes = [
|
|
|
|
// H2 dependencies that we don't actually use....
|
|
|
|
'javax.servlet.ServletConfig',
|
|
|
|
'javax.servlet.ServletContext',
|
|
|
|
'javax.servlet.ServletContextEvent',
|
|
|
|
'javax.servlet.ServletContextListener',
|
|
|
|
'javax.servlet.ServletOutputStream',
|
|
|
|
'javax.servlet.http.HttpServlet',
|
|
|
|
'javax.servlet.http.HttpServletRequest',
|
|
|
|
'javax.servlet.http.HttpServletResponse',
|
|
|
|
'org.apache.lucene.document.Field$Index',
|
|
|
|
'org.apache.lucene.queryParser.QueryParser',
|
|
|
|
'org.osgi.framework.BundleActivator',
|
|
|
|
'org.osgi.framework.BundleContext',
|
|
|
|
'org.osgi.service.jdbc.DataSourceFactory',
|
|
|
|
'org.slf4j.Logger',
|
|
|
|
'org.slf4j.LoggerFactory',
|
|
|
|
]
|
|
|
|
|
|
|
|
subprojects {
|
|
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
|
|
|
configurations {
|
|
|
|
cliFixture
|
2018-01-18 08:39:02 -05:00
|
|
|
cliJar
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
/* Since we're a standalone rest test we actually get transitive
|
|
|
|
* dependencies but we don't really want them because they cause
|
|
|
|
* all kinds of trouble with the jar hell checks. So we suppress
|
|
|
|
* them explicitly for non-es projects. */
|
2018-02-07 23:50:12 -05:00
|
|
|
testCompile(xpackProject('qa:sql')) {
|
2017-12-13 10:19:31 -05:00
|
|
|
transitive = false
|
|
|
|
}
|
2018-01-18 09:33:16 -05:00
|
|
|
testCompile "org.elasticsearch.test:framework:${version}"
|
2017-12-13 10:19:31 -05:00
|
|
|
|
|
|
|
// JDBC testing dependencies
|
2018-02-07 23:50:12 -05:00
|
|
|
testRuntime(xpackProject('plugin:sql:jdbc'))
|
2018-01-16 13:26:06 -05:00
|
|
|
// TODO: Restore shading when https://github.com/elastic/elasticsearch/pull/27955 gets in
|
2017-12-13 10:19:31 -05:00
|
|
|
testRuntime("net.sourceforge.csvjdbc:csvjdbc:1.0.34") {
|
|
|
|
transitive = false
|
|
|
|
}
|
|
|
|
testRuntime("com.h2database:h2:1.4.194") {
|
|
|
|
transitive = false
|
|
|
|
}
|
|
|
|
testRuntime("org.antlr:antlr4-runtime:4.5.3") {
|
|
|
|
transitive = false
|
|
|
|
}
|
|
|
|
|
2018-02-07 23:50:12 -05:00
|
|
|
cliFixture xpackProject('test:sql-cli-fixture')
|
|
|
|
cliJar(xpackProject('plugin:sql:sql-cli')) {
|
2018-01-18 08:39:02 -05:00
|
|
|
// We only need the jar file because it bundles all of its dependencies
|
|
|
|
transitive = false
|
|
|
|
}
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if (project.name != 'security') {
|
2018-01-17 15:48:58 -05:00
|
|
|
// The security project just configures its subprojects
|
2017-12-13 10:19:31 -05:00
|
|
|
apply plugin: 'elasticsearch.rest-test'
|
|
|
|
|
|
|
|
task cliFixture(type: org.elasticsearch.gradle.test.AntFixture) {
|
2018-02-07 23:50:12 -05:00
|
|
|
Project cli = xpackProject('plugin:sql:sql-cli')
|
2017-12-13 10:19:31 -05:00
|
|
|
dependsOn project.configurations.cliFixture
|
2018-01-18 08:39:02 -05:00
|
|
|
dependsOn project.configurations.cliJar
|
2018-01-16 14:53:49 -05:00
|
|
|
executable = new File(project.runtimeJavaHome, 'bin/java')
|
2017-12-13 10:19:31 -05:00
|
|
|
env 'CLASSPATH', "${ -> project.configurations.cliFixture.asPath }"
|
|
|
|
args 'org.elasticsearch.xpack.sql.cli.fixture.CliFixture',
|
2018-01-18 08:39:02 -05:00
|
|
|
baseDir, "${ -> project.configurations.cliJar.singleFile}"
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
integTestCluster {
|
2018-02-07 23:50:12 -05:00
|
|
|
plugin xpackProject('plugin').path
|
2017-12-13 10:19:31 -05:00
|
|
|
setting 'xpack.monitoring.enabled', 'false'
|
|
|
|
setting 'xpack.ml.enabled', 'false'
|
|
|
|
setting 'xpack.watcher.enabled', 'false'
|
|
|
|
setting 'script.max_compilations_rate', '1000/1m'
|
|
|
|
dependsOn cliFixture
|
|
|
|
}
|
|
|
|
|
|
|
|
integTestRunner {
|
|
|
|
systemProperty 'tests.cli.fixture', "${ -> cliFixture.addressAndPort }"
|
|
|
|
finalizedBy cliFixture.stopTask
|
|
|
|
}
|
|
|
|
|
2017-12-15 10:42:18 -05:00
|
|
|
task runqa(type: RunTask) {
|
2018-02-07 23:50:12 -05:00
|
|
|
plugin xpackProject('plugin').path
|
2017-12-13 10:19:31 -05:00
|
|
|
setting 'xpack.monitoring.enabled', 'false'
|
|
|
|
setting 'xpack.ml.enabled', 'false'
|
|
|
|
setting 'xpack.watcher.enabled', 'false'
|
|
|
|
setting 'script.max_compilations_rate', '1000/1m'
|
|
|
|
dependsOn cliFixture
|
|
|
|
}
|
2017-12-15 10:42:18 -05:00
|
|
|
runqa.finalizedBy cliFixture.stopTask
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|
|
|
|
}
|