Skip to content

Commit

Permalink
Fix split packages in external test modules (#78136) (#78144)
Browse files Browse the repository at this point in the history
The external test modules are plugins which provide extra test
functionality in snapshot builds. These are independent Elasticsearch
plugins added as modules. They currently share package names with
server. This commit moves them each into their own java package name.
  • Loading branch information
rjernst authored Sep 21, 2021
1 parent 3877282 commit 5f94b03
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 31 deletions.
8 changes: 1 addition & 7 deletions test/external-modules/delayed-aggs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@

esplugin {
description 'A test module that allows to delay aggregations on shards with a configurable time'
classname 'org.elasticsearch.search.aggregations.DelayedShardAggregationPlugin'
classname 'org.elasticsearch.test.delayedshard.DelayedShardAggregationPlugin'
}

restResources {
restApi {
include '_common', 'indices', 'index', 'cluster', 'search'
}
}

tasks.named('splitPackagesAudit').configure {
// aggs is owned by server, these should be moved to delayedaggs
ignoreClasses 'org.elasticsearch.search.aggregations.DelayedShardAggregationBuilder',
'org.elasticsearch.search.aggregations.DelayedShardAggregationPlugin'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.search.aggregations;
package org.elasticsearch.test.delayedshard;

import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand All @@ -15,6 +15,12 @@
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.Aggregator;
import org.elasticsearch.search.aggregations.AggregatorFactories;
import org.elasticsearch.search.aggregations.AggregatorFactory;
import org.elasticsearch.search.aggregations.CardinalityUpperBound;
import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
import org.elasticsearch.search.aggregations.support.AggregationContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.search.aggregations;
package org.elasticsearch.test.delayedshard;

import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.SearchPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
package org.elasticsearch.search.aggregations;
package org.elasticsearch.test.delayedshard;

import org.elasticsearch.core.TimeValue;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.search.aggregations.BaseAggregationTestCase;
import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin;

import java.util.Arrays;
Expand Down
8 changes: 1 addition & 7 deletions test/external-modules/die-with-dignity/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'elasticsearch.internal-es-plugin'

esplugin {
description 'Die with dignity plugin'
classname 'org.elasticsearch.DieWithDignityPlugin'
classname 'org.elasticsearch.test.diewithdignity.DieWithDignityPlugin'
}

// let the javaRestTest see the classpath of main
Expand All @@ -31,9 +31,3 @@ tasks.named("test").configure {
tasks.named("yamlRestTest").configure {
enabled = false
}

tasks.named('splitPackagesAudit').configure {
// these should be moved to an actual package, not the root package
ignoreClasses 'org.elasticsearch.DieWithDignityPlugin',
'org.elasticsearch.RestDieWithDignityAction'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch;
package org.elasticsearch.test.diewithdignity;

import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch;
package org.elasticsearch.test.diewithdignity;

import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Randomness;
Expand Down
9 changes: 1 addition & 8 deletions test/external-modules/error-query/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,11 @@

esplugin {
description 'A test module that exposes a way to simulate search shard failures and warnings'
classname 'org.elasticsearch.search.query.ErrorQueryPlugin'
classname 'org.elasticsearch.test.errorquery.ErrorQueryPlugin'
}

restResources {
restApi {
include '_common', 'indices', 'index', 'cluster', 'search'
}
}

tasks.named('splitPackagesAudit').configure {
// search.query is owned by server, these should be moved to errorquery
ignoreClasses 'org.elasticsearch.search.query.ErrorQueryBuilder',
'org.elasticsearch.search.query.ErrorQueryPlugin',
'org.elasticsearch.search.query.IndexError'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.search.query;
package org.elasticsearch.test.errorquery;

import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.search.query;
package org.elasticsearch.test.errorquery;

import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.SearchPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.search.query;
package org.elasticsearch.test.errorquery;

import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
package org.elasticsearch.search.query;
package org.elasticsearch.test.errorquery;

import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
Expand Down

0 comments on commit 5f94b03

Please sign in to comment.