Skip to content

Commit

Permalink
Branched off parametrized tests into static / dynamic settings flavors
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta committed Jan 16, 2024
1 parent 1b37b47 commit 37c6bcf
Show file tree
Hide file tree
Showing 145 changed files with 616 additions and 511 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
import org.opensearch.tasks.TaskInfo;
import org.opensearch.tasks.TaskManager;
import org.opensearch.test.InternalTestCluster;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.TransportException;
import org.opensearch.transport.TransportResponseHandler;
Expand Down Expand Up @@ -99,16 +99,16 @@
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.instanceOf;

public class CancellableTasksIT extends ParameterizedOpenSearchIntegTestCase {
public class CancellableTasksIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

static int idGenerator = 0;
static final Map<TestRequest, CountDownLatch> beforeSendLatches = ConcurrentCollections.newConcurrentMap();
static final Map<TestRequest, CountDownLatch> arrivedLatches = ConcurrentCollections.newConcurrentMap();
static final Map<TestRequest, CountDownLatch> beforeExecuteLatches = ConcurrentCollections.newConcurrentMap();
static final Map<TestRequest, CountDownLatch> completedLatches = ConcurrentCollections.newConcurrentMap();

public CancellableTasksIT(Settings dynamicSettings) {
super(dynamicSettings);
public CancellableTasksIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@

public class GetTermVectorsIT extends AbstractTermVectorsTestCase {

public GetTermVectorsIT(Settings dynamicSettings) {
super(dynamicSettings);
public GetTermVectorsIT(Settings staticSettings) {
super(staticSettings);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
import static org.hamcrest.Matchers.nullValue;

public class MultiTermVectorsIT extends AbstractTermVectorsTestCase {
public MultiTermVectorsIT(Settings dynamicSettings) {
super(dynamicSettings);
public MultiTermVectorsIT(Settings staticSettings) {
super(staticSettings);
}

public void testDuelESLucene() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.FeatureFlags;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;

import java.io.IOException;
import java.util.Arrays;
Expand All @@ -51,11 +51,11 @@
import static org.opensearch.search.SearchService.CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING;
import static org.hamcrest.Matchers.containsString;

public class IndexSortIT extends ParameterizedOpenSearchIntegTestCase {
public class IndexSortIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {
private static final XContentBuilder TEST_MAPPING = createTestMapping();

public IndexSortIT(Settings dynamicSettings) {
super(dynamicSettings);
public IndexSortIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.opensearch.common.util.FeatureFlags;
import org.opensearch.index.query.MatchPhraseQueryBuilder;
import org.opensearch.index.search.MatchQuery.ZeroTermsQuery;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;
import org.junit.Before;

import java.util.ArrayList;
Expand All @@ -55,12 +55,12 @@
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertHitCount;

public class MatchPhraseQueryIT extends ParameterizedOpenSearchIntegTestCase {
public class MatchPhraseQueryIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

private static final String INDEX = "test";

public MatchPhraseQueryIT(Settings dynamicSettings) {
super(dynamicSettings);
public MatchPhraseQueryIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import org.opensearch.search.suggest.phrase.PhraseSuggestionBuilder;
import org.opensearch.search.suggest.term.TermSuggestionBuilder;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;

import java.util.Arrays;
import java.util.Collection;
Expand All @@ -68,10 +68,10 @@
import static org.hamcrest.Matchers.lessThanOrEqualTo;

@OpenSearchIntegTestCase.ClusterScope(minNumDataNodes = 2)
public class SuggestStatsIT extends ParameterizedOpenSearchIntegTestCase {
public class SuggestStatsIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

public SuggestStatsIT(Settings dynamicSettings) {
super(dynamicSettings);
public SuggestStatsIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import org.opensearch.search.aggregations.bucket.histogram.DateHistogramInterval;
import org.opensearch.search.aggregations.bucket.histogram.Histogram;
import org.opensearch.search.aggregations.bucket.histogram.Histogram.Bucket;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;
import org.opensearch.test.hamcrest.OpenSearchAssertions;

import java.time.ZoneId;
Expand All @@ -69,7 +69,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;

public class IndicesRequestCacheIT extends ParameterizedOpenSearchIntegTestCase {
public class IndicesRequestCacheIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {
public IndicesRequestCacheIT(Settings settings) {
super(settings);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
import org.opensearch.search.SearchService;
import org.opensearch.search.sort.SortOrder;
import org.opensearch.test.OpenSearchIntegTestCase.ClusterScope;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;
import org.junit.After;
import org.junit.Before;

Expand Down Expand Up @@ -94,9 +94,9 @@
* Integration tests for InternalCircuitBreakerService
*/
@ClusterScope(scope = TEST, numClientNodes = 0, maxNumDataNodes = 1)
public class CircuitBreakerServiceIT extends ParameterizedOpenSearchIntegTestCase {
public CircuitBreakerServiceIT(Settings dynamicSettings) {
super(dynamicSettings);
public class CircuitBreakerServiceIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {
public CircuitBreakerServiceIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
import org.opensearch.test.InternalSettingsPlugin;
import org.opensearch.test.OpenSearchIntegTestCase.ClusterScope;
import org.opensearch.test.OpenSearchIntegTestCase.Scope;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;

import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -122,7 +122,7 @@

@ClusterScope(scope = Scope.SUITE, numDataNodes = 2, numClientNodes = 0)
@SuppressCodecs("*") // requires custom completion format
public class IndexStatsIT extends ParameterizedOpenSearchIntegTestCase {
public class IndexStatsIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {
public IndexStatsIT(Settings settings) {
super(settings);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.xcontent.MediaTypeRegistry;
import org.opensearch.search.fetch.subphase.FetchSourceContext;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;

import java.io.IOException;
import java.util.Arrays;
Expand All @@ -63,10 +63,10 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;

public class SimpleMgetIT extends ParameterizedOpenSearchIntegTestCase {
public class SimpleMgetIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

public SimpleMgetIT(Settings dynamicSettings) {
super(dynamicSettings);
public SimpleMgetIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.opensearch.plugins.Plugin;
import org.opensearch.search.MockSearchService;
import org.opensearch.test.MockHttpTransport;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;
import org.opensearch.test.TestGeoShapeFieldMapperPlugin;
import org.opensearch.test.store.MockFSIndexStore;
import org.opensearch.test.transport.MockTransportService;
Expand All @@ -38,7 +38,7 @@
import static org.opensearch.search.SearchService.CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING;
import static org.apache.logging.log4j.core.util.Throwables.getRootCause;

public class ScriptCacheIT extends ParameterizedOpenSearchIntegTestCase {
public class ScriptCacheIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {
public ScriptCacheIT(Settings settings) {
super(settings);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
import org.opensearch.search.lookup.LeafFieldsLookup;
import org.opensearch.tasks.TaskInfo;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;
import org.opensearch.transport.TransportException;
import org.junit.After;

Expand Down Expand Up @@ -91,7 +91,7 @@
import static org.hamcrest.Matchers.notNullValue;

@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE)
public class SearchCancellationIT extends ParameterizedOpenSearchIntegTestCase {
public class SearchCancellationIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

private TimeValue requestCancellationTimeout = TimeValue.timeValueSeconds(1);
private TimeValue clusterCancellationTimeout = TimeValue.timeValueMillis(1500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import org.opensearch.script.Script;
import org.opensearch.script.ScriptType;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;

import java.util.Arrays;
import java.util.Collection;
Expand All @@ -59,7 +59,7 @@
import static org.opensearch.search.SearchTimeoutIT.ScriptedTimeoutPlugin.SCRIPT_NAME;

@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE)
public class SearchTimeoutIT extends ParameterizedOpenSearchIntegTestCase {
public class SearchTimeoutIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {
public SearchTimeoutIT(Settings settings) {
super(settings);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.FeatureFlags;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;

import java.util.Arrays;
import java.util.Collection;
Expand All @@ -52,10 +52,10 @@
import static org.hamcrest.Matchers.equalTo;

@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE)
public class SearchWithRejectionsIT extends ParameterizedOpenSearchIntegTestCase {
public class SearchWithRejectionsIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

public SearchWithRejectionsIT(Settings dynamicSettings) {
super(dynamicSettings);
public SearchWithRejectionsIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.util.FeatureFlags;
import org.opensearch.test.OpenSearchIntegTestCase.ClusterScope;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;

import java.util.Arrays;
import java.util.Collection;
Expand All @@ -53,7 +53,7 @@
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertNoFailures;

@ClusterScope(scope = SUITE)
public class StressSearchServiceReaperIT extends ParameterizedOpenSearchIntegTestCase {
public class StressSearchServiceReaperIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {
public StressSearchServiceReaperIT(Settings settings) {
super(settings);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.opensearch.search.aggregations.bucket.terms.TermsAggregatorFactory;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -62,7 +62,7 @@
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertSearchResponse;

@OpenSearchIntegTestCase.SuiteScopeTestCase
public class AggregationsIntegrationIT extends ParameterizedOpenSearchIntegTestCase {
public class AggregationsIntegrationIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

static int numDocs;

Expand All @@ -71,8 +71,8 @@ public class AggregationsIntegrationIT extends ParameterizedOpenSearchIntegTestC
+ LARGE_STRING.length()
+ "] used in the request has exceeded the allowed maximum";

public AggregationsIntegrationIT(Settings dynamicSettings) {
super(dynamicSettings);
public AggregationsIntegrationIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.opensearch.search.aggregations.bucket.histogram.Histogram;
import org.opensearch.search.aggregations.bucket.missing.Missing;
import org.opensearch.search.aggregations.bucket.terms.Terms;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;
import org.hamcrest.Matchers;

import java.util.Arrays;
Expand All @@ -61,10 +61,10 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.core.IsNull.notNullValue;

public class CombiIT extends ParameterizedOpenSearchIntegTestCase {
public class CombiIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

public CombiIT(Settings dynamicSettings) {
super(dynamicSettings);
public CombiIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
import org.opensearch.search.aggregations.bucket.terms.Terms;
import org.opensearch.search.aggregations.bucket.terms.TermsAggregatorFactory;
import org.opensearch.search.aggregations.metrics.Sum;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;
import org.junit.After;
import org.junit.Before;

Expand Down Expand Up @@ -94,10 +94,10 @@
* Additional tests that aim at testing more complex aggregation trees on larger random datasets, so that things like
* the growth of dynamic arrays is tested.
*/
public class EquivalenceIT extends ParameterizedOpenSearchIntegTestCase {
public class EquivalenceIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

public EquivalenceIT(Settings dynamicSettings) {
super(dynamicSettings);
public EquivalenceIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.opensearch.search.aggregations.bucket.terms.Terms;
import org.opensearch.search.aggregations.metrics.Sum;
import org.opensearch.search.aggregations.pipeline.InternalBucketMetricValue;
import org.opensearch.test.ParameterizedOpenSearchIntegTestCase;
import org.opensearch.test.ParameterizedStaticSettingsOpenSearchIntegTestCase;

import java.util.Arrays;
import java.util.Collection;
Expand All @@ -57,10 +57,10 @@
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertSearchResponse;

public class MetadataIT extends ParameterizedOpenSearchIntegTestCase {
public class MetadataIT extends ParameterizedStaticSettingsOpenSearchIntegTestCase {

public MetadataIT(Settings dynamicSettings) {
super(dynamicSettings);
public MetadataIT(Settings staticSettings) {
super(staticSettings);
}

@ParametersFactory
Expand Down
Loading

0 comments on commit 37c6bcf

Please sign in to comment.