2017-06-20 14:03:53 -04:00
|
|
|
apply plugin: 'elasticsearch.build'
|
|
|
|
|
2017-06-21 12:12:19 -04:00
|
|
|
description = 'Shared test utilities for jdbc and cli projects'
|
2017-06-20 14:03:53 -04:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile "org.elasticsearch.client:transport:${version}"
|
2017-06-22 18:21:55 -04:00
|
|
|
compile "junit:junit:${versions.junit}"
|
|
|
|
compile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
|
2017-06-20 14:03:53 -04:00
|
|
|
}
|
2017-06-21 12:12:19 -04:00
|
|
|
|
|
|
|
/* Elasticsearch traditionally disables this for test utilities because it is
|
|
|
|
* hard to configure and (hopefully) much less important for tests than
|
|
|
|
* production code. */
|
|
|
|
dependencyLicenses.enabled = false
|
2017-06-21 17:02:59 -04:00
|
|
|
|
Get jdbc tests passing
`gradle check -xforbiddenPatterns` now passes in jdbc.
This makes running the embedded HTTP server slightly more difficult,
you now have to add the following to your jvm arguments.
```
-ea -Dtests.rest.cluster=localhost:9200 -Dtests.embed.sql=true -Dtests.security.manager=false
```
Depending on your environment the embedded jdbc connection may give
spurious failures that look like:
```
org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcException: RemoteTransportException[[node-0][127.0.0.1:9300][indices:data/read/search]]; nested: SearchPhaseExecutionException[]; nested: GeneralScriptException[Failed to compile inline script [( params.a0 > params.v0 ) && ( params.a1 > params.v1 )] using lang [painless]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_per_minute] setting];
...
Caused by: Failed to execute phase [fetch],
..
Caused by: GeneralScriptException[Failed to compile inline script [( params.a0 > params.v0 ) && ( params.a1 > params.v1 )] using lang [painless]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_per_minute] setting];
...
Caused by: CircuitBreakingException[[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_per_minute] setting]
```
`gradle check` works around this by setting `script.max_compilations_per_minute`
to `1000`.
Another change is that we no longer support loading the test data by
uncommenting some code. Instead we load the test data into Elaticsearch
before the first test and we deleted it after the last test. This is
so that tests that required different test data can interoperate with
eachother. The spec tests all use the same test data but the metadata
tests do not.
Original commit: elastic/x-pack-elasticsearch@8b8f684ac19d4dc2d2b7bdce05caa0f1693bd937
2017-07-05 13:38:17 -04:00
|
|
|
// Allow for com.sun.net.httpserver.* usage for testing
|
|
|
|
eclipse {
|
|
|
|
classpath.file {
|
|
|
|
whenMerged { cp ->
|
|
|
|
def con = entries.find { e ->
|
|
|
|
e.kind == "con" && e.toString().contains("org.eclipse.jdt.launching.JRE_CONTAINER")
|
|
|
|
}
|
|
|
|
con.accessRules.add(new org.gradle.plugins.ide.eclipse.model.AccessRule(
|
|
|
|
"accessible", "com/sun/net/httpserver/*"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
forbiddenApisTest {
|
2017-06-21 17:02:59 -04:00
|
|
|
bundledSignatures -= 'jdk-non-portable'
|
|
|
|
bundledSignatures += 'jdk-internal'
|
|
|
|
}
|