-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add base class for parameterizing the search based tests
Signed-off-by: Neetika Singhal <neetiks@amazon.com>
- Loading branch information
1 parent
c73f727
commit 6df9416
Showing
6 changed files
with
89 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
...internalClusterTest/java/org/opensearch/search/ConcurrentSegmentSearchCancellationIT.java
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
.../src/internalClusterTest/java/org/opensearch/search/ConcurrentSegmentSearchTimeoutIT.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
test/framework/src/main/java/org/opensearch/test/ParameterizedOpenSearchIntegTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.test; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; | ||
import org.opensearch.common.settings.Settings; | ||
|
||
/** | ||
* Base class for running the tests with parameterization of the dynamic settings | ||
* For any class that wants to use parameterization, use @ParametersFactory to generate | ||
* different params for dynamic settings. Refer SearchCancellationIT for an example. | ||
* Note: this doesn't work for the parameterization of feature flag settings. | ||
*/ | ||
public abstract class ParameterizedOpenSearchIntegTestCase extends OpenSearchIntegTestCase { | ||
|
||
protected final Settings dynamicSettings; | ||
|
||
public ParameterizedOpenSearchIntegTestCase(Settings dynamicSettings) { | ||
this.dynamicSettings = dynamicSettings; | ||
} | ||
|
||
@Before | ||
public void beforeTests() { | ||
ClusterUpdateSettingsResponse clusterUpdateSettingsResponse = client().admin() | ||
.cluster() | ||
.prepareUpdateSettings() | ||
.setPersistentSettings(dynamicSettings) | ||
.get(); | ||
} | ||
|
||
@After | ||
public void afterTests() { | ||
client().admin().cluster().prepareUpdateSettings().setPersistentSettings(Settings.builder().putNull("*")).get(); | ||
} | ||
} |