Package org.elasticsearch.test.rest.yaml
Class ESClientYamlSuiteTestCase
java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.elasticsearch.test.ESTestCase
org.elasticsearch.test.rest.ESRestTestCase
org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase
Runs a suite of yaml tests shared with all the official Elasticsearch
clients against an elasticsearch cluster.
The suite timeout is extended to account for projects with a large number of tests.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.test.rest.ESRestTestCase
ESRestTestCase.ProductFeature, ESRestTestCase.VersionSensitiveWarningsHandlerNested classes/interfaces inherited from class org.elasticsearch.test.ESTestCase
ESTestCase.DeprecationWarning, ESTestCase.GeohashGenerator, ESTestCase.TestAnalysis, ESTestCase.WithoutSecurityManagerNested classes/interfaces inherited from class org.apache.lucene.tests.util.LuceneTestCase
org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix, org.apache.lucene.tests.util.LuceneTestCase.BadApple, org.apache.lucene.tests.util.LuceneTestCase.Monster, org.apache.lucene.tests.util.LuceneTestCase.Nightly, org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems, org.apache.lucene.tests.util.LuceneTestCase.SuppressFsync, org.apache.lucene.tests.util.LuceneTestCase.SuppressReproduceLine, org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks, org.apache.lucene.tests.util.LuceneTestCase.SuppressTempFileChecks, org.apache.lucene.tests.util.LuceneTestCase.ThrowingConsumer<T>, org.apache.lucene.tests.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.tests.util.LuceneTestCase.Weekly -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty that allows to blacklist some of the REST tests based on a comma separated list of globs e.g.static final StringWe use tests.rest.blacklist in build files to blacklist tests; this property enables a user to add additional blacklisted tests on top of the tests blacklisted in the build.static final StringProperty that allows to control which REST tests get run.Fields inherited from class org.elasticsearch.test.rest.ESRestTestCase
CERTIFICATE_AUTHORITIES, CLIENT_CERT_PATH, CLIENT_KEY_PASSWORD, CLIENT_KEY_PATH, CLIENT_PATH_PREFIX, CLIENT_SOCKET_TIMEOUT, testFeatureService, TRUSTSTORE_PASSWORD, TRUSTSTORE_PATHFields inherited from class org.elasticsearch.test.ESTestCase
checkIndexFailures, DEFAULT_TEST_WORKER_ID, failureAndSuccessEvents, FIPS_SYSPROP, JAVA_TIMEZONE_IDS, JAVA_ZONE_IDS, logger, MIN_PRIVATE_PORT, SAFE_AWAIT_TIMEOUT, TEST_REQUEST_TIMEOUT, TEST_WORKER_SYS_PROPERTY, TEST_WORKER_VM_ID, UNSIGNED_LONG_MAXFields inherited from class org.apache.lucene.tests.util.LuceneTestCase
assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_BADAPPLES, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_THROTTLING, TEST_WEEKLY, VERBOSE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedESClientYamlSuiteTestCase(ClientYamlTestCandidate testCandidate) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCreate parameters for this parameterized test.createParameters(String[] testPaths) Create parameters for this parameterized test.createParameters(String[] testPaths, Map<String, Object> yamlParameters) Create parameters for this parameterized test.createParameters(org.elasticsearch.xcontent.NamedXContentRegistry executeableSectionRegistry) Create parameters for this parameterized test.createParameters(org.elasticsearch.xcontent.NamedXContentRegistry executeableSectionRegistry, String[] testPaths) Create parameters for this parameterized test.createParameters(org.elasticsearch.xcontent.NamedXContentRegistry executeableSectionRegistry, String[] testPaths, Map<String, ?> yamlParameters) Create parameters for this parameterized test.Deprecated.protected ClientYamlTestExecutionContextcreateRestTestExecutionContext(ClientYamlTestCandidate clientYamlTestCandidate, ClientYamlTestClient clientYamlTestClient, Set<String> nodesVersions, TestFeatureService testFeatureService, Set<String> osSet) Create the test execution context.protected ClientYamlTestExecutionContextprotected final RestClientBuilderSniff the cluster for host metadata and return aRestClientBuilderfor a client with that metadata.voidprotected ClientYamlTestClientinitClientYamlTestClient(ClientYamlSuiteRestSpec restSpec, RestClient restClient, List<org.apache.http.HttpHost> hosts) protected booleanprotected booleanvoidtest()Methods inherited from class org.elasticsearch.test.rest.ESRestTestCase
additionalTestOnlyHistoricalFeatures, addXContentBody, adminClient, aliasExists, aliasExists, assertAcknowledged, assertDocCount, assertEmptyTranslog, assertNoFileBasedRecovery, assertOK, assertOKAndConsume, assertOKAndCreateObjectPath, assertResultMap, assertResultMap, assertResultMap, basicAuthHeaderValue, buildClient, buildHttpHost, cleanUpCluster, client, closeClients, closeIndex, clusterHasCapability, clusterHasCapability, clusterHasFeature, clusterHasFeature, configureClient, createIndex, createIndex, createIndex, createIndex, createIndex, createIndex, createIndex, createSnapshot, createSnapshot, createTestFeatureService, deleteAllNodeShutdownMetadata, deleteIndex, deleteIndex, deleteRepository, deleteSnapshot, deleteSnapshot, doConfigureClient, ensureGreen, ensureHealth, ensureHealth, ensureHealth, ensureHealth, ensureNoInitializingShards, ensurePeerRecoveryRetentionLeasesRenewedAndSynced, entityAsList, entityAsMap, entityAsMap, expectSoftDeletesWarning, expectVersionSpecificWarnings, expectWarnings, fieldCaps, fieldCaps, flush, getAlias, getAsMap, getAsMap, getAsOrderedMap, getCachedNodesVersions, getClusterHosts, getClusterStateFeatures, getDataStreamBackingIndexNames, getEnsureGreenTimeout, getIndexMapping, getIndexMappingAsMap, getIndexSettings, getIndexSettingsAsMap, getNodesInfo, getProtocol, getResultMatcher, getResultMatcher, getTestReadinessPorts, getTestRestCluster, getTransportVersionWithFallback, has, hasXPack, ignoreSystemIndexAccessWarnings, indexExists, initClient, isNotFoundResponseException, isSyntheticSourceConfiguredInMapping, isSyntheticSourceConfiguredInTemplate, isXPackTemplate, minimumIndexVersion, minimumTransportVersion, newXContentRequest, openIndex, parseClusterHosts, parseLegacyVersion, preserveAutoFollowPatternsUponCompletion, preserveClusterSettings, preserveClusterUponCompletion, preserveDataStreamsUponCompletion, preserveILMPoliciesUponCompletion, preserveILMPolicyIds, preserveIndicesUponCompletion, preserveReposUponCompletion, preserveRollupJobsUponCompletion, preserveSearchableSnapshotsIndicesUponCompletion, preserveSecurityIndicesUponCompletion, preserveSLMPoliciesUponCompletion, preserveSnapshotsUponCompletion, preserveTemplatesUponCompletion, readVersionsFromNodesInfo, refresh, refresh, refreshAllIndices, registerRepository, registerRepository, resetFeatureStates, responseAsBytes, responseAsMap, responseAsOrderedMap, responseAsParser, restAdminSettings, restClientSettings, restoreSnapshot, setIgnoredErrorResponseCodes, testFeatureServiceInitialized, updateClusterSettings, updateClusterSettings, updateIndexSettings, useIgnoreMultipleMatchingTemplatesWarningsHandler, waitForActiveLicense, waitForPendingTasks, waitForPendingTasks, wipeAllIndices, wipeAllIndices, wipeDataStreams, wipeSearchableSnapshotsIndices, wipeSnapshotsMethods inherited from class org.elasticsearch.test.ESTestCase
after, afterIfFailed, afterIfSuccessful, allBreakersMemoryReleased, asInstanceOf, assertArrayEquals, assertBusy, assertBusy, assertCriticalWarnings, assertEquals, assertLeakDetected, assertSettingDeprecationsAndWarnings, assertThat, assertThat, assertWarnings, assertWarnings, before, between, buildEnvSettings, buildNewFakeTransportAddress, captureLoggingLevel, checkStaticState, compatibleMediaType, copyInstance, copyNamedWriteable, copyNamedWriteable, copyWriteable, copyWriteable, createDefaultIndexAnalyzers, createParser, createParser, createParser, createParser, createParser, createParser, createParserWithCompatibilityFor, createTestAnalysis, createTestAnalysis, createTestAnalysis, createThreadPool, enableBigArraysReleasedCheck, enableWarningsCheck, ensureAllContextsReleased, ensureAllSearchContextsReleased, ensureCheckIndexPassed, ensureNoWarnings, ensureSupportedLocale, expectThrows, expectThrows, fail, fail, filteredWarnings, flushThreadPoolExecutor, frequently, generateRandomStringArray, generateRandomStringArray, getDataPath, getPortRange, getResourceDataPath, getSuiteFailureMarker, getTestTransportPlugin, getTestTransportType, getWorkerBasePort, indexSettings, indexSettings, inFipsJvm, initTestSeed, isTurkishLocale, iterations, maybeRestoreClassSecurityManager, maybeSet, maybeStashClassSecurityManager, mockScript, newEnvironment, newEnvironment, newLimitedBreaker, newNodeEnvironment, newNodeEnvironment, parserConfig, randomAlphanumericOfLength, randomAlphaOfLength, randomAlphaOfLengthBetween, randomAlphaOfLengthOrNull, randomArray, randomArray, randomBigInteger, randomBoolean, randomByte, randomByteArrayOfLength, randomByteBetween, randomBytesBetween, randomByteSizeValue, randomBytesReference, randomCompatibleMediaType, randomDateFormatterPattern, randomDouble, randomDoubleBetween, randomDoubles, randomDoubles, randomExecutor, randomFloat, randomFloatBetween, randomFloatOrNull, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomGeohash, randomIdentifier, randomInstantBetween, randomInt, randomInt, randomIntBetween, randomIntOrNull, randomInts, randomInts, randomIp, randomList, randomList, randomLong, randomLongBetween, randomLongOrNull, randomLongs, randomLongs, randomMap, randomMillisUpToYear9999, randomNegativeInt, randomNonEmptySubsetOf, randomNonNegativeByte, randomNonNegativeInt, randomNonNegativeIntOrNull, randomNonNegativeLong, randomNonNegativeLongOrNull, randomOptionalBoolean, randomPositiveTimeValue, randomRealisticUnicodeOfCodepointLength, randomRealisticUnicodeOfCodepointLengthBetween, randomRealisticUnicodeOfLength, randomRealisticUnicodeOfLengthBetween, randomSecretKey, randomSecureStringOfLength, randomSet, randomShort, randomSubsetOf, randomSubsetOf, randomSubsetOf, randomTimeValue, randomTimeValue, randomTimeValue, randomTimeZone, randomUnicodeOfCodepointLength, randomUnicodeOfCodepointLengthBetween, randomUnicodeOfLength, randomUnicodeOfLengthBetween, randomUnique, randomUnsignedLongBetween, randomUUID, randomValueOtherThan, randomValueOtherThanMany, randomVendorType, randomZone, removeHeaderWarningAppender, resetCheckIndexStatus, resetPortCounter, restoreContentType, restoreFileSystem, restoreLoggingLevel, runInParallel, safeAcquire, safeAcquire, safeAwait, safeAwait, safeAwait, safeAwait, safeAwait, safeAwaitAndUnwrapFailure, safeAwaitFailure, safeAwaitFailure, safeAwaitFailure, safeAwaitFailure, safeExecute, safeGet, safeGet, safeSleep, safeSleep, scaledRandomIntBetween, secureRandom, secureRandom, secureRandomFips, secureRandomFips, secureRandomNonFips, secureRandomNonFips, setContentType, setFileSystem, setHeaderWarningAppender, settings, shuffledList, shuffleMap, shuffleXContent, shuffleXContent, skipTestWaitingForLuceneFix, spinForAtLeastNMilliseconds, spinForAtLeastOneMillisecond, startInParallel, terminate, terminate, tmpPaths, toShuffledXContent, waitUntil, waitUntil, writableRegistry, xContentRegistryMethods inherited from class org.apache.lucene.tests.util.LuceneTestCase
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertDoubleUlpEquals, assertFieldInfosEquals, assertFloatUlpEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, assumeWorkingMMapOnWindows, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getDataInputStream, getJvmForkArguments, getOnlyLeafReader, getTestClass, getTestName, hasWorkingMMapOnWindows, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newSearcher, newSnapshotIndexWriterConfig, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, randomVectorFormat, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, runWithRestrictedPermissions, setIndexWriterMaxDocs, setUp, setupCPUCoreCount, setUpExecutorService, shutdownExecutorService, slowFileExists, tearDown, usually, usually, wrapReaderMethods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
Field Details
-
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_BLACKLIST
Property that allows to blacklist some of the REST tests based on a comma separated list of globs e.g. "-Dtests.rest.blacklist=get/10_basic/*"- See Also:
-
REST_TESTS_BLACKLIST_ADDITIONS
We use tests.rest.blacklist in build files to blacklist tests; this property enables a user to add additional blacklisted tests on top of the tests blacklisted in the build.- See Also:
-
-
Constructor Details
-
ESClientYamlSuiteTestCase
-
-
Method Details
-
initAndResetContext
- Throws:
Exception
-
createRestTestExecutionContext
protected ClientYamlTestExecutionContext createRestTestExecutionContext(ClientYamlTestCandidate clientYamlTestCandidate, ClientYamlTestClient clientYamlTestClient, Set<String> nodesVersions, TestFeatureService testFeatureService, Set<String> osSet) Create the test execution context. Can be overwritten in sub-implementations of the test if the context needs to be modified. -
initClientYamlTestClient
protected ClientYamlTestClient initClientYamlTestClient(ClientYamlSuiteRestSpec restSpec, RestClient restClient, List<org.apache.http.HttpHost> hosts) -
closeClient
- Throws:
IOException
-
createParametersWithLegacyNodeSelectorSupport
@Deprecated public static Iterable<Object[]> createParametersWithLegacyNodeSelectorSupport() throws ExceptionDeprecated.Create parameters for this parameterized test. Enables support for parsing the legacy version-based node_selector format.- Throws:
Exception
-
createParameters
Create parameters for this parameterized test. Uses thelistof executable sections defined inExecutableSection.- Throws:
Exception
-
createParameters
public static Iterable<Object[]> createParameters(org.elasticsearch.xcontent.NamedXContentRegistry executeableSectionRegistry) throws Exception Create parameters for this parameterized test.- Throws:
Exception
-
createParameters
public static Iterable<Object[]> createParameters(String[] testPaths, Map<String, Object> yamlParameters) throws ExceptionCreate parameters for this parameterized test.- Throws:
Exception
-
createParameters
Create parameters for this parameterized test.- Throws:
Exception
-
createParameters
public static Iterable<Object[]> createParameters(org.elasticsearch.xcontent.NamedXContentRegistry executeableSectionRegistry, String[] testPaths) throws Exception Create parameters for this parameterized test.- Parameters:
executeableSectionRegistry- registry of executable sectionstestPaths- list of paths to explicitly search for tests. Ifnullthen include all tests in root path.- Returns:
- list of test candidates.
- Throws:
Exception
-
createParameters
public static Iterable<Object[]> createParameters(org.elasticsearch.xcontent.NamedXContentRegistry executeableSectionRegistry, String[] testPaths, Map<String, ?> yamlParameters) throws ExceptionCreate parameters for this parameterized test.- Parameters:
executeableSectionRegistry- registry of executable sectionstestPaths- list of paths to explicitly search for tests. Ifnullthen include all tests in root path.yamlParameters- map or parameters used within the yaml specs to be replaced at parsing time.- Returns:
- list of test candidates.
- Throws:
Exception
-
getAdminExecutionContext
-
test
- Throws:
IOException
-
skipSetupSections
protected boolean skipSetupSections() -
randomizeContentType
protected boolean randomizeContentType() -
getClientBuilderWithSniffedHosts
Sniff the cluster for host metadata and return aRestClientBuilderfor a client with that metadata.- Throws:
IOException
-
getTestCandidate
-