Commit Graph

67 Commits

Author SHA1 Message Date
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
Mark Vieira 350720e972
Fix system property value for inference rescorer tests feature flag (#100366)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-10-06 11:46:54 +02:00
Mark Vieira 8916c3dd9f
Support debugging integration tests with multiple test clusters (#100304)
Add support for passing `--debug-server-jvm` to tests that declare
multiple test clusters. This is common in tests for things like remote
cluster security, CCS, CCR, etc.

The convention for port numbers and debug settings is the same. The JVM
is expected to attach to an existing debugger in listen mode, starting
at port 5007 and incrementing from there.

Closes #94175
2023-10-04 18:54:41 -04:00
Mark Vieira 8f591b24e6
Convert core xpack rest tests to new test framework (#100301) 2023-10-04 15:06:27 -07:00
Tim Vernum d411acecbc
Suppress this-escape warning for JDK21 (#99848)
Adds @SuppressWarnings("this-escape") to all necessary places to that
Elasticsearch can compile with -Werror on JDK21

No investigation has been done to determine whether any of the cases
are a potential source of errors - we have simply suppressed all
existing occurrences.

Resolves: #99845
2023-09-25 18:30:21 +10:00
Mark Vieira 7be3d2c191
Increase flexibility of test cluster execution environments (#99437) 2023-09-13 11:18:40 -07:00
Tim Vernum 0a74a2fbaa
[test] Create subdir in config dir if required (#99218)
This commit updates the local cluster factory so that extra config files
(see `LocalSpecBuilder.configFile`) can be placed into subdirectories of
the config dir. This is needed when creating files for the
`FileSettingsService` - these k8s managed files are required to be in an
`"operator/"` directory within the general configuration directory.
2023-09-06 21:23:57 -04:00
Tim Vernum 0931d1e675
Add QA Rest Test for audit logging (#98923)
This adds an integration test for audit logging functionality
2023-08-28 21:47:02 -04:00
Mark Vieira 6258b1880d
Remove final modifier from Version class to allow for subclassing (#98748)
We need to be able to extend `Version` for certain bespoke testing
use-cases.
2023-08-22 13:43:00 -04:00
Andrei Dan 01ed7de99f
GA the data stream lifecycle (#98644)
This makes the data stream lifecycle generally available. This will allow
data streams to take advantage of a native simplified and resilient
lifecycle implementation.
2023-08-21 17:28:54 +01:00
Yang Wang d0f64941f0
Remove RCS 2.0 feature flag for beta release (#98307)
This PR removes the RCS 2.0 feature flag so that it is ready for beta
release.
2023-08-14 08:33:37 +10:00
Mark Vieira 67a3573806
Simplify extending cluster handle implementations (#98363) 2023-08-10 13:00:59 -07:00
Mark Vieira a6ca1e7492
Add forcibly argument to test cluster stop node method (#98336)
(cherry picked from commit 2975f3379d)
2023-08-10 11:22:51 -07:00
Mark Vieira 5206587cfe
Revert "Add forcibly argument to test cluster stop node method (#98336)"
This reverts commit 2975f3379d.
2023-08-09 15:14:12 -07:00
Mark Vieira 2975f3379d
Add forcibly argument to test cluster stop node method (#98336) 2023-08-09 15:13:10 -07:00
Mark Vieira ecb187c984
Forcibly terminate test cluster nodes at the end of tests (#98335) 2023-08-09 14:07:21 -07:00
Tim Vernum 6fa5c61cf2
Support operator users in LocalClusterSpec (#97340)
This adds a new parameter to LocalClusterSpecBuilder.user(..) to
indicate whether the user should be an operator or not.

Users added with the simplified user(username, password) method are
operators (and have the "_es_test_root" role).
2023-08-09 02:38:58 -04:00
Yang Wang 9c07f1df6f
RCS2 - Fix remote nodes collection for scroll (#98186)
For RCS 2.0, we added a RemoteClusterNodesAction (#93893) for collecting
remote cluster server nodes. This action is used in two places: 1.
Collecting nodes that can be directly connected in sniff mode 2. In the
method RemoteClusterService#collectNodes

However, in the 2nd use case, we should collect all ndoes from the
remote cluster instead of just those nodes that have remote cluster
server enabled. This is because the method is used in the context of
search instead of building connection. A remote node can be *not*
directly accessible but still hosts searchable data. Search requests
should be sent to all the data nodes and *not* limited to just the
server nodes.

This PR fixes this issue by augmenting RemoteClusterNodesAction to
support retrieving either server nodes or all nodes. The caller can
decide which set of nodes are of interest depending on the context.
2023-08-08 01:02:40 -04:00
David Turner da389b465a
Improve testclusters shutdown logging (#98253)
Today the logging when shutting down a node does not indicate to which
node it pertains. This commit adds a little more detail to aid with
debugging.
2023-08-07 18:14:03 +01:00
Carlos Delgado 375991d974
Remove synonyms feature flag and related classes (#97962) 2023-07-26 18:13:06 +02:00
Tim Vernum 58906f9fc8
[testcluster] Fix merging of JVM args (#97776)
Ensure that there is always a space between different components when building ES_JAVA_OPTS
2023-07-25 11:22:43 +10:00
Mark Vieira 6b6a85534b
Add API for accessing node logs in test clusters framework (#97701) 2023-07-14 12:19:03 -07:00
Mayya Sharipova 321110ef52
Add synonyms feature for test clusters (#97658)
Fix for #97334 where incorrect feature name was provided.


Correct more instances of synonyms_feature_flag_enabled for synonyms_api_feature_flag_enabled


Closes #96641, #97177
2023-07-13 11:34:25 -04:00
Kathleen DeRusso 1365b0df61
Enable Query Rules as technical preview (#97466)
Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>
2023-07-12 16:04:59 -04:00
Ryan Ernst 4cf4be4033
Expose pid in new test clusters (#97590)
Sometimes it is necessary for an integ test to poke at the Java process
of Elasticsearch. This commit makes a node's pid available through
ClusterHandle.
2023-07-11 16:52:12 -04:00
Ryan Ernst 6e5ee5b782
Allow test clusters to specify additional jvm arguments (#97584)
Somet special tests like die-with-dignity need to pass additional jvm
arguments (exit on OOM). This commit adds a new jvmArg to the cluster
spec for the new test clusters infra.
2023-07-11 10:01:16 -07:00
Stuart Tettemer 44ce64c35f
Stop invidual nodes and get node names in test clusters (#97402)
Adds
`public String getName(int index)`
`public void stopNode(int index)`

To the cluster handle.
2023-07-05 13:16:32 -05:00
Mary Gouseti a432313ff3
Data stream lifecycle class names (#97381) 2023-07-05 12:28:32 +03:00
Yang Wang 18f326ad3c
[Test] RCS migration for Transform and CCR jobs (#96725)
This PRs adds migration tests for transform and CCR jobs from using RCS
1.0 to 2.0 then back to 1.0 again. It is not intended to cover all
possible scenarios, but rather a proof to show migration is possible in
at least some cases.

Note the migration strategy here is to update remote cluster settings in
place, i.e. reuse the same cluster alias and change its definition.
Restart is required because a node needs to the cross-cluster API key
form the keystore.
2023-06-19 19:56:22 -04:00
Kathleen DeRusso 008a9fc46d
Add Put Query Ruleset API call (#96812) 2023-06-15 10:37:18 -04:00
Mark Vieira ed7e1ea657
Add method for registering a SettingsProvider for keystore settings (#96679)
Add a method to `LocalClusterBuilder` for providing a `SettingsProvider`
for secure keystore settings in test clusters.
2023-06-07 19:52:25 -04:00
Ievgen Degtiarenko af15c058bf
Fix a typo in LocalClusterSpec (#96576)
Fix a typo in LocalClusterSpec to use actual parameter instead of hard coded value.
2023-06-06 08:27:01 +02:00
Carlos Delgado 39b7b5eb56
Synonym Mgmnt API: PUT request (#95895) 2023-05-31 10:48:56 +02:00
Mark Vieira 9502d39c96
Refactor GCS test fixture to remove docker dependency (#94755) 2023-05-17 11:05:26 -07:00
Mark Vieira 6ace408239
Refactor BWC handling to support more flexible testing scenarios (#95803) 2023-05-03 13:43:39 -07:00
Rene Groeschke 4e2f852c08
Resolve runtime java via Gradle tool chain provider (#95319)
Using gradle toolchain support in gradle requires refactoring how the composite build is composed. 
We added three toolchain resolver
1. Resolver for resolving defined bundled version from oracle as openjdk
2. Resolve all available jdks from Adoption
3. Resolve archived Oracle jdk distributions. 

We should be able to remove the JdkDownloadPlugin altogether without having that in place, but we'll do that in a separate effort.

Fixes #95094
2023-05-03 15:28:47 +02:00
Rory Hunter fe1083f6c5
Upgrade spotless plugin to 6.17.0 (#94994)
Fixes #82794. Upgrade the spotless plugin, which addresses the issue
around formatting `instanceof` expressions. Formatting of statements
including lambdas seems to have improved too.
2023-04-04 10:03:32 +01:00
Mark Vieira 679e73d355
Refactor azure test fixture to remove docker dependency (#94750) 2023-03-27 12:36:14 -07:00
Simon Cooper f352625f26
Refactor Retry test util to not use CompletableFuture (#94589) 2023-03-27 11:26:23 +01:00
Mark Vieira cbc73a7665
Register test artifacts for service-account security QA project (#94602) 2023-03-21 12:15:05 -07:00
Mark Vieira 7eb56d088c
Add convenience method for providing conditional test cluster settings (#94246) 2023-03-01 11:14:27 -08:00
Andrei Dan c63d0afb21
Fix data lifecycle tests for non-snapshot builds (#94146)
This fixes yaml tests when -Dbuild.snapshot is false.

The data lifecycle functionality is not enabled unless the feature flag
is configured.
This makes the yaml tests enable the feature flag for non-snapshot builds
(it's always enabled for snapshot builds)
2023-02-27 13:08:13 +00:00
Mark Vieira ead1fdb024
Support providing test cluster keystore settings via lazy evaluation (#93765)
This adds a `keystore` method to `LocalSpecBuilder` to provide secure
keystore settings via a `Supplier<String>` to allow for lazy-evaluated
settings, such as a secure setting that resolves to the address of
dependent cluster.
2023-02-14 03:12:05 -05:00
Yang Wang 36b8083aaf
Migrate new RCS test to use the new REST test plugin (#93677)
This PR migrates the new RCS REST test to use the new plugin. The inline
clusters make it possible to add more test classes within the same
package (will be added as follow-ups).
2023-02-10 00:03:10 -05:00
Mark Vieira 659dea0055
Use absolute paths for logs locations in JVM options for test clusters (#93672) 2023-02-09 14:45:12 -08:00
Mark Vieira 603bae68ec
Use shorter paths for test cluster working directories to avoid issues on Windows (#93570) 2023-02-08 12:50:53 -08:00
Mark Vieira 3f47fe9422
Add some debug logging (#93535) 2023-02-06 17:06:41 -08:00
Mark Vieira fc78668ebe
Avoid copying test cluster distributions when possible (#93486) 2023-02-06 16:33:56 -08:00
Mark Vieira b2d9a4ecf5
Fix test cluster security setup on Windows (#93482) 2023-02-02 14:57:50 -08:00
Mark Vieira 43d9a6a0c8
Convert full cluster restart tests to new rest testing framework (#93477) 2023-02-02 13:13:54 -08:00