Build: Move test framework under a "test" top level dir

This allows adding more test projects, eg integ test fixtures that will
be coming soon.
This commit is contained in:
Ryan Ernst 2015-12-17 16:57:39 -08:00
parent e128298c5d
commit 6a99796b02
166 changed files with 32 additions and 9 deletions

View File

@ -109,7 +109,7 @@ subprojects {
ext.projectSubstitutions = [ ext.projectSubstitutions = [
"org.elasticsearch:rest-api-spec:${version}": ':rest-api-spec', "org.elasticsearch:rest-api-spec:${version}": ':rest-api-spec',
"org.elasticsearch:elasticsearch:${version}": ':core', "org.elasticsearch:elasticsearch:${version}": ':core',
"org.elasticsearch:test-framework:${version}": ':test-framework', "org.elasticsearch.test:framework:${version}": ':test:framework',
"org.elasticsearch.distribution.integ-test-zip:elasticsearch:${version}": ':distribution:integ-test-zip', "org.elasticsearch.distribution.integ-test-zip:elasticsearch:${version}": ':distribution:integ-test-zip',
"org.elasticsearch.distribution.zip:elasticsearch:${version}": ':distribution:zip', "org.elasticsearch.distribution.zip:elasticsearch:${version}": ':distribution:zip',
"org.elasticsearch.distribution.tar:elasticsearch:${version}": ':distribution:tar', "org.elasticsearch.distribution.tar:elasticsearch:${version}": ':distribution:tar',
@ -141,8 +141,8 @@ subprojects {
// the dependency is added. // the dependency is added.
gradle.projectsEvaluated { gradle.projectsEvaluated {
allprojects { allprojects {
if (project.path == ':test-framework') { if (project.path == ':test:framework') {
// :test-framework:test cannot run before and after :core:test // :test:framework:test cannot run before and after :core:test
return return
} }
configurations.all { configurations.all {

View File

@ -202,7 +202,7 @@ class BuildPlugin implements Plugin<Project> {
// force all dependencies added directly to compile/testCompile to be non-transitive, except for ES itself // force all dependencies added directly to compile/testCompile to be non-transitive, except for ES itself
Closure disableTransitiveDeps = { ModuleDependency dep -> Closure disableTransitiveDeps = { ModuleDependency dep ->
if (!(dep instanceof ProjectDependency) && dep.getGroup() != 'org.elasticsearch') { if (!(dep instanceof ProjectDependency) && dep.group.startsWith('org.elasticsearch') == false) {
dep.transitive = false dep.transitive = false
// also create a configuration just for this dependency version, so that later // also create a configuration just for this dependency version, so that later
@ -302,6 +302,7 @@ class BuildPlugin implements Plugin<Project> {
options.compilerArgs << '-profile' << project.compactProfile options.compilerArgs << '-profile' << project.compactProfile
} }
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
//options.incremental = true
} }
} }
} }

View File

@ -60,7 +60,7 @@ public class PluginBuildPlugin extends BuildPlugin {
private static void configureDependencies(Project project) { private static void configureDependencies(Project project) {
project.dependencies { project.dependencies {
provided "org.elasticsearch:elasticsearch:${project.versions.elasticsearch}" provided "org.elasticsearch:elasticsearch:${project.versions.elasticsearch}"
testCompile "org.elasticsearch:test-framework:${project.versions.elasticsearch}" testCompile "org.elasticsearch.test:framework:${project.versions.elasticsearch}"
// we "upgrade" these optional deps to provided for plugins, since they will run // we "upgrade" these optional deps to provided for plugins, since they will run
// with a full elasticsearch server that includes optional deps // with a full elasticsearch server that includes optional deps
provided "com.spatial4j:spatial4j:${project.versions.spatial4j}" provided "com.spatial4j:spatial4j:${project.versions.spatial4j}"

View File

@ -42,7 +42,7 @@ public class StandaloneTestBasePlugin implements Plugin<Project> {
// only setup tests to build // only setup tests to build
project.sourceSets.create('test') project.sourceSets.create('test')
project.dependencies.add('testCompile', "org.elasticsearch:test-framework:${VersionProperties.elasticsearch}") project.dependencies.add('testCompile', "org.elasticsearch.test:framework:${VersionProperties.elasticsearch}")
project.eclipse.classpath.sourceSets = [project.sourceSets.test] project.eclipse.classpath.sourceSets = [project.sourceSets.test]
project.eclipse.classpath.plusConfigurations = [project.configurations.testRuntime] project.eclipse.classpath.plusConfigurations = [project.configurations.testRuntime]

View File

@ -82,7 +82,7 @@ dependencies {
compile "net.java.dev.jna:jna:${versions.jna}", optional compile "net.java.dev.jna:jna:${versions.jna}", optional
if (isEclipse == false || project.path == ":core-tests") { if (isEclipse == false || project.path == ":core-tests") {
testCompile("org.elasticsearch:test-framework:${version}") { testCompile("org.elasticsearch.test:framework:${version}") {
// tests use the locally compiled version of core // tests use the locally compiled version of core
exclude group: 'org.elasticsearch', module: 'elasticsearch' exclude group: 'org.elasticsearch', module: 'elasticsearch'
} }

View File

@ -8,7 +8,7 @@ List projects = [
'distribution:tar', 'distribution:tar',
'distribution:deb', 'distribution:deb',
'distribution:rpm', 'distribution:rpm',
'test-framework', 'test:framework',
'modules:lang-expression', 'modules:lang-expression',
'modules:lang-groovy', 'modules:lang-groovy',
'modules:lang-mustache', 'modules:lang-mustache',

23
test/build.gradle Normal file
View File

@ -0,0 +1,23 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch 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.
*/
subprojects {
group = 'org.elasticsearch.test'
apply plugin: 'com.bmuschko.nexus'
}

View File

@ -19,7 +19,6 @@
import org.elasticsearch.gradle.precommit.PrecommitTasks import org.elasticsearch.gradle.precommit.PrecommitTasks
apply plugin: 'elasticsearch.build' apply plugin: 'elasticsearch.build'
apply plugin: 'com.bmuschko.nexus'
dependencies { dependencies {
compile "org.elasticsearch:elasticsearch:${version}" compile "org.elasticsearch:elasticsearch:${version}"

Some files were not shown because too many files have changed in this diff Show More