Commit Graph

139 Commits

Author SHA1 Message Date
Przemyslaw Gomulka 7a5bc9e9fb
Create gradle service to start mock apm server (#100839)
when running gradlew run it should be possible to quickly setup a fake
apm server that will be simply logging received apm agent requests.
This commits adds a gradle build service that will be run before the RunTask
and will start a simple http server based on https://github.com/elastic/apm-agent-java-plugin-example/blob/main/plugin/src/test/java/co/elastic/apm/mock/MockApmServer.java
2023-10-19 14:09:24 +02:00
Rene Groeschke 5ae576fafc
Make TestClusterPlugin configuration cache compatible (#101069) 2023-10-19 13:52:20 +02:00
Rene Groeschke b23e000c30
Update gradle wrapper to 8.3 (#97838)
Gradle now fully supports compiling, testing and running on Java 20. 
Among other general performance improvements this release introduces --test-dry-run command line option that allows checking if tests are filtered or not by gradle.
Required updating nebula ospackage plugin as setuid was broken in gradle 8.3.
2023-09-27 08:48:21 +02:00
Rene Groeschke 9cda6d1e95
Restrict access to Legacy Gradle plugins (#99581)
This ensures new projects will not use legacy gradle plugins
2023-09-18 17:07:22 +02:00
Brian Seeders dfadca83f6
[buildkite] Add Windows packaging and platform support tests to periodic pipeline (#98072) 2023-08-09 11:51:13 -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
Rene Groeschke b8627079b4
Update Gradle Wrapper to 8.2 (#96686)
- Convention usage has been deprecated and was fixed in our build files
- Fix test dependencies and deprecation
2023-07-04 15:35:15 +02: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 3e248342a9
Tweak test output path normalization edge cases (#96090)
Fixes #96079
2023-05-16 11:08:53 +02: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
Rene Groeschke 44cc172219
Update Gradle wrapper to 8.1 (#94663)
- Udpate docker compose plugin to use 8.1 compliant version
- Fix deprecations of test task configurations
2023-04-13 16:11:51 +02:00
Ryan Ernst 0b32530c11
Remove reading Lucene version from bwc versions build logic (#94917)
Version.java currently contains mappings to the Lucene version for each
Elasticsearch version. The only use of this in the build logic is for
filtering based on index compatibility. However, that compatibility can
be inferred based on the Elasticsearch major version since there is a
one to one mapping between Elasticsearch major and Lucene major. This
commit removes Lucene version extraction from the build bwc logic.
2023-04-06 20:18:06 -04: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 063fd6d204
Use absolute paths for JVM arguments in test clusters (#94567) 2023-03-21 09:15:53 -07:00
Rene Groeschke 9ce5baed0c
Update Gradle wrapper to 8.0.2 (#92751)
- Remove custom checksum build logic in wrapper task
- Adjust jdk home handling adjusting the change in behaviour in gradle. Requires providing canonical paths for provisioned jdk homes.
- Fix test by add workaround to bug in configuration cache
2023-03-09 13:00:12 +01:00
Rene Groeschke 08845b78f2
Update Gradle Wrapper to 7.6.1 (#89796) (#92241) (#94122)
This updates the gradle wrapper to 7.6.1. This patch release contains a
fix for  incremental compilation of java modules we have raised against
gradle 7.6

see https://github.com/gradle/gradle/issues/23067
2023-02-24 11:48:08 -05:00
Przemyslaw Gomulka f7ac79f346
[Stable plugin api] Clean up comments and variable names in gradle (#93501)
in example plugins a pluginApiVersion is more appropriate than elasticsearchVersion as it better implies that it can be different then the version of ES cluster
2023-02-21 15:45:05 +01:00
Tim Vernum 6e402ad179
Use cert-pinning in test cluster wait-for-health (#92657)
The previous model relied on treating the server's certificate
configuration as a trust anchor. This isn't guaranteed to work,
which lead to needing to support "certificate_authorities" as an
alternative, which in turn polluted the node's config with settings
that only existed to enable tests to run.

The new model ties the "wait-for-health" HTTP client to the leaf
certificates themselves. This means that it will always connect to a
node that has the exact certificates it expects, and doesn't rely on
knowing the issuer of the node's certificate.
2023-02-06 17:40:43 +11:00
Mark Vieira feb1f51803
Make `--debug-server-jvm` work with new test framework (#93355) 2023-01-30 15:15:05 -08:00
Gordon Brown f21881369c
Add Remote Cluster port to support RCS 2.0 (#91667)
This PR adds settings and infrastructure to support a new Remote Cluster port,
to be used in Remote Cluster Security 2.0. Specifically, this commit adds new
settings that allow opening a new Remote Cluster port, which will eventually
exclusively support the new cross-cluster authentication method. Since support
for that new authentication method is still under construction, these settings
are hidden behind a feature flag.

The new settings cover all Transport profile settings, to ensure that users will
not have to be exposed to Transport Profiles directly to make use of RCS2.0
functionality. This includes all core settings, as well as IP filter and SSL
configuration.

Co-authored-by: Yang Wang <yang.wang@elastic.co>
2023-01-16 12:31:23 +11:00
Przemyslaw Gomulka 2cdaabe783
[Stable plugin api] Drop api suffix in package names (#92905)
Refactoring that drops the api suffix from package name
This will have to be followed up by a plugins/examples fix in imports
Also set an artifact group name to `org.elasticsearch.plugin` in the plugin-api and plugin-analysis-api
2023-01-14 09:49:37 +01:00
Przemyslaw Gomulka ed83f9cc86
Refactor plugin scanning into lib (#92437)
new stable plugins require generated named_components.json file which contains all analysis components implemented by this plugin. The generation is currently done in build-tools by elasticsearch.stable-esplugin
However this makes the generation only available for plugins using gradle. Plugin developers using maven or other building tooling will not be able to use it.

This commits refactors the scanning logic into libs:plugin-scanner which will allow for plugin install command to perform the scanning too.

relates #88980
2023-01-09 15:25:54 +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
Rene Groeschke 8b9f3b595f
Revert "Update to Gradle 7.6 (#89796)" (#92241)
We have seen reports of broken compilation after a clean build
after updating to gradle 7.6.

This reverts commit deaf92878a.
2022-12-08 17:55:45 +01:00
Rene Groeschke deaf92878a
Update to Gradle 7.6 (#89796)
* Fix TestResultProcessor api changes
* Fix inputs for generateProviderManifest
* Ignore tests for now until gradle has fixed reporting issue
* Fix dependency substitution in example plugins build
* Use right java bin path on windows
* Add hint to task onlyif when no docker is available
2022-12-08 11:11:13 +01:00
Rene Groeschke 52db051967
Ensure rerunning querying-cluster tests in basic license tests supported (#92194) 2022-12-07 09:37:24 -05:00
Przemyslaw Gomulka 73ad49ac51
Rename NamedComponent name parameter to value (#91306)
to allow @NamedComponent("name") syntax java annotation should have single value annotation

relates #88980
2022-11-04 14:20:44 +01:00
Jake Landis 4d27313aa9
[fips] do not expliclity set the default distro (#91101)
This commit no longer explicitly sets the default configuration for FIPS tests.
This allows each project's tests to run in FIPS mode with out deviation (other
than the FIPS mode).

A side product of this change is that any REST test
can now enable security if they so choose without needing to use the default
distribution. This allows for additional usage of the integ_test distribution
which can help with testing modularization.

This only possible now that the security plugin is always included
with the integ_test distribution via #77632

fixes: #70005
related: #77632
2022-10-26 10:19:39 -05:00
Przemyslaw Gomulka 9bebec2868
Normalize paths for stable plugin test (#90811)
gradle on windows does not like \. Normalized method should replace it with /
closes #90793
2022-10-13 15:54:39 +02:00
Przemyslaw Gomulka 6d3b2ead07
Make extendedPlugins, HasNativeController and moduleName optional in plugin descriptor (#90835)
Stable plugins do not use className, extendedPlugins and hasNativeController properties. They also don't necessarily have moduleName.
These properties should not be present in stable-plugin-descriptor, even if they are empty because the parsing will fail complaining about unused properties.

Old plugins can use these properties, but they use defaults when the property is not present These defaults are:
has.native.controller = false
extended.plugins = emptyList
moduleName = null
classname is required and will throw exception when old plugin is not configuring this property

relates #88980
2022-10-12 15:32:09 +02:00
Rene Groeschke fe93b8161b
Provide default jarHell configuration dependencies (#90810)
With the new StableBuildPlugin we do not add default dependencies to the plugin classpath.
That exposed an issue with the JarHellPlugin not really taking care of configuring the
jarHell configuration.
The JarHell Plugin only worked so far as the plugin build plugin has added a transitive dependency
to elasticsearch-core and therefore kind of only worked by accident-.

This adds a default configuration of the jarHell configuration that can be overridden manually.
Furthermore we clear some inter plugin dependencies explicit and add proper functional
test coverage
2022-10-12 14:15:30 +02:00
Rene Groeschke 5a721b9100
Fix plugin wiring in yaml rest test plugin (#90818)
Ensure we wire the plugin under development correctly in yaml rest test
plugins
2022-10-11 17:51:32 -04:00
Przemyslaw Gomulka d1f2b5d79d
Create gradle plugin for ES stable plugins (#90355)
New ES stable plugins when built should have a stable-plugin-descriptor.properties file instead of plugin-descriptor.properties.
New plugins also do not use classname property in the plugin descriptor
new plugin will also scan classes and libraries for @NamedComponents and will create named_components.json file. That file contains a map of Extensible interface (like TokenizerFactory) to a map of "component name" to "className"

This commit extracts common logic from PluginBuildPlugin into BasePluginBuildPLugin so that it can also be used by StableBuildPlugin
the differences are:
classaname - used in old plugin, but not in the new one (stable)
the plugin descriptor file name - the new one has stable-plugin-descriptor.properties
dependencies - the new plugin does not need elasticsearch as a dependency.
We might want to consider if we want to add test framework dependency in the future.

relates #88980
2022-10-10 08:49:11 +02:00
Mark Vieira bd50658366
Fix mistakenly inverted conditional (#90532)
A build is considered included in a composite if it has a parent. So
this should check of the parent is NOT null.
2022-09-29 11:53:20 -07:00
Mark Vieira ebd778ba92
Use explicit CLI option for enabling transport layer TLS (#90488) 2022-09-28 16:19:09 -07:00
Mark Vieira d5f9e2ca2d
Don't print global build info header in included builds (#90490)
When including a build which applies the global build info plugin in a
composite we don't want to print this header out. It's like that a) it's
non-applicable to the outer build, or b) the outer build will also apply
this plugin resulting in duplicate output.
2022-09-29 08:08:35 +09:30
Jake Landis 7729972df5
Add tls support to gradle run/run-ccs (#90051)
This commit adds TLS for the transport layer and optional support 
for https for `./gradlew run` and `./gradlew run-ccs` tasks.
A new system property --https can be passed to expose https.
Transport layer TLS is always enabled which is always applicable 
for `./gradlew run-css`, but only applicable for `./gradlew run` when multiple nodes are configured.
Additional certificates and instructions for use are also included in the commit.
2022-09-26 18:19:32 -05:00
Mark Vieira fa38d1ba8f
Allow for building multi-arch docker images via buildx (#89986) 2022-09-13 08:32:55 -07:00
Jake Landis 54e13093bf
simplify ./gradlew run-ccs (#89711)
This commit reverts the changes introduced via https://github.com/elastic/elasticsearch/pull/89442 / 20ed7e3fd9
and re-implements the same goals but with fewer changes. Also included in this commit 
is the ability to change the proxyMode via system property and mention of this
new run task in the testing documentation.
2022-08-30 12:41:14 -05:00
Jake Landis d7de930f0a
Better support for multiple nodes via ./gradlew run (#89563)
This commit makes minor changes to support multiple nodes
via ./gradlew run. The specific desired use case, where there 2 nodes
in the cluster where one is a coordinating only node is used as
the example configuration.
2022-08-29 17:26:38 -05:00
Jake Landis 20ed7e3fd9
Better support for multi cluster for run task (#89442)
This commit introduces a `./gradlew run-ccs` task with the following goals:
* mirror the ease of use of `./gradlew run` for manual cross cluster search development
  * same credentials
  * same well known ports
  * uses ccs specific naming
  * enable debugging across both clusters

This is admittedly kinda hacky. Test clusters have support multi-cluster and are in use for 
 for automated testing. There are some nuances that make that setup (and this setup) 
a bit cumbersome..specifically needing to read one cluster's config to configure another cluster. 

The run task adds a bit more config (well defined ports, etc.) than the tests need to 
so that also complicates this abit more. I found that without the additions here I was unable to get both 
sharing of cluster configuration (like in the [tests](https://github.com/elastic/elasticsearch/blob/main/qa/ccs-common-rest/build.gradle#L55)) 
and the run task's hard coded config to work well together. Hopefully the additions to the run task are not
too hacky as I could not find any other way.
2022-08-18 12:54:03 -05:00
Rene Groeschke c4c1802fb1
Unify handling of custom Gradle User home in build tool tests (#89304)
- keep guh separated from test project dir
- unify folder handling

as a side effect when keeping the project dir for debugging failed tests we do not copy the whole GUH which usually isn't providing any additional help for debugging those
2022-08-15 12:09:47 +02:00
Rene Groeschke da3e4e8a0b
Keep test folders of failed build tools integration tests (#89296)
This simplifies our debugging logic we have in place to keep the test
build environment for failed tests, making debugging easier without
dealing with magic flags
2022-08-12 16:45:30 +09:30
Chris Hegarty a67920e1dc
Add file delete retry to testcluster ElasticsearchNode (#89095)
Add retry logic for cleanup / deletion in testcluster's
ElasticsearchNode, to tolerate the asynchronous nature of deletions
on the Windows file-system.
2022-08-07 11:16:49 +01:00
Mark Vieira 9e9f19bc9c Further attempt at capturing reaper error logs 2022-08-02 14:47:53 -07:00
Mark Vieira 898b373169
Reinstate test cluster throttling behavior (#88664)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2022-07-21 12:24:24 +02:00
Rene Groeschke 160b14fbb1
Remove random runner from build tools (internal) tests (#88577)
This removes unrequited overhead for writing build tool and build tool internal tests and mechanically ports all junit3 tests to junit4.
2022-07-20 08:04:26 +02:00
Rene Groeschke 98b789c940
Update to to Gradle wrapper 7.5 (#85141)
This updates the gradle wrapper to a 7.5

Fixes #85123
2022-07-19 08:12:19 +02:00
Rene Groeschke 48d3063791
Remove duplicate definition of checkstyle version in use (#88339)
We only rely on the checkstyle version in the buildLibs.toml gradle version catalogue with this change.
Also added some hints for gradle best practices.

This is an aftermath of #88283
2022-07-15 19:31:50 +02:00
Rene Groeschke a2ee4c5393
Polish reworked LoggedExec task (#88424)
Some polishing of reworked LoggedExec task
2022-07-12 12:48:56 +02:00