Commit graph

2398 commits

Author SHA1 Message Date
Tanguy Leroux
2915b15384
[7.17] Revert YAML tests changes related to index sorting (#93753) (#93781)
Backport of #93753
2023-02-14 08:14:28 -05:00
Iraklis Psaroudakis
9f72a7aa96
Mute test (#93628)
Backport of https://github.com/elastic/elasticsearch/pull/93623
2023-02-09 04:58:55 -05:00
Joe Gallo
eab61d2150 Fix _bulk api dynamic_templates and explicit op_type (#92687) 2023-01-05 09:57:55 -05:00
Mark Vieira
47c6fd34da
[7.17] Add JUnit rule based integration test cluster orchestration framework… (#92517)
This commit adds a new test framework for configuring and orchestrating
test clusters for both Java and YAML REST testing. This will eventually
replace the existing "test-clusters" Gradle plugin and the build-time
cluster orchestration.
2022-12-22 17:48:07 -08:00
Albert Zaharovits
3798d846a7
[TEST] Adjust test for single wildcard when wildcards are not expanded (#91309)
In #91231 we concluded that a request that
contains a single wildcard but that also sets expand_wildcards
to none should throw a "not found" exception if
ignore_unavailable is false.

This PR adjusts the 7.x test in order to account for that,
in order to pass the rest-compatibility tests in 8.*.

Related: #91231
2022-11-04 13:38:35 +02:00
Przemyslaw Gomulka
994c3c6cf6
[7.17] [Testing] Enable bwc and fix sorting for 500_date_range (#90681) (#90689)
the #90458 has been backported to all branches so the bwc testing can be enable for this tests were incorrectly relying on sort order. Added sort to make it deterministic

closes #90668
2022-10-06 11:05:59 +02:00
Przemyslaw Gomulka
75df484f07
[7.17] Fix date rounding for date math parsing backport(#90458) (#90635)
* Fix date rounding for date math parsing (#90458)

in #89693 the rounding logic was only applied when a field was present on a pattern. This is incorrect as for dates like "2020" we want to default to "2020-01-01T23:59:59.999..." when rounding is enabled.

This commit always applies monthOfYear or dayofMonth defaulting (when rounding enabled) except when the dayOfYear is set
closes #90187
backport(#90458)
(cherry picked from commit 3f3a95e2dc)
2022-10-04 14:10:31 +02:00
David Turner
0ef2054cf4
Add YAML spec docs about matching errors (#89370) (#89460)
It's not obvious that a YAML test with a `catch` stanza also permits
`match` blocks to assert things about the structure of the error
response, but this structure may be an important part of the API spec.
This commit adds this info to the docs about YAML tests.
2022-08-18 22:52:05 +09:30
Seth Michael Larson
b61e351152
[7.17] Add pagination parameters to API spec and docs for 'snapshot.get' API (#88962) 2022-07-30 06:24:03 +09:30
Mark Tozzi
9b6d8e8e20
[7.17] Fix a bug with flattened fields in terms aggregations (#87392) (#87506)
* Fix a bug with flattened fields in terms aggregations (#87392)

The root cause here was that missing did not correctly delegate `supportsGlobalOrdinalsMappnig` to the wrapped values source, instead falling back to the default.  I've added the delegation, and made the base method abstract so this doesn't happen again.

* BWC version dance, part one

* Fix flattened object format
2022-06-08 16:13:44 -04:00
Nik Everett
968c476bff
Fix version in bwc test again (#87266)
My change #86401 never made it into 7.17.4 so the test was confused.
This bumps the version. It'll make it into 7.17.5.

Closes #87113
2022-05-31 15:42:32 -04:00
Fernando Briano
e2153f6883
Rest API Spec: Wraps YAML tests values with colon in quotes (#87148) (#87170) 2022-05-26 10:58:32 -04:00
Nik Everett
41369f1594 Fix forward compat version for serial_diff
It is only supported in 7.17.last and 8.3.last.
2022-05-20 16:43:01 -04:00
Nik Everett
2de6cb31af
Fix versions in serial diff tests (#86986)
This adds some missing skips to make the tests for the serial_diff
always pass and test the current version. The tests contain a
`fixed_interval` which is only supported in 7.2+. That's fine probably
ok - we don't expect to make backwards breaking changes at all, much
less breaking with 7.1 and *not* 7.2
2022-05-20 12:32:59 -04:00
Nik Everett
957b473720
Allow serial_diff under min_doc_count aggs (backport of #86401) (#86947)
Before 6.6 we allowed the `serial_diff` agg in lots of places, including
under `date_histogram` aggregations with `min_doc_count: 1`. This
allowed you to take the difference of two adjacent buckets, skipping any
that don't have any value. So if you have a value at 10am, no value at
11am, and another at noon the `serial_diff` will diff the 10am and noon
values. In 6.6 we disabled support for this. We'd like it back.
2022-05-20 10:48:07 -04:00
Salvatore Campagna
437d42a901
fix: remove tests from 7.17 (#85534) (#85540)
Backport PR #85467 added two tests:
* Multi-value date histogram
* Multi-value date histogram docvalues only
as a result of a mistake while doing a conflict resolution.

With this PR I will remove them temporarily from master, backport
the fix to 7.17.3 and later make another PR to master to add them
back.

This is a fix for #85509.

(cherry picked from commit b4ff756bec)

# Conflicts:
#	rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.aggregation/360_date_histogram.yml
2022-03-31 13:29:13 +02:00
Salvatore Campagna
7d169fc425
[7.17] test: timezone with data_histogram and composite date_histogram (#85176) (#85467)
(cherry picked from commit 3be4d6b935)

# Conflicts:
#	rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.aggregation/360_date_histogram.yml
2022-03-30 16:44:39 +02:00
Nik Everett
f0e07271f0
REST tests for variable width historam (#84836) (#85116)
This expands on the super basic REST tests for variable width histogram
with some ever so slightly less basic tests. They are still pretty
basic, but they do a good job of making sure that we don't break
backwards compatibility with the API.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2022-03-21 11:25:39 -04:00
Lee Hinman
03fbe90fec
[7.17] Remove existing indices/datastreams/aliases before simulating index template (#84675) (#84769)
* Remove existing indices/datastreams/aliases before simulating index template (#84675)

# Conflicts:
#	rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.simulate_index_template/10_basic.yml
#	x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/180_simulate_existing_data_stream.yml

* Fix backport typo issue
2022-03-08 11:37:17 -05:00
Nik Everett
c4db155cd3
Test fetch in top hits in 7.11+ (#84635)
Something is wrong with `fetch` in `top_hits` in 7.10 and I'm not sure
what. But at this point it's not worth figuring it out. So we'll skip
testing `fetch` in `top_hits` until 7.11.

Closes #84590
2022-03-03 13:24:29 -05:00
Nik Everett
bf0c238868
Weaken assertion on top_hits explain test (#84629) (#84634)
The tests for the explanation of top_hits asserted that the explanation
matches precise strings. Which it mostly does. But there seem to be edge
cases where a number in the string varies. We really don't care about
the number. This replaces the string assertion with a regex that doesn't
care about the number.

Closes #84590
2022-03-03 12:14:19 -05:00
Nik Everett
c2b348746b
Test: skip fetch fields in top_hits pre-7.10 (#84529)
We added `fields` support to `top_hits` in 7.10. Tests against a cluster
containing 7.9 nodes isn't likely to work....

Closes #84525
2022-03-01 17:11:07 -05:00
Nik Everett
6deb6a988f
Test: Ignore .tasks index (#84453) (#84457)
The test for sorting in `_cat/shards` fails sometimes because it sees
the `.tasks` index. This limits it to only the indices it expects to be
there.
2022-02-28 16:08:53 -05:00
Nik Everett
1e2de95dac
[7.17] REST tests for top_hits (#83690) (#84442)
* REST tests for top_hits (#83690)

This adds a pile of extra REST tests for the `top_hits` aggregation
which is useful because this is how we do mixed version cluster testing.
And backwards compatibility testing. And forwards compatibility testing.

* After 7.0
2022-02-28 15:36:23 -05:00
Rene Groeschke
ee79b04093
Replace deprecated api in artifact transforms (#84015) (#84023)
`ArtifactAttributes.ARTIFACT_FORMAT` has been deprecated in favor of
public available `ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE`
2022-02-21 10:29:56 +01:00
Salvatore Campagna
00aa1b55b4
fix: backward compatibility with version 7.17.0 (#83715) (#83820)
PR #83339 was meant to be included in version 7.17.0 but didn't happen.
It landed in version 7.17.1. As a result, version checks in the code are
incorrect. Instead of checking against version 7.17.0 we need to adjust
the code in such a way that it operates correctly with version 7.17.0.
Version 7.17.0 is released and, as as result, it represents the 'reference'
version we would like all following versions to interoperate with.

Unfortunately this means that interoperability between version 7.17.0 and
version 8.0.0 is broken.

In summary this fix needs to be backported to:
* 7.17.1: so to fix interoperability of version 7.17.1 with 7.17.0
* 8.0.1: so to fix interoperability of version 8.0.1 with 7.17.0
* 8.1.0 (currently BC): so to fix interoperability of version 8.1.0 with 7.17.0
* master (8.2): so to fix interoperability of version 8.2.0 with 7.17.0

Also, when reading and writing the range key, version 7.17.0 checks against
version 6.4.0 which is not possible right now. As a result, we just check
against the earliest possible version.
2022-02-11 05:04:51 -05:00
Przemyslaw Gomulka
8d10cfebed
[7.17] Convert 'id' and '_id' values in REST API tests to strings #82681 (#83772)
Follow-up from #77144 (comment) with converting id/_id to always be strings instead of integers. This makes the type value in the Elasticsearch specification be only string instead of string | number.

this change was generated using following command on ubuntu
find . -type f -name "*.yml" -print0 | xargs -0 sed -i -r 's/([^a-zA-Z0-9_\.]id|[^a-zA-Z0-9_]_id):(\s)([0-9]+)/\1:\2"\3"/g'
relates #82681
2022-02-10 13:52:36 +01:00
Steve Gordon
08c602de86
Change date range format which fails to parse in some clients (#83397) (#83444)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2022-02-03 05:43:04 -05:00
Salvatore Campagna
f4377d665c
[7.17] fix: missing fields in range aggregation response for date fields (#82732) (#82757)
When running a range aggregation on a date field both `fromAsStr` and
`toAsStr` need to be parsed to extract the correct range boundaries.
Not doing so results in +/- infinite values in `to`, `from`, `originalTo`
and `originalFrom` which in turn result in:
* incorrect key values (wildcard character used for infinite values);
* missing fields in the response (to, from, to_as_string, from_as_string)
  due to checks for initite values in the serialization logic;

(cherry picked from commit 1186e90d09)
2022-01-18 20:12:34 +01:00
Yannick Welsch
b8e94c634b
Possibly a fix for field caps test failures (#82716)
It's unclear to me what the causes are for the test failures in #80335. To rule out some basic stuff, and add a bit more introspection, I'm suggesting to push the following change.

Relates #80335
2022-01-18 14:25:46 +01:00
Salvatore Campagna
aa2a315a3c
[7.17] Fix bucket keys format for range aggregations on float field (#81801) (#82435)
When dealing with float fields we actually store float values with lower precision.
Later on, when loading float values into double values, the precision difference between
float and double values surfaces as additional "spurious" digits in the string
representation which is propagated to the client during serialisation. As a result of this,
the JSON response returned to the client includes range values not matching values in the
request. This results in clients, including Kibana, to break while trying to match ranges in
the request with ranges in the response.

With this change we use two new fields, `originalFrom` and `originalTo` to hold the original
double values before manipulating the precision of float fields. Later we use these fields in
the code dealing with serialisation. The effect is that precision issue resulting from
float to double conversions are not propagated to clients.

(cherry picked from commit 3550370c86)
2022-01-12 12:03:24 +01:00
David Roberts
0d403365bd
[7.16] [ML] Model snapshot upgrade needs a stats endpoint (#81706)
* [7.16] [ML] Model snapshot upgrade needs a stats endpoint

Previously the ML model snapshot upgrade endpoint did not
provide a way to reliably monitor progress. This could lead
to the upgrade assistant UI thinking that a model snapshot
upgrade had finished when it actually hadn't.

This change adds a new "stats" API that allows external
interested parties to find out the status of each model
snapshot upgrade and which node (if any) each is running on.

Backport of #81641

* Fixing compilation
2021-12-14 04:50:07 -05:00
Andrei Stefan
32cb6c35d8
Remove leftover feature flag (#81699) (#81703)
(cherry picked from commit 7b70ef32cf)
2021-12-14 10:31:31 +02:00
William Brafford
1674ce86eb
Set correct version bounds for system features rest API tests (#81465) (#81607)
* Use correct version bounds for API test
* Use correct version bounds for migration API test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-12-09 17:41:29 -05:00
Seth Michael Larson
b57ffab89a
Add optional body to ml.open_job and ml.forecast APIs (#81594) 2021-12-09 12:36:09 -05:00
Lisa Cawley
66daa10b1c
[DOCS] Adds missing timeout parameter to transform APIs (#81129) (#81278) 2021-12-02 18:35:44 -08:00
James Rodewig
762e537320
[DOCS] Remove source query params from update/delete by query APIs (#81131) (#81212)
Removes source-related query parameters from the update by query
and delete by query API documentation. These parameters don't return
source fields as part of the response.
# Conflicts:
#	rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json
2021-12-01 10:07:41 -05:00
Lisa Cawley
ca8cc1f958
[ML] Updates visiblity of validate API (#81061) (#81109) 2021-11-29 09:20:31 -08:00
Artem Prigoda
47da0dca20
[7.16] Revert "Deprecate returning 408 for a server timeout on _cluster/health (#78180)" (#80831)
* Revert "Allow deprecation warning for the return_200_for_cluster_health_timeout parameter (#80178) (#80445)"

This reverts commit 5a5300753d.

* Revert "[7.x] Use query param instead of a system property for opting in for new cluster health response code (#79397) (#79435)"

This reverts commit d8c14281

* Revert "[7.x] Deprecate returning 408 for a server timeout on `_cluster/health` (#78180) (#78940)"

This reverts commit 03bd55d1
2021-11-18 16:57:39 +01:00
Nikola Grcevski
581e785022
[7.16] Undo transient settings deprecation (#80558) (#80570)
Remove transient settings deprecation message from logs
and upgrade assistant.
2021-11-09 20:30:56 -05:00
Seth Michael Larson
9eb0b406b5
Mark the keep_alive parameter of Open Point in Time API as required (#80513) 2021-11-08 15:02:35 -05:00
Keith Massey
e4271b6845
Changing HeaderWarning to always use 299 as the warning code (#80304) (#80503)
* Changing HeaderWarning to always use 299 as the warning code (#80304)

This commit changes the deprecation logger so that all messages (critical or warning) are written
out with "299" as the level at the beginning of the header in order to be compliant with
https://www.rfc-editor.org/rfc/rfc7234.html#section-5.5.7. In #79107 we mistakenly began logging
warning-level messages with the 300 code, which is not valid in the RFC.

* fixing compilation errors from merge
2021-11-08 11:43:46 -06:00
Artem Prigoda
5a5300753d
Allow deprecation warning for the return_200_for_cluster_health_timeout parameter (#80178) (#80445)
It will be deprecated in #78968, but first we need to backport the allow_warning
change to 7.16 and 8.0 in order to not break BWC
2021-11-05 20:14:17 +01:00
Mark Vieira
bcfbf00074 Reformat Elasticsearch source 2021-10-27 15:23:15 -07:00
Nikola Grcevski
08ccb6683f
[7.x] Reduce BWC version for HotThreads.sort (#79583) (#79864)
Porting the tests and the updated rest spec to 7.16.


Co-authored-by: Nhat Nguyen <nhat.nguyen@elastic.co>
2021-10-26 21:19:47 -04:00
Tim Brooks
f7281b8e63
Modify fleet search URLs to avoid url collisions (#79856)
Currently the fleet search URL of /_fleet/_msearch will collide with the
normal msearch API when the fleet plugin is not enabled. This is because
_fleet will be identified as an index to search. This commit resolves
the issue by changing the APIs to /_fleet/_fleet_search and
/_fleet/_fleet_msearch.
2021-10-26 12:06:06 -06:00
Przemyslaw Gomulka
ca1c03cfa1
Revert "Deprecate resolution loss on date field (#78921) backport(#79355)" (#79613)
This reverts commit ff6e589.
and
docs commit 69cf4a3.
2021-10-21 19:01:36 +02:00
William Brafford
159cb4413c
Use 'migration' instead of 'upgrade' in GET system feature migration status responses (#79302) (#79495)
* Change 'upgrade' to 'migration' in System Index Migration responses
2021-10-19 13:32:53 -04:00
Dan Hermann
b41bcd1dd5
[7.x] API for adding and removing indices from a data stream (#79481) 2021-10-19 11:02:47 -05:00
Alan Woodward
115aabfa6e
Fix execution of exists query within nested queries on field with doc_values disabled (#78841) (#79462)
The FieldNamesFieldMapper adds non-indexed fields to a special metadata
field so that exists queries can be run efficiently.  This is built in a postParse
method that is run once per document.  However, this means that nested
documents are not handled correctly - non-indexed field names are added to
the parent document's metadata field rather than to the nested document's
field.

This commit fixes things to add non-indexed field names directly to the
nested documents.

Co-authored-by: Yoann Rodière <yoann@hibernate.org>
2021-10-19 14:47:08 +01:00