Commit graph

240 commits

Author SHA1 Message Date
Rene Groeschke
ae569def9c
[Build] Require reason for usesDefaultDistribution (#124707)
This makes using usesDefaultDistribution in our test setup for explicit by requiring a reason why it's needed.
This is helpful as part of revisiting the need for all those usages in our code base.
2025-03-17 08:25:39 +01:00
Luigi Dell'Aquila
a0840a0463
EQL: set allow_partial_search_results=true by default (#120267) 2025-01-27 10:23:34 +00:00
Rene Groeschke
7b6bdfa323
[Gradle] Make rolling upgrade tests configuration cache compatible (#119577)
With this, all rolling upgrade tests that involve a
`nextNodeToNextVersion` update are gradle configuration cache
compatible.

Simplify API around test cluster registry and cc compatible usage of
test cluster in TestClusterAware tasks.
2025-01-16 23:23:04 +11:00
Luigi Dell'Aquila
1d2840ece1
EQL: add support for partial search results (#116388)
Allow queries to succeed if some shards are failing
2024-12-17 17:13:52 +01:00
Mark Vieira
ebf470acdf
Provide a mechanism to modify config files in a running test cluster (#117859) 2024-12-03 13:04:02 -08:00
Rene Groeschke
f6ac6e1c3b
[Build] Remove deprecated BuildParams (#116984) 2024-11-22 16:30:57 +01:00
Rene Groeschke
13c8aaeffa
[Gradle] Remove static use of BuildParams (#115122)
Static fields dont do well in Gradle with configuration cache enabled.

- Use buildParams extension in build scripts
- Keep BuildParams.ci for now for easy serverless migration
-  Tweak testing doc
2024-11-15 17:58:57 +01:00
Mark Vieira
a59c182f9f
Add AGPLv3 as a supported license 2024-09-13 15:29:46 -07:00
Mark Vieira
4ce661cc48
Bump Elasticsearch version to 9.0.0 (#112570) 2024-09-11 09:40:11 -07:00
Luigi Dell'Aquila
f6ace50953
EQL: Mute bwc tests that have incompatibilities with Java 23 (#112699)
The switch to Java 23 removed support for COMPAT locale provider, so
running old versions (< 8.15.2) in a mixed cluster will result in
different results for date format (eg. month and day names are truncated
to three letters).

Fixes https://github.com/elastic/elasticsearch/issues/112617
2024-09-11 03:37:52 +10:00
Luigi Dell'Aquila
939153ecfb
Update snapshots for EQL correcness tests (#112658) 2024-09-09 16:55:08 +02:00
Simon Cooper
a36d90cf34
Use CLDR locale provider on JDK 23+ (#110222)
JDK 23 removes the COMPAT locale provider, leaving CLDR as the only option. This commit configures Elasticsearch
to use the CLDR provider when on JDK 23, but still use the existing COMPAT provider when on JDK 22 and below.

This causes some differences in locale behaviour; this also adapts various tests to still work whether run on COMPAT or CLDR.
2024-09-04 13:42:40 +01:00
Armin Braun
bf7be8e23a
Save 400 LoC in tests by using indexSettings shortcut (#111573)
It's in the title, randomly saw a bunch of spots where we're
not using the shortcut, figured I'd clean this up quickly to save ~400 lines.
2024-08-05 10:21:13 +02:00
Luigi Dell'Aquila
257f2390ac
EQL: fix validation of TEXT fields with case insensitive comparison (#111238) 2024-07-26 12:22:26 +02:00
David Turner
5662f988b2
Remove trappy timeouts in snapshot APIs (#109828)
Wholesale fix of every `TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT` in
`o.e.snapshots` and `o.e.repositories`, just pulling them up to the REST
layer (where they become API params), the test suite (where they become
`TEST_REQUEST_TIMEOUT`), or some other place where an explicit value is
available.

Relates #107984
2024-06-21 07:11:12 +10:00
Joe Gallo
f2e7b64c18
Remove gradle references to the rest-high-level client (#104871) 2024-01-29 14:13:06 -05:00
Luigi Dell'Aquila
3dfc8415f0
Fix NPE on missing event queries (#103611) 2023-12-20 13:02:23 +01:00
Andrei Stefan
8e4dc59e20
EQL: Samples should check if the aggregations result is empty or null (#103574)
* Samples should check if the aggregations result is empty or null

* Update docs/changelog/103574.yaml
2023-12-19 19:07:48 +02:00
Mark Vieira
af47300567
Support "shared" test clusters (#101089)
This commit introduces the concept of shared tests clusters using the
new JUnit testing framework. Unlike normal test clusters which are
exclusive to each test suite (class), shared clusters persist across
test suites to be reused. This can be useful for test projects with a
large number of test suites that can all use a single cluster, and the
overhead of creating these clusters is the dominating factor.
2023-11-02 11:27:12 -07:00
Joe Gallo
b750f6e980
Remove HLRC from EQL tests (#101697) 2023-11-02 11:39:59 -04:00
Bogdan Pintea
800b38445c
QL: Update the use of some user-caused exceptions (#100918)
This updates the use of certain exceptions in the QL, EQL and SQL code base. The failures that occur due to either user-provided input (such as incorrect query, incorrect query parameters), or data format not appropriate to the attempted operation (like converting strings to various other types) will now result in a 4xx type code, rather than 5xx.

This change also proposes turning `QlClientException` concrete, by implementing the `status()` method to return a `BAD_REQUEST` (400). The 400 is a "generic", catch-all client-side error message. The other 4xx errors are specializations. No QL code / exception makes use of specializations, but if they so wish, they can simply override the method.
This also makes it clearer to any subclass that a 4xx status must be return.

This change allows the use of some currently abstract subclasses, such as `EqlClientException`, which can be employed on user-related failures, that are currently inappropriately raised as a form of `QlIllegalArgumentException`, which is a 500-type error.

Also, an `InvalidArgumentException` extending `QlClientException` is introduced, being thrown where the execution cannot continue due to user's query (either direct input or invalid application of functions to index data).
2023-11-02 15:56:15 +01:00
Mark Vieira
ee1467d4ff
Improve test avoidance (#101081) 2023-10-26 12:16:06 -07:00
Lorenzo Dematté
77dac65761
Fix NodeInfo version parsing in bwc tests (#100838)
* Mixed cluster tests with string NodeInfo version

- Move version based feature comparison to a common, deprecated method (to be replaced with real features)
- Use string comparison against old cluster version to partition new/old cluster nodes
2023-10-25 12:59:10 +02:00
Rene Groeschke
8a6df32de6
Update gradle wrapper to 8.4 (#99856)
* Remove deprecated forConfigurationTime usage
2023-10-11 17:02:27 +02:00
Yang Wang
35737a50d0
[Test] Explicitly set number_of_shards to 1 (#100171)
Some tests rely on the natural index order for test assertions. This
works when the index has a single primary shard but fails otherwise.
This PR adjusts the relevant tests so that they explicitly configure the
number of shards to 1.

Relates: ES-6540
2023-10-10 23:51:52 +11:00
Armin Braun
b7eafce32c
Make some practically static methods static (#97565)
Another round of automated fixes to this, marking things that can be
made static as static. Saves some JIT cycles but also turns some lambdas
from capturing to non-capturing and makes the "utilityness" of some
classes visible.
2023-10-06 23:37:07 +02:00
Andrei Stefan
a5a7c0e8fd
ESQL: support metric tsdb fields while querying index patterns (#100351)
* Make incompatible metric fields as incompatible types in QL
* Added tests for SQL and EQL with conflicting tsdb fields
2023-10-06 17:09:49 +03:00
Mark Vieira
7be3d2c191
Increase flexibility of test cluster execution environments (#99437) 2023-09-13 11:18:40 -07:00
Tim Vernum
47b70147ba
Convert EQL rest test to internal-rest framework (#99116)
This commit converts the x-pack/plugin/eql/qa/rest and x-pack/plugin/eql/qa/security QA projects from legacy rest/yaml test to internal tests.
2023-09-04 13:32:57 +10:00
Andrei Stefan
291ecc5e79
QL: EQL and ESQL to use only the necessary fields in the internal field_caps calls (#98987)
* Use only the necessary fields in field_caps calls from QL
2023-08-30 17:36:06 +03:00
Luigi Dell'Aquila
9ab8f71b01
EQL: fix async missing events and re-enable the feature (#97718) 2023-07-19 16:01:39 +02:00
Andrei Stefan
9d01d3847b
EQL: Softly remove "missing events" feature (#97643) 2023-07-13 16:30:21 +03:00
Armin Braun
63e64ae61b
Cleanup Stream usage in various spots (#97306)
Lots of spots where we did weird things around streams like redundant stream creation, redundant collecting
before adding all the collected elements to another collection or so, redundant streams for joining strings
and using less efficient `Collectors.toList` and in a few cases also incorrectly relying on the result being mutable.
2023-07-03 14:24:57 +02:00
Rene Groeschke
89a65b2c5a
Make ESRestTestCase client configuration more configurable in subclasses (#96987)
We want to be able to tweak client configuration in tests extending
ESRestTestCase. This makes that simpler by allowing overriding the
general client configuration.
2023-06-21 14:02:34 -04:00
Luigi Dell'Aquila
00c0f2c763
EQL: sequence - add support for missing events (#92348)
sequence with maxspan=10m
   [ event where name = 'a' ]
  ![ event where name = 'b' ]
   [ event where name = 'c' ]

meaning "find 'a' and 'c', in a 10 minutes span, where no 'b' exists in between"
2023-06-14 08:49:47 +02:00
Rene Groeschke
e735455431
Provide hints to Gradle Task.onlyIf declarations (#94953)
* Update gradle enterprise plugin to show skip reasons in build scans
* Unify OS specific handling in build logic
2023-03-31 23:57:55 +02:00
Simon Cooper
dc6ccbbe08
Add transport_version to node info JSON (#94669) 2023-03-24 09:00:01 +00:00
Albert Zaharovits
54a78c3777
Fix Security's expression resolver to not remove unavailable but authorized names (#92625)
For non-wildcard resource names in expressions from requests with the
`ignoreUnavailable` request option set to `true`, the Security filter
removes names for "unavailable" resources. This behavior is
theoretically correct, but in practice the cluster state might not be
recovered at the point in time when the Security filter does the
rewrite (this causes problems, see #90215); In any case, the logic
to remove "unavailable" names is unnecessarily duplicated from
Core's expression resolver.

This PR makes the expression resolver in the Security filter to NOT:
 * remove missing but authorized names (indices, aliases, datastreams)
 * remove authorized datastreams if context disallows datastreams
 * remove backing indices of authorized datastreams if context disallows datastreams

It will only remove names of unauthorized resources, and let the
unavailable names go through to be handled (to be ignored or
throw "not found" exception) by the expression resolver in Core.

Fixes: #90215
2023-01-19 16:41:06 +02:00
Luigi Dell'Aquila
1876400c74
EQL Samples: add support for multiple samples per key (#91783) 2022-12-23 12:43:28 +01:00
Mark Vieira
c2eda511de
Add JUnit rule based integration test cluster orchestration framework (#92379)
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-21 15:33:46 -08:00
Luigi Dell'Aquila
5cb0905f70
Add support for EQL samples queries (#91312) 2022-11-14 10:53:12 +01:00
Luigi Dell'Aquila
a3639026cc
EQL: remove version limitations for CCS (#91409) 2022-11-14 08:41:00 +01:00
Luigi Dell'Aquila
904eae5ce4
EQL sequences: support join on multi-values (#89965) 2022-09-27 10:26:58 +02:00
Fernando Briano
e18a10de11
Rest API Spec: Wraps YAML tests values with colon in quotes (#90089) 2022-09-20 09:02:16 +01:00
Rene Groeschke
3909b5eaf9
Add verification metadata for dependencies (#88814)
Removing the custom dependency checksum functionality in favor of Gradle build-in dependency verification support. 

- Use sha256 in favor of sha1 as sha1 is not considered safe these days.

Closes https://github.com/elastic/elasticsearch/issues/69736
2022-08-04 09:51:16 +02:00
Luigi Dell'Aquila
62f27f50ed
Add support for VERSION field type in SQL and EQL (#87590) 2022-06-23 08:54:20 +02:00
Luigi Dell'Aquila
3dc4176a1a Revert "Add support for VERSION field type in SQL and EQL (#85502)"
This reverts commit 79b0078b0d.
2022-06-09 09:34:26 +02:00
Luigi Dell'Aquila
79b0078b0d
Add support for VERSION field type in SQL and EQL (#85502) 2022-06-09 08:43:23 +02:00
Rene Groeschke
a10cc8d5f2
Port all remaining xpack plugin projects away from deprecated rest-test plugin (#86626)
- Use internal java rest test or internal yaml rest test plugin instead

This is part of https://github.com/elastic/elasticsearch/pull/85491/
2022-05-11 16:57:17 +02:00
Lukas Wegmann
854d9d8a15
QL: Cleanup BWC tests for unsupported version (#86336)
Since the jump to 8.x we no longer need some of the version switches in
the bwc tests because we no longer test against version before 7.17.
2022-05-09 13:27:20 -04:00