From 127015e54c3820df9e11877199b3f14bfe2ce0a3 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Thu, 19 Aug 2021 10:09:46 +0200 Subject: [PATCH] [Rest Api Compatibility] Clean up blocklist (#76179) v7compatibilityNotSupportedTests was introduced to make it easier to track tests that have been identified as not needing compatible changes and those that still need to be checked. We have checked all tests now and the separate list is no longer needed. relates #51816 relates #73912 --- modules/analysis-common/build.gradle | 18 ++-- modules/reindex/build.gradle | 12 +-- plugins/analysis-icu/build.gradle | 12 +-- rest-api-spec/build.gradle | 118 +++++++++++++-------------- x-pack/plugin/build.gradle | 86 ++++++++++--------- 5 files changed, 113 insertions(+), 133 deletions(-) diff --git a/modules/analysis-common/build.gradle b/modules/analysis-common/build.gradle index a174356eaa533..02e715c03bca9 100644 --- a/modules/analysis-common/build.gradle +++ b/modules/analysis-common/build.gradle @@ -25,16 +25,12 @@ dependencies { compileOnly project(':modules:lang-painless') } -def v7compatibilityNotSupportedTests = { - return [ - //marked as not needing compatible api - 'indices.analyze/10_analyze/htmlStrip_deprecated', // Cleanup versioned deprecations in analysis #41560 - 'analysis-common/40_token_filters/delimited_payload_filter_error', //Remove preconfigured delimited_payload_filter #43686 - 'analysis-common/20_analyzers/standard_html_strip', // Cleanup versioned deprecations in analysis #41560 - 'search.query/50_queries_with_synonyms/Test common terms query with stacked tokens', // #42654 - `common` query throws an exception - ] -} - tasks.named("yamlRestCompatTest").configure { - systemProperty 'tests.rest.blacklist', v7compatibilityNotSupportedTests().join(',') + systemProperty 'tests.rest.blacklist', [ + //marked as not needing compatible api + 'indices.analyze/10_analyze/htmlStrip_deprecated', // Cleanup versioned deprecations in analysis #41560 + 'analysis-common/40_token_filters/delimited_payload_filter_error', //Remove preconfigured delimited_payload_filter #43686 + 'analysis-common/20_analyzers/standard_html_strip', // Cleanup versioned deprecations in analysis #41560 + 'search.query/50_queries_with_synonyms/Test common terms query with stacked tokens', // #42654 - `common` query throws an exception + ].join(',') } diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index dc0364218a8f5..277fee4aa6580 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -159,15 +159,11 @@ tasks.named("transformV7RestTests").configure({ task -> task.addAllowedWarningRegex("\\[types removal\\].*") }) -def v7compatibilityNotSupportedTests = { - return [ - 'reindex/20_validation/reindex without source gives useful error message', // exception with a type. Not much benefit adding _doc there. - 'update_by_query/20_validation/update_by_query without source gives useful error message' // exception with a type. Not much benefit adding _doc there. - ] -} - tasks.named("yamlRestCompatTest").configure { - systemProperty 'tests.rest.blacklist', v7compatibilityNotSupportedTests().join(',') + systemProperty 'tests.rest.blacklist', [ + 'reindex/20_validation/reindex without source gives useful error message', // exception with a type. Not much benefit adding _doc there. + 'update_by_query/20_validation/update_by_query without source gives useful error message' // exception with a type. Not much benefit adding _doc there. + ].join(',') } tasks.named('splitPackagesAudit').configure { diff --git a/plugins/analysis-icu/build.gradle b/plugins/analysis-icu/build.gradle index 72425fe1c1784..e2926ae0cf7a4 100644 --- a/plugins/analysis-icu/build.gradle +++ b/plugins/analysis-icu/build.gradle @@ -36,15 +36,11 @@ restResources { tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } -def v7compatibilityNotSupportedTests = { - return [ - //marked as not needing compatible api - 'analysis_icu/10_basic/Normalization with deprecated unicodeSetFilter' // Cleanup versioned deprecations in analysis #41560 - ] -} - tasks.named("yamlRestCompatTest").configure { - systemProperty 'tests.rest.blacklist', v7compatibilityNotSupportedTests().join(',') + systemProperty 'tests.rest.blacklist', [ + //marked as not needing compatible api + 'analysis_icu/10_basic/Normalization with deprecated unicodeSetFilter' // Cleanup versioned deprecations in analysis #41560 + ].join(',') } tasks.named('splitPackagesAudit').configure { diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index 50202cc02fb4c..a126408b5dbeb 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -28,72 +28,68 @@ testClusters.all { tasks.named("test").configure { enabled = false } tasks.named("jarHell").configure { enabled = false } -def v7compatibilityNotSupportedTests = { - return [ - // Cat API are meant to be consumed by humans, so will not be supported by Compatible REST API - 'cat*/*/*', - // type information about the type is removed and not passed down. The logic to check for this is also removed. - 'delete/70_mix_typeless_typeful/DELETE with typeless API on an index that has types', - // WILL NOT BE FIXED - failing due to not recognising missing type (the type path param is ignored) - 'get/100_mix_typeless_typeful/GET with typeless API on an index that has types', - // type information about the type is removed and not passed down. The logic to check for this is also removed. - 'indices.create/20_mix_typeless_typeful/Implicitly create a typed index while there is a typeless template', - 'indices.create/20_mix_typeless_typeful/Implicitly create a typeless index while there is a typed template', - // - // This test returns test_index.mappings:{} when {} was expected. difference between 20_missing_field and 21_missing_field_with_types? - 'indices.get_field_mapping/21_missing_field_with_types/Return empty object if field doesn\'t exist, but type and index do', - // The information about the type is not present in the index. hence it cannot know if the type exist or not. - 'indices.get_field_mapping/30_missing_type/Raise 404 when type doesn\'t exist', - // The information about the type is not present in the index. hence it cannot know if the type exist or not. - 'indices.get_mapping/20_missing_type/Existent and non-existent type returns 404 and the existing type', - 'indices.get_mapping/20_missing_type/Existent and non-existent types returns 404 and the existing type', - 'indices.get_mapping/20_missing_type/No type matching pattern returns 404', - 'indices.get_mapping/20_missing_type/Non-existent type returns 404', - 'indices.get_mapping/20_missing_type/Type missing when no types exist', - // - // The information about the type is not present in the index. hence it cannot know if the type was already used or not - 'indices.put_mapping/20_mix_typeless_typeful/PUT mapping with _doc on an index that has types', - 'indices.put_mapping/20_mix_typeless_typeful/PUT mapping with typeless API on an index that has types', - // there is a small distinction between empty mappings and no mappings at all. The code to implement this test was refactored #54003 - // field search on _type field- not implementing. The data for _type is considered incorrect in this search - 'search/160_exists_query/Test exists query on _type field', - //type information is not stored, hence the the index will be found - 'termvectors/50_mix_typeless_typeful/Term vectors with typeless API on an index that has types', - // mget - these use cases are no longer valid, because we always default to _doc. - // This mean test cases where there is assertion on not finging by type won't work - 'mget/11_default_index_type/Default index/type', - 'mget/16_basic_with_types/Basic multi-get', - // asserting about type not found won't work as we ignore the type information - 'explain/40_mix_typeless_typeful/Explain with typeless API on an index that has types', - // translog settings removal is not supported under compatible api - 'indices.stats/20_translog/Translog retention settings are deprecated', - 'indices.stats/20_translog/Translog retention without soft_deletes', - 'indices.stats/20_translog/Translog stats on closed indices without soft-deletes', - - // upgrade api will only get a dummy endpoint returning an exception suggesting to use _reindex - 'indices.upgrade/*/*', - - 'search.aggregation/20_terms/*profiler*', // The profiler results aren't backwards compatible. - 'search.aggregation/370_doc_count_field/Test filters agg with doc_count', // Uses profiler for assertions which is not backwards compatible - - 'indices.create/10_basic/Create index without soft deletes', //Make soft-deletes mandatory in 8.0 #51122 - settings changes are note supported in Rest Api compatibility - - 'field_caps/30_filter/Field caps with index filter', //behaviour change after #63692 4digits dates are parsed as epoch and in quotes as year - - 'indices.forcemerge/10_basic/Check deprecation warning when incompatible only_expunge_deletes and max_num_segments values are both set', //#44761 bug fix, - - 'search/340_type_query/type query', //#47207 type query throws exception in compatible mode - 'search.aggregation/200_top_hits_metric/top_hits aggregation with sequence numbers', // #42809 the use nested path and filter sort throws an exception - 'search/310_match_bool_prefix/multi_match multiple fields with cutoff_frequency throws exception', //#42654 cutoff_frequency, common terms are not supported. Throwing an exception - - ] -} tasks.named("yamlRestCompatTest").configure { onlyIf { // Skip these tests on Windows since the blacklist exceeds Windows CLI limits OS.current() != OS.WINDOWS } - systemProperty 'tests.rest.blacklist', v7compatibilityNotSupportedTests().join(',') + systemProperty 'tests.rest.blacklist', [ + // Cat API are meant to be consumed by humans, so will not be supported by Compatible REST API + 'cat*/*/*', + // type information about the type is removed and not passed down. The logic to check for this is also removed. + 'delete/70_mix_typeless_typeful/DELETE with typeless API on an index that has types', + // WILL NOT BE FIXED - failing due to not recognising missing type (the type path param is ignored) + 'get/100_mix_typeless_typeful/GET with typeless API on an index that has types', + // type information about the type is removed and not passed down. The logic to check for this is also removed. + 'indices.create/20_mix_typeless_typeful/Implicitly create a typed index while there is a typeless template', + 'indices.create/20_mix_typeless_typeful/Implicitly create a typeless index while there is a typed template', + // + // This test returns test_index.mappings:{} when {} was expected. difference between 20_missing_field and 21_missing_field_with_types? + 'indices.get_field_mapping/21_missing_field_with_types/Return empty object if field doesn\'t exist, but type and index do', + // The information about the type is not present in the index. hence it cannot know if the type exist or not. + 'indices.get_field_mapping/30_missing_type/Raise 404 when type doesn\'t exist', + // The information about the type is not present in the index. hence it cannot know if the type exist or not. + 'indices.get_mapping/20_missing_type/Existent and non-existent type returns 404 and the existing type', + 'indices.get_mapping/20_missing_type/Existent and non-existent types returns 404 and the existing type', + 'indices.get_mapping/20_missing_type/No type matching pattern returns 404', + 'indices.get_mapping/20_missing_type/Non-existent type returns 404', + 'indices.get_mapping/20_missing_type/Type missing when no types exist', + // + // The information about the type is not present in the index. hence it cannot know if the type was already used or not + 'indices.put_mapping/20_mix_typeless_typeful/PUT mapping with _doc on an index that has types', + 'indices.put_mapping/20_mix_typeless_typeful/PUT mapping with typeless API on an index that has types', + // there is a small distinction between empty mappings and no mappings at all. The code to implement this test was refactored #54003 + // field search on _type field- not implementing. The data for _type is considered incorrect in this search + 'search/160_exists_query/Test exists query on _type field', + //type information is not stored, hence the the index will be found + 'termvectors/50_mix_typeless_typeful/Term vectors with typeless API on an index that has types', + // mget - these use cases are no longer valid, because we always default to _doc. + // This mean test cases where there is assertion on not finging by type won't work + 'mget/11_default_index_type/Default index/type', + 'mget/16_basic_with_types/Basic multi-get', + // asserting about type not found won't work as we ignore the type information + 'explain/40_mix_typeless_typeful/Explain with typeless API on an index that has types', + // translog settings removal is not supported under compatible api + 'indices.stats/20_translog/Translog retention settings are deprecated', + 'indices.stats/20_translog/Translog retention without soft_deletes', + 'indices.stats/20_translog/Translog stats on closed indices without soft-deletes', + + // upgrade api will only get a dummy endpoint returning an exception suggesting to use _reindex + 'indices.upgrade/*/*', + + 'search.aggregation/20_terms/*profiler*', // The profiler results aren't backwards compatible. + 'search.aggregation/370_doc_count_field/Test filters agg with doc_count', // Uses profiler for assertions which is not backwards compatible + + 'indices.create/10_basic/Create index without soft deletes', //Make soft-deletes mandatory in 8.0 #51122 - settings changes are note supported in Rest Api compatibility + + 'field_caps/30_filter/Field caps with index filter', //behaviour change after #63692 4digits dates are parsed as epoch and in quotes as year + + 'indices.forcemerge/10_basic/Check deprecation warning when incompatible only_expunge_deletes and max_num_segments values are both set', //#44761 bug fix, + + 'search/340_type_query/type query', //#47207 type query throws exception in compatible mode + 'search.aggregation/200_top_hits_metric/top_hits aggregation with sequence numbers', // #42809 the use nested path and filter sort throws an exception + 'search/310_match_bool_prefix/multi_match multiple fields with cutoff_frequency throws exception', //#42654 cutoff_frequency, common terms are not supported. Throwing an exception + ].join(',') } tasks.named("transformV7RestTests").configure({ task -> diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index af0f1372d75a6..b5ebc0e18c854 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -114,52 +114,48 @@ tasks.named("transformV7RestTests").configure({ task -> task.replaceKeyInDo("ssl.certificates", "xpack-ssl.certificates", "Test get SSL certificates") task.addAllowedWarningRegexForTest(".*_xpack/ssl.* is deprecated.*", "Test get SSL certificates") }) -def v7compatibilityNotSupportedTests = { - return [ - // to support it, it would require to almost revert back the #48725 and complicate the code - 'vectors/10_dense_vector_basic/Deprecated function signature', - // not going to be supported - 'vectors/30_sparse_vector_basic/Cosine Similarity', - 'vectors/30_sparse_vector_basic/Deprecated function signature', - 'vectors/30_sparse_vector_basic/Dot Product', - 'vectors/35_sparse_vector_l1l2/L1 norm', - 'vectors/35_sparse_vector_l1l2/L2 norm', - 'vectors/40_sparse_vector_special_cases/Dimensions can be sorted differently', - 'vectors/40_sparse_vector_special_cases/Documents missing a vector field', - 'vectors/40_sparse_vector_special_cases/Query vector has different dimensions from documents\' vectors', - 'vectors/40_sparse_vector_special_cases/Sparse vectors should error with dense vector functions', - 'vectors/40_sparse_vector_special_cases/Vectors of different dimensions and data types', - // the test uses sparse vector - not supported - 'vectors/50_vector_stats/Usage stats on vector fields', - - // put role request with a term lookup (deprecated) and type. Requires validation in REST layer - 'roles/30_prohibited_role_query/Test use prohibited query inside role query', - //removing undocumented functionality - 'ml/jobs_crud/Test create job with delimited format', - // behaviour change #44752 - not allowing to update datafeed job_id - 'ml/datafeeds_crud/Test update datafeed to point to missing job', - 'ml/datafeeds_crud/Test update datafeed to point to different job', - 'ml/datafeeds_crud/Test update datafeed to point to job already attached to another datafeed', - //rollup was an experimental feature - //https://github.com/elastic/elasticsearch/pull/41227. - 'rollup/delete_job/Test basic delete_job', - 'rollup/delete_job/Test delete job twice', - 'rollup/delete_job/Test delete running job', - 'rollup/get_jobs/Test basic get_jobs', - 'rollup/put_job/Test basic put_job', - //https://github.com/elastic/elasticsearch/pull/41502 - 'rollup/start_job/Test start job twice', - 'service_accounts/10_basic/Test service account tokens', // https://github.com/elastic/elasticsearch/pull/75200 - - // a type field was added to cat.ml_trained_models #73660, this is a backwards compatible change. - // still this is a cat api, and we don't support them with rest api compatibility. (the test would be very hard to transform too) - 'ml/trained_model_cat_apis/Test cat trained models', - 'service_accounts/10_basic/Test get service accounts', //#76449, will remove upon backport - ] -} - tasks.named("yamlRestCompatTest").configure { - systemProperty 'tests.rest.blacklist', v7compatibilityNotSupportedTests().join(',') + systemProperty 'tests.rest.blacklist', [ + // to support it, it would require to almost revert back the #48725 and complicate the code + 'vectors/10_dense_vector_basic/Deprecated function signature', + // not going to be supported + 'vectors/30_sparse_vector_basic/Cosine Similarity', + 'vectors/30_sparse_vector_basic/Deprecated function signature', + 'vectors/30_sparse_vector_basic/Dot Product', + 'vectors/35_sparse_vector_l1l2/L1 norm', + 'vectors/35_sparse_vector_l1l2/L2 norm', + 'vectors/40_sparse_vector_special_cases/Dimensions can be sorted differently', + 'vectors/40_sparse_vector_special_cases/Documents missing a vector field', + 'vectors/40_sparse_vector_special_cases/Query vector has different dimensions from documents\' vectors', + 'vectors/40_sparse_vector_special_cases/Sparse vectors should error with dense vector functions', + 'vectors/40_sparse_vector_special_cases/Vectors of different dimensions and data types', + // the test uses sparse vector - not supported + 'vectors/50_vector_stats/Usage stats on vector fields', + + // put role request with a term lookup (deprecated) and type. Requires validation in REST layer + 'roles/30_prohibited_role_query/Test use prohibited query inside role query', + //removing undocumented functionality + 'ml/jobs_crud/Test create job with delimited format', + // behaviour change #44752 - not allowing to update datafeed job_id + 'ml/datafeeds_crud/Test update datafeed to point to missing job', + 'ml/datafeeds_crud/Test update datafeed to point to different job', + 'ml/datafeeds_crud/Test update datafeed to point to job already attached to another datafeed', + //rollup was an experimental feature + //https://github.com/elastic/elasticsearch/pull/41227. + 'rollup/delete_job/Test basic delete_job', + 'rollup/delete_job/Test delete job twice', + 'rollup/delete_job/Test delete running job', + 'rollup/get_jobs/Test basic get_jobs', + 'rollup/put_job/Test basic put_job', + //https://github.com/elastic/elasticsearch/pull/41502 + 'rollup/start_job/Test start job twice', + 'service_accounts/10_basic/Test service account tokens', // https://github.com/elastic/elasticsearch/pull/75200 + + // a type field was added to cat.ml_trained_models #73660, this is a backwards compatible change. + // still this is a cat api, and we don't support them with rest api compatibility. (the test would be very hard to transform too) + 'ml/trained_model_cat_apis/Test cat trained models', + 'service_accounts/10_basic/Test get service accounts', //#76449, will remove upon backport + ].join(',') dependsOn "copyExtraResources" }