Class OpenSearchClientYamlSuiteTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.opensearch.test.OpenSearchTestCase
org.opensearch.test.rest.OpenSearchRestTestCase
org.opensearch.test.rest.yaml.OpenSearchClientYamlSuiteTestCase

public abstract class OpenSearchClientYamlSuiteTestCase extends OpenSearchRestTestCase
Runs a suite of yaml tests shared with all the official OpenSearch clients against an opensearch cluster.

The suite timeout is extended to account for projects with a large number of tests.

  • Field Details

    • REST_TESTS_SUITE

      public static final String REST_TESTS_SUITE
      Property that allows to control which REST tests get run. Supports comma separated list of tests or directories that contain tests e.g. -Dtests.rest.suite=index,get,create/10_with_id
      See Also:
    • REST_TESTS_DENYLIST

      public static final String REST_TESTS_DENYLIST
      Property that allows to denylist some of the REST tests based on a comma separated list of globs e.g. "-Dtests.rest.denylist=get/10_basic/*"
      See Also:
    • REST_TESTS_DENYLIST_ADDITIONS

      public static final String REST_TESTS_DENYLIST_ADDITIONS
      We use tests.rest.denylist in build files to denylist tests; this property enables a user to add additional denylisted tests on top of the tests denylisted in the build.
      See Also:
  • Constructor Details

    • OpenSearchClientYamlSuiteTestCase

      protected OpenSearchClientYamlSuiteTestCase(ClientYamlTestCandidate testCandidate)
  • Method Details

    • initializeUseDefaultNumberOfShards

      public static void initializeUseDefaultNumberOfShards()
    • initAndResetContext

      public void initAndResetContext() throws Exception
      Throws:
      Exception
    • initClientYamlTestClient

      protected ClientYamlTestClient initClientYamlTestClient(ClientYamlSuiteRestSpec restSpec, org.opensearch.client.RestClient restClient, List<org.apache.hc.core5.http.HttpHost> hosts, org.opensearch.Version esVersion, org.opensearch.Version clusterManagerVersion)
    • closeClient

      public static void closeClient() throws IOException
      Throws:
      IOException
    • createParameters

      public static Iterable<Object[]> createParameters() throws Exception
      Create parameters for this parameterized test. Uses the list of executable sections defined in ExecutableSection.
      Throws:
      Exception
    • createParameters

      public static Iterable<Object[]> createParameters(org.opensearch.core.xcontent.NamedXContentRegistry executeableSectionRegistry) throws Exception
      Create parameters for this parameterized test.
      Throws:
      Exception
    • getAdminExecutionContext

      protected ClientYamlTestExecutionContext getAdminExecutionContext()
    • getCatNodesVersionClusterManagerRequestOptions

      protected org.opensearch.client.RequestOptions getCatNodesVersionClusterManagerRequestOptions()
    • test

      public void test() throws IOException
      Throws:
      IOException
    • randomizeContentType

      protected boolean randomizeContentType()
    • getClientBuilderWithSniffedHosts

      protected final org.opensearch.client.RestClientBuilder getClientBuilderWithSniffedHosts() throws IOException
      Sniff the cluster for host metadata and return a RestClientBuilder for a client with that metadata.
      Throws:
      IOException