Commit graph

79 commits

Author SHA1 Message Date
Rene Groeschke
a080bb2bbe
[7.17] Update gradle wrapper to 8.3 (#97838) (#100715)
* 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.

(cherry picked from commit b23e000c30)

# Conflicts:
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/LegacyYamlRestCompatTestPluginFuncTest.groovy
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaModulePathPlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/AbstractYamlRestCompatTestPlugin.java
#	build-tools-internal/src/main/resources/minimumGradleVersion
#	gradle/verification-metadata.xml
#	gradle/wrapper/gradle-wrapper.jar
#	gradlew
#	x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java

* [7.17] Use patched nebula os package gradle plugin

* Update testingconvention precommit integ test
2023-10-16 06:18:08 -04:00
Rene Groeschke
5afd06ae57
[7.17] Update Gradle Wrapper to 8.2 (#96686) (#97484)
* 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-09-27 08:46:44 +02:00
Brian Seeders
a95036757b
[7.17] [buildkite] Add Windows packaging and platform support tests to periodic pipeline (#98072) (#98329)
* [buildkite] Add Windows packaging and platform support tests to periodic pipeline (#98072)

(cherry picked from commit dfadca83f6)
2023-08-28 13:26:12 -04:00
Mark Vieira
18a5be3c30
[7.17] Convert full cluster restart tests to new rest testing framework (#93422) (#93432)
* Convert full cluster restart tests to new rest testing framework (#93422)

# Conflicts:
#	qa/full-cluster-restart/build.gradle
#	qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/FullClusterRestartIT.java
#	qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.java
#	qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/QueryBuilderBWCIT.java
#	x-pack/plugin/shutdown/qa/full-cluster-restart/build.gradle
#	x-pack/plugin/shutdown/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/build.gradle
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/FullClusterRestartSettingsUpgradeIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MLModelDeploymentFullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MlConfigIndexMappingsFullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MlHiddenIndicesFullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/resources/system_key

* Fixes

* Fix warning failures

* Fix heap dump path

* More fixes

* Fix test cluster security setup on Windows

* Use relative path for script execution

* More, more fixes

* Fix warning error

* More fixes

* Fix security warning
2023-02-02 17:58:30 -05:00
Mark Vieira
bfd8cd84c3
Make --debug-server-jvm work with new test framework (#93355) (#93361) 2023-01-31 10:49:07 -08:00
Mark Vieira
9e1ec97dcf
[7.17] Migrate core rest tests with security to new testing framework (#92575) (#92686)
* Migrate core rest tests with security to new testing framework (#92575)

# Conflicts:
#	x-pack/qa/core-rest-tests-with-security/build.gradle

* Fixes

* More fixes

* More fixes

* More more fixes
2023-01-04 19:17:57 -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
Rene Groeschke
1744a57312
Revert "[7.17] Update to Gradle 7.6 (#89796) (#92235)"
This reverts commit fc43f0105c.
2022-12-20 12:30:21 +01:00
Rene Groeschke
fc43f0105c
[7.17] Update to Gradle 7.6 (#89796) (#92235)
* 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 16:48:35 +01:00
Mark Vieira
2da13b44cb
[7.17] Allow for building multi-arch docker images via buildx (#89986) (#90047) 2022-09-13 17:49:19 -07:00
Rene Groeschke
de01d4b5af
Unify handling of custom Gradle User home in build tool tests (#89304) (#89402)
Backports the following commits to 7.17:
 - Unify handling of custom Gradle User home in build tool tests (#89304)
2022-08-17 09:20:38 +02:00
Rene Groeschke
ada18520ae
Keep test folders of failed build tools integration tests (#89296) (#89308)
Backports the following commits to 7.17:
 - Keep test folders of failed build tools integration tests (#89296)
2022-08-12 15:35:35 +02:00
Mark Vieira
65d997d797 Further attempt at capturing reaper error logs 2022-08-11 15:12:10 -07:00
Rene Groeschke
c28e5fa83a
[7.17] Remove random runner from build tools (internal) tests (#88577) (#88628)
Backports the following commits to 7.17:
 - Remove random runner from build tools (internal) tests (#88577)
2022-07-25 15:38:57 +02:00
Rene Groeschke
2e93563cd2
Port all remaining build-tool tests to spock (#88089) (#88676)
- Make our build tool tests more readable
- One step closer to remove outdated test fixtures like GradleUnitTestCase and friends

Didn't port some basic setter getter tests like PluginExtensionTests as it does not add much value and we have integration test coverage for this stuff too
# Conflicts:
#	build-tools-internal/src/test/java/org/elasticsearch/gradle/DistributionDownloadPluginTests.java
#	build-tools-internal/src/test/java/org/elasticsearch/gradle/testclusters/WaitForHttpResourceTests.java
#	build-tools/src/test/java/org/elasticsearch/gradle/testclusters/WaitForHttpResourceTests.java
2022-07-21 21:13:02 +09:30
Mark Vieira
f913aafa17
Reinstate test cluster throttling behavior (#88664) (#88674)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2022-07-21 20:46:05 +09:30
Rene Groeschke
df0e71e2f9
[7.17] Port Thirdparty audit task tests to spock (#86832) (#88633)
Backports the following commits to 7.17:
 - Port Thirdparty audit task tests to spock (#86832)
2022-07-21 09:16:12 +02:00
Rene Groeschke
debee7507b
Port buildResources func tests to spock (#86756) (#88632)
Backports the following commits to 7.17:
 - Port buildResources func tests to spock (#86756)
2022-07-20 10:25:49 +02:00
Rene Groeschke
1ac5a9dfa5
[7.17] Simplify reaper tests to use spock (#86721) (#88629)
Backports the following commits to 7.17:
 - Simplify reaper tests to use spock (#86721)
2022-07-20 09:03:47 +02:00
Rene Groeschke
5044a3e035
[7.17] Remove duplicate definition of checkstyle version in use (#88339) (#88574)
Backports the following commits to 7.17:
 - Remove duplicate definition of checkstyle version in use (#88339)
2022-07-19 11:37:12 +02:00
Rene Groeschke
e1979fe81b
Update to to Gradle wrapper 7.5 (#85141) (#88595)
Backports the following commits to 7.17:
 - Update to to Gradle wrapper 7.5 (#85141)
2022-07-19 11:33:32 +02:00
Rene Groeschke
5e7df59b8c
[7.17] Run gradle integration tests with configuration cache enabled by default (#88148) (#88578)
Backports the following commits to 7.17:
 - Run gradle integration tests with configuration cache enabled by default (#88148)
2022-07-18 13:06:36 +02:00
Rene Groeschke
98d18185ae
[7.17] Setup elasticsearch dependency monitoring with Snyk for production code (#88036) (#88223)
Backports the following commits to 7.17:
 - Setup elasticsearch dependency monitoring with Snyk for production code (#88036)
2022-07-04 08:36:35 +02:00
Mark Vieira
455153e73f
Use Azul Zulu JDK8 distribution instead of Adoptium/OpenJDK on MacOS with Apple Silicon (#87733) (#87935)
# Conflicts:
#	x-pack/qa/repository-old-versions/build.gradle

Co-authored-by: Amey Kulkarni <ameykulkarni@live.in>
2022-06-22 18:03:03 -04:00
Mark Vieira
d764a01edc
[7.17] Skip ML tests on later glibc for incompatible BWC versions (#87487)
* Skip ML tests on later glibc for incompatible BWC versions

* More flexible version parsing

* Use relaxed mode for parsing glibc version

* Missed a spot

* spotless
2022-06-07 19:13:05 -04:00
Rene Groeschke
3ffbc17437
[7.17] Fix javadoc plugin func tests on windows (#86674) (#86734)
* Fix javadoc plugin func tests on windows (#86674)

Handle special javadoc options path format
# Conflicts:
#	build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/TestUtils.java

* Fix merge issues
2022-05-12 11:15:58 -04:00
Rene Groeschke
e44106b3dc
Port build dependencies to gradle version catalogue (#86548) (#86599)
Backports the following commits to 7.17:
 - Port build dependencies to gradle version catalogue (#86548)
2022-05-11 10:04:52 +02:00
Rene Groeschke
506c08aab6
[7.17] Port javadoc configuration logic into a binary plugin (#86471) (#86593)
* Port javadoc configuration logic into a binary plugin (#86471)

Also adding test coverage and fixing certain issues we stumbled into

when resolving project dependencies of compileClasspath we need to use allDependencies instead of dependencies as usually no dependencies are added directly to compileClasspath but via implementation, compileonly and api and friends
Fixed javadoc setup for projects using shadowed dependencies via shadow plugin
Fixed dealing with skipped javadoc tasks in referenced dependent projects.
In general this PR only fixes expected javadoc generation as it was intended before this PR.

This also contains some tweaks to our gradle integration test fixtures for setting up and debugging test projects
# Conflicts:
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractRestResourcesFuncTest.groovy
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/InternalYamlRestTestPluginFuncTest.groovy
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy
#	build-tools/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy
#	build-tools/src/testFixtures/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleFuncTest.groovy

* Fix merge conflicts for backporting
2022-05-10 06:14:55 -04:00
Rory Hunter
7e74ec31ab Switch to OpenJDK and upgrade to 18.0.1 (#86554)
Adoptium releases are very slow to release across multiple platforms.
Switch back to Oracle's OpenJDK releases and upgrade.
2022-05-09 17:23:44 +01:00
Rene Groeschke
8c0f4b9a89
Update asm version in build tools for java19 support (#86288) (#86338)
This also fixes issues with using asm in functional tests where
spock dependencies brought in an older version of asm not compatible
with java 18
2022-05-02 11:53:13 +02:00
Rene Groeschke
a2c2f3f6fe
Align spock platform used in build-tool and build-tool-internal (#86276) (#86278) 2022-04-28 19:08:11 -04:00
Ryan Ernst
72e4da9eb6
Do not reuse ES log file in testclusters (#85576) (#86088)
* Do not reuse ES log file in testclusters (#85576)

In #85349 we restored capturing the stdout and stderr of Elasticsearch
processes started by testclusters. However, since testclusters launches
Elasticsearch in the forground for each process, the log output is
duplicated to stdout. This commit changes the redirects to use a
unique file, separate from ES's log file.

closes #85553

* remove unused
2022-04-21 16:39:56 -04:00
Lee Hinman
acf13e00e2
[7.17] Bump commons-compress to 1.21 (#85581) (#85681)
* Bump commons-compress to 1.21 (#85581)

This updates the dependency version for the Apache commons compress
project to 1.21
# Conflicts:
#	build-tools/build.gradle
#	distribution/tools/geoip-cli/build.gradle
#	test/x-content/build.gradle

* Fix backport
2022-04-04 11:45:31 -04:00
Ryan Ernst
ba3b1e3807
Redirect testclusters ES process stdout/stderr to log file (#85349) (#85350)
Although most of the time the stdout and stderr of the Java process is
not needed since ES has its own log file, there are some cases where it
is very important to have the output before ES has initialized its
logging system. This commit changes the stdout/stderr of the ES process
created by testclusters to use the same log file that ES will write to.
There should not be contention with ProcessBuilder and ES trying to
write at the same time because ES swaps out the stream handles to write
to its logging system, so after that point ProcessBuilder will never see
anymore output.

relates #68333
2022-03-24 21:33:06 -04:00
Rene Groeschke
1e808de8ff
[7.17] Replace getProject() references with injected services in task implementations where possible (#81681) (#84332)
* Replace getProject() references with injected services in task implementations where possible (#81681)

- Rework task implementations to avoid project usage at execution time
- In general usages of getProject() within a task should be avoided as it is not compatible
with gradle configuration cache. Related to #57918

Co-authored-by: Mark Vieira <portugee@gmail.com>
2022-02-24 16:52:38 +01: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
Tim Vernum
aa59ba040c
Add explicit "roles.yml" support to testclusters (#82302)
Previously, within tests, the file "roles.yml" (that is used to define
security roles in a cluster) would need to be configured using
`extraConfigFile`. This is effective, but means that there can only be
a single source of security roles for the testcluster.

This change introduces an explicit "securityRoles" setting in
testclusters that will concatenate the provided files into a single
"roles.yml" in the config directory. This makes it possible for
testclusters itself to define standard roles as well as having each
test define additional roles it may need.

Relates: #81400

Backport of: #82137
2022-01-06 00:54:02 -05:00
Mark Vieira
e488750ad2
Handle wrapped IO exceptions in test cluster distribution syncing (#82288) (#82299)
Third attempt at sorting out this problem after #82154 didn't do the
trick. The issue is that `FileTreeIterator` wraps the root cause
exception in an `UncheckedIOException` so to detect this scenario
properly we actually have to inspect the cause.
2022-01-05 22:04:02 -05:00
Mark Vieira
0854d448a0
Ignore errors syncing ephemeral files in test clusters (#82154) (#82222) 2022-01-04 13:49:53 -05:00
Mark Vieira
1cd264036c
Ignore temporary files when syncing test cluster distribution (#81482) (#81555) 2021-12-08 15:30:09 -05:00
Mark Vieira
85d12e5b5b
Support additional version schemes in relaxed mode (#81010) (#81021) 2021-11-24 16:57:07 -05:00
Mark Vieira
3e22fe029a
Fix references to moved classes in plugin examples (#80736) (#80740)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-11-15 17:24:55 -05:00
David Turner
ff91b805ce
Upgrade JNA to 5.10.0 (#80617) (#80647)
This commit upgrades JNA to 5.10.0. The primary reason for this upgrade
is to adopt a newer version of `libffi` which supports the
`LIBFFI_TMPDIR` environment variable so that we can change the location
of temporary executables and resolve #77014.

This commit also switches to the upstream JNA releases rather than using
the specially-repackaged ones we've used in the past.
2021-11-11 03:13:35 -05:00
Przemyslaw Gomulka
4aed60d8b9
Fix unused import (#79376) 2021-10-18 18:57:16 +02:00
Przemyslaw Gomulka
e25cf1abeb
Deprecation logs indexing is enabled by default. Backport(#78991) (#79035)
Changing the default for deprecation log indexing to be true.
This commit also overrides this default to tests where a deprecation
data stream would interfere - because it uses index template, it would
not be possible to delete with _index_template/*.
The overrides should be removed when #78850 is done.

closes #76292
backport #78991
2021-10-18 18:36:59 +02:00
Mark Vieira
3f62938cdb
Ensure modules extending x-pack modules properly configure test clusters (#79176) (#79196)
# Conflicts:
#	build-tools/src/main/java/org/elasticsearch/gradle/plugin/PluginBuildPlugin.java
2021-10-14 17:55:15 -04:00
Mark Vieira
090f74343d
Allow for debugging of rest test clusters during test execution (#79085) (#79194) 2021-10-14 13:52:25 -07:00
Mark Vieira
6fcc618835
[7.x] Separate minimum compiler and runtime Java version properties (#79108) (#79183) 2021-10-14 12:26:56 -07:00
Rory Hunter
562440a950 Format build-tools and build-tools-internal (#78910)
Our spotless configuration wasn't being applied to `build-tools`
and `build-tools-internal`. Move the Spotless configuration to a
Java plugin in `build-conventions`, and apply it everywhere.

This resulted in a lot more Java files being subject to formatting,
so I added more exclusions to the list.

Also remove the `paddedCell` stuff, we've never needed it.
2021-10-14 10:08:46 +01:00
Rene Groeschke
5051b20caa
Simplify TestCluster extraJar configuration (#78837) (#78906)
Allow passing FileCollection instead of single Jar files. This makes using the API way easier
as gradle configurations for resolving jars do not need to be resolved eagerly
2021-10-11 05:46:08 -04:00