-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test suite for the plugin (#42)
Signed-off-by: Andriy Redko <[email protected]> (cherry picked from commit 63c0cd5) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c759b38
commit af1cf01
Showing
2 changed files
with
80 additions
and
1 deletion.
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
38 changes: 38 additions & 0 deletions
38
src/integrationTest/java/org/opensearch/index/codec/rest/CreateIndexWithCodecIT.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,38 @@ | ||
/* | ||
* 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.index.codec.rest; | ||
|
||
import org.opensearch.cluster.metadata.IndexMetadata; | ||
import org.opensearch.common.settings.Settings; | ||
import org.opensearch.test.rest.OpenSearchRestTestCase; | ||
|
||
import java.io.IOException; | ||
|
||
import static org.opensearch.index.codec.customcodecs.CustomCodecService.ZSTD_CODEC; | ||
import static org.opensearch.index.codec.customcodecs.CustomCodecService.ZSTD_NO_DICT_CODEC; | ||
|
||
public class CreateIndexWithCodecIT extends OpenSearchRestTestCase { | ||
|
||
public void testCreateIndexWithZstdCodec() throws IOException { | ||
final String index = "test-index"; | ||
|
||
// creating index | ||
createIndex( | ||
index, | ||
Settings.builder() | ||
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) | ||
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) | ||
.put("index.codec", randomFrom(ZSTD_CODEC, ZSTD_NO_DICT_CODEC)) | ||
.put("index.codec.compression_level", randomIntBetween(1, 6)) | ||
.build() | ||
); | ||
|
||
ensureGreen(index); | ||
} | ||
} |