Commit graph

212 commits

Author SHA1 Message Date
Mark Vieira
e206f6e44e
Move muted tests file and allow for additional files to be configured (#107916)
Some refactoring to the muted tests plugin to better support usage in a
composite build configuration.
2024-04-25 15:45:30 -04:00
Rene Groeschke
a0caf336e6
Support mdx file format for docs (#107428)
Adding support for MDX files in our :docs project. We parse those *.mdx files
like we do for asciidoc files for code snippets and generate yaml specs from them that
we test as part of our integration tests.

By default:
When searching for doc sources in the docs folder we fail the build if we detect multiple files of
the same name but different extension. E.g. having painless-field-context.mdx
and painless-field-context.asciidoc in the same source folder will fail the build.

Migration Mode:
To allow easier migration from asciidoc to mdx the build supports a kind of migration mode.
When running the build with -Dgradle.docs.migration=true (e.g. ./gradlew buildRestTests -Dgradle.docs.migration=true)

Duplicate doc source files (asciidoc and mdx) are allowed
The Generated yaml rest specs for duplicates will have the extension *.mdx.yml or *asciidoc.yml.
The generated yaml rest specs for duplicates are compared to each other to ensure they produce the same yml output.
2024-04-25 09:38:46 +02:00
Brian Seeders
bb0bc17ece
Muted test automation (#106784) 2024-04-18 10:19:27 -07:00
Moritz Mack
de3e2e4ef2
Remove deprecated APM setting from RunTask (#105076) 2024-03-19 11:26:08 +01:00
Ryan Ernst
405b88b882
Add zstd to native access (#105715)
This commit makes zstd compression available to Elasticsearch. The
library is pulled in through maven in jar files for each platform, then
bundled in a new platform directory under lib. Access to the zstd
compression/decompression is through NativeAccess.
2024-03-13 09:45:12 -07:00
Ryan Ernst
abd2722228
Cleanup subproject creation in build tests (#105998)
Sometimes subprojects are created by build tests. There exists a utility
function to define the subproject build file. Yet some tests add the
project to settings and then configure through the subprojects directive
in the root build file. This commit cleans up two such cases to use
explicit subproject build files.
2024-03-06 12:27:30 -08:00
Tim Vernum
e9ff896738
Fix gradle run on Serverless (#105938)
On Serverless it is not possible to configure deprecation indexing (it
is always off). This commit updates the behaviour of
`ElasticsearchCluster` to no longer attempt to configure deprecation
indexing on stateless nodes.
2024-03-05 12:53:25 +01:00
Armin Braun
3f8bc36788
Fix Gradle File leaks (#105597)
Fixing a couple of file leaks (and cleaning up one missing
try-with-resources). The directory descriptor leaks in particular
were leaking massively on every precommit run, to the point where it
slows down the whole system and/or we're running into descriptor limits.
2024-02-18 17:56:22 +01:00
Dmitry Cherniachenko
a50e58d99a
Use single-char variant of String.indexOf() where possible (#105205)
* Use single-char variant of String.indexOf() where possible

indexOf(char) is more efficient than searching for the same one-character String.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-02-12 14:14:32 -05:00
Dmitry Cherniachenko
e21a4874ab
Use String.replace() instead of replaceAll() for non-regexp replacements (#105127)
* Use String.replace() instead of replaceAll() for non-regexp replacements

When arguments do not make use of regexp features replace() is a more efficient option, especially the char-variant.
2024-02-12 13:11:15 -05:00
Dmitry Cherniachenko
263ea5e987
Replace generic HashSet / HashMap with more efficient EnumSet / EnumMap (#105238) 2024-02-08 13:43:14 +00:00
Moritz Mack
dbf59c5414
Update/Cleanup references to old tracing.apm.* legacy settings in favor of the telemetry.* settings (#104917) 2024-01-31 09:20:05 +01:00
Moritz Mack
00ca64bcf2
Use allow-list for APM agent settings and consolidate defaults in APMJvmOptions (#104141)
Prevent invalid and miss-configuration of APM agent using an explicit allow-list of setting keys.
Additionally, configuration defaults of APMAgentSettings are consolidated in APMJvmOptions to keep defaults in a single location.
(ES-6916)
2024-01-12 10:30:04 +01:00
Armin Braun
21386c784f
Fix all "lambda can be folded" warnings in the codebase (#104020)
Just some obvious cleanup.
2024-01-08 12:51:30 +01:00
Mark Vieira
a9546a07f2
Disable incremental compilation in CI environments (#103346) 2023-12-12 13:10:27 -08:00
Przemyslaw Gomulka
543919b7f3
Enable APM tracing when --with-apm-server is used (#103268)
when runtask (gradlew run) task is run with --with-apm-server apm tracing should also be enabled
2023-12-11 15:12:28 +01:00
Przemyslaw Gomulka
fc9991aa4e
Disable metrics sending only when the setting was not used explicitly (#102796)
RunTaks is used by both statefull and serverless.
when --with-apm-server is used, `telemetry.metrics.enabled` is always turned to true
and server_url is set to localhost
However when --with-apm-server is NOT used, then we should disable `telemetry.metrics.enabled`
only if that setting was not explicitly used. This explicte use is for instance when
running gradlew run and configuring ES to send to ESS cluster
a follow up from https://github.com/elastic/elasticsearch/pull/101941/files#r1388403805
2023-11-30 12:48:40 +01:00
Przemyslaw Gomulka
3b834b5db6
Reuse running mock apm server (#102698)
When a test cluster in serverless is run with --with-apm-server
3 nodes were attempting to start apm server. This was throwing an exception.

There is no harm in reusing the already running apm server,
and in fact is more realistic
2023-11-29 11:32:41 +01:00
Rene Groeschke
4a9b4bc982
Make Legacy test cluster infrastructure configuration cache compatible (#101903)
* Move TestCluster plugin and module setup from Node to Cluster
* Do not materialize unused TestCluster
* Fix lazy test cluster evaluation
* Register artifact transforms ones per project
* Make task caching for TestClusterAware tasks CC compatible
* Move stateful logic out of taskgraph.whenready
2023-11-28 12:15:03 +01:00
Lorenzo Dematté
6c177981d0
Adding option to debug the cli launcher (#102464)
* Adding debug args to cli tools
* Adding instructions
2023-11-28 10:26:09 +01:00
Mark Vieira
9a50817752
Avoid eagerly resolving dependencies when configuring packaging tests (#102171) 2023-11-14 11:59:26 -08:00
Przemyslaw Gomulka
54afb1b65d
Disable apm metrics for RunTask when --with-apm-server flag is not set (#101941)
With apm metrics being enabled by default in serverless, the run task should only allow for apm integration and starting the server when --with-apm-server is switch on
When the flag is not present, the apm metrics should be disabled and apm server not started
2023-11-13 17:28:12 +01:00
Rene Groeschke
aa48860fac
Make YamlRestTest and ElasticDistributionPlugin cc compatible (#101923)
* Make YamlRestTest and ElasticDistributionPlugin cc compatible

These changes are addressing configuration cache incompatibilities of running
rest tests with the new ClassRule based Elasticsearch test cluster setup.

This allows running those tests with configuration cache enabled:
`./gradlew :modules:ingest-user-info:yamlRestTest --configuration-cache`
2023-11-10 08:02:53 +01:00
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