Commit Graph

1534 Commits

Author SHA1 Message Date
Alpar Torok f2d68934e8 Only log vagrant output on failure (#48402) 2019-10-30 10:40:44 +02:00
Alpar Torok d004a560df Upgrade to Gradle 5.6.3 (#48235)
This PR upgrades to [5.6.3](https://github.com/gradle/gradle/releases/tag/v5.6.3).
Nothing particualrily of interest for us, just keeping up to date.
2019-10-29 14:48:03 +02:00
Mark Vieira e5c6440a4f
Simplify usage of Gradle Shadow plugin (#48478) (#48597)
This commit simplifies and standardizes our usage of the Gradle Shadow
plugin to conform more to plugin conventions. The custom "bundle" plugin
has been removed as it's not necessary and performs the same function
as the Shadow plugin's default behavior with existing configurations.

Additionally, this removes unnecessary creation of a "nodeps" artifact,
which is unnecessary because by default project dependencies will in
fact use the non-shadowed JAR unless explicitly depending on the
"shadow" configuration.

Finally, we've cleaned up the logic used for unit testing, so we are
now correctly testing against the shadow JAR when the plugin is applied.
This better represents a real-world scenario for consumers and provides
better test coverage for incorrectly declared dependencies.

(cherry picked from commit 3698131109c7e78bdd3a3340707e1c7b4740d310)
2019-10-28 12:11:55 -07:00
Jason Tedor 97f48168d9
Bump bundled JDK to JDK 13.0.1+9 (#48587)
This commit bumps the bundled JDK to 13.0.1+9. Since AdoptOpenJDK did
not release 13.0.1+9 for Windows, this commit also enables that the
bundled JDK version can vary by platform.
2019-10-28 12:31:33 -04:00
Tim Brooks 45e42f4e18
Upgrade to Netty 4.1.43 (#48484)
With this update we can remove the mitigation in our custom allocator
which forces heap buffer allocations.
2019-10-25 10:17:25 -06:00
Przemyslaw Gomulka aaa6209be6
[7.x] [Java.time] Calculate week of a year with ISO rules BACKPORT(#48209) (#48349)
Reverting the change introducing IsoLocal.ROOT and introducing IsoCalendarDataProvider that defaults start of the week to Monday and requires minimum 4 days in first week of a year. This extension is using java SPI mechanism and defaults for Locale.ROOT only.
It require jvm property java.locale.providers to be set with SPI,COMPAT

closes #41670
backport #48209
2019-10-23 17:39:38 +02:00
Alpar Torok cb9f45ad78 Always publish a build scan in CI (#48348)
* Always publish a build scan in CI

This PR changes the build scan configuration to alwasy publisha  build
scan when running in our CI.

We should alkready be passing these env vars into the Vagrant VM so this
will make it produce a build scan too.

The old properties to accept build scan ToS on the public server are
thus no longer relevant and will be cleaned up from the Jenkins config
once this is merged.

* Pass env vars to vagrant VM
* Enable running in parallel in the VM
* Add job name and build nomber as custom values
2019-10-23 13:27:56 +03:00
Alpar Torok 144e8a0f1a Use an env var for the classpath of jar hell task (#48240)
The classpath for some project could outgrow the max allowed command
line on Windows. Using an env var is not fault proof, but give more
breathing room
2019-10-22 11:17:19 +03:00
Tim Brooks 547e399dbf
Remove option to enable direct buffer pooling (#48310)
This commit removes the option to change the netty system properties to
reenable the direct buffer pooling. It also removes the need for us to
disable the buffer pooling in the system properties file. Instead, we
programmatically craete an allocator that is used by our networking
layer.

This commit does introduce an Elasticsearch property which allows the
user to fallback on the netty default allocator. If they choose this
option, they can configure the default allocator how they wish using the
standard netty properties.
2019-10-21 19:15:50 -06:00
Mark Vieira 178204703a
Add 'javadoc' task to lifecycle check tasks (#48214) 2019-10-21 09:45:01 -07:00
Alpar Torok 7d085ffbd9 Switch to debug with server=n (#48188)
Before this change one needed to re-start debugging several times, as we
launched multiple JVMs in debug mode.
With this option the IDE has the option to re-launch and listen for
connections again leading for to a more pleasant experience.
2019-10-21 15:07:04 +03:00
Alpar Torok c903ac2376
Fix download of 6.x rpm and deb packages (#48228) 2019-10-21 10:03:44 +03:00
Ignacio Vera b1224fca8c
upgrade to Lucene-8.3.0-snapshot-25968e3b75e (#48227) 2019-10-21 08:21:09 +02:00
Mark Vieira befc44c145
Cache all rest tests tasks so long as they don't use shared clusters (#48161) 2019-10-17 07:30:55 -07:00
jimczi b2dc98562b Bump version to 7.6 2019-10-16 15:57:12 +02:00
Uwe Schindler f0cb43fb96 Update forbiddenapis to v2.7 (#47969) 2019-10-15 16:58:55 +03:00
Alpar Torok 6c9305dc78 Partial Revert "Convert RunTask to use testclusers, remove ClusterFormationTasks (#47572)"
This reverts the removal of the ClusterFormationTaks from
commit 36d018c909 so they are usable for a
bit longer in the hadoop build.
2019-10-15 16:43:46 +03:00
Tim Brooks 8814bf07f1
Upgrade to Netty 4.1.42 (#48015)
Upgrades the netty version.
2019-10-14 13:54:02 -06:00
Ryan Ernst dc8080e88a Add snapshot support to distribution download plugin (#47837)
The distribution download plugin which handles finding built
distributions for testing currently only knows how to find locally built
snapshots. When an external Elasticsearch plugin uses build-tools, these
snapshots do not exist. This commit extends the download plugin so it
pulls from the Elastic snapshots service when used outside of the
Elasticsearch repository.

closes #47123
2019-10-11 16:14:43 -07:00
William Brafford fe8767789a
GlobalBuildInfo plugin should search packed references for commit IDs (#47464) (#47936)
* GlobalBuildInfo plugin searches packed references

In recent versions of Git, references may be packed in a packed-refs
file. If this happens, Gradle will need to look in that file to find
build information.
2019-10-11 14:47:34 -04:00
Alpar Torok 5cbc96ccb6
Fix dependency info tasks (#47857)
We fixed warnings related to task input and outputs in #45098.
This particular input was not considered, a warning was present for it
and Gradle didn't use it as part of task inputs.
As soon as we fixed it Gradle started considering it an input and
enforced that it exists.

With this change we make it optional as the task can work both wih and
without this directory.
2019-10-11 11:11:52 -05:00
Alpar Torok ec91fa5df1 Make the run task honor tests.es properties (#47860)
* Make the run task honor tests.es properties

Closes #47797

With this PR we now again honor tests.es and tests.heap.size

* remove debuging
2019-10-11 04:38:32 +03:00
Mark Vieira 5825d2df83
Resolve more Gradle task validation warnings (#47825)
(cherry picked from commit 82e3d5ea31101f4c27e69162684c3aa4fb2193a4)

# Conflicts:
#	buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy
2019-10-09 15:42:49 -07:00
Ryan Ernst 14b979a7bc Make internal project flag overrideable by tests (#47757)
In order to work with external elasticsearch plugins, some parts of
build-tools need to know when the current build is part of the
elasticsearch project or an external build. We identify these "internal"
builds by a marker in our buildSrc classpath. However, some build-tools
integ tests need to override this flag to test both the external and
internal behavior.

This commit moves the storage of the flag indicating whether we are
running in an internal build to global build info. This will allow
testkit projects to override the flag.
2019-10-09 12:01:30 -07:00
Ryan Ernst 813f44cec8 Move test seed setup to global build info (#47763)
The global build info plugin prints high level information about the
build, including the test seed. However, BuildPlugin sets up the test
seed, which creates an odd implicit dependency on it. This commit moves
the intialization of the testSeed property into the global build info.
2019-10-09 09:59:19 -07:00
Armin Braun edc3e9f0ab
Fix --debug-jvm Gradle Arg (#47773) (#47783)
This fixes the `--debug-jvm` arg to work again for
the `run` task.
Seems a recent refactoring of `RunTask` introduced
this obvious type.
2019-10-09 13:25:16 +02:00
Ryan Ernst 54c2aec38a Filter out special gradle threads from leak control (#47713)
This commit adds a thread filter for gradle unit tests which omits
threads gradle may create that we have no control over shutting down.
The current example of this is for project.exec which gradle pools.

closes #47417
2019-10-08 17:00:28 -07:00
Alpar Torok 36d018c909 Convert RunTask to use testclusers, remove ClusterFormationTasks (#47572)
* Convert RunTask to use testclusers, remove ClusterFormationTasks

This PR adds a new RunTask and a way for it to start a
testclusters cluster out of band and block on it to replace
the old RunTask that used ClusterFormationTasks.

With this we can now remove ClusterFormationTasks.
2019-10-08 14:43:29 +03:00
Alpar Torok bc85b22c1f
Complete testclusters backport (#47623)
* Use versions specific distribution folders so we don't need to clean up (#46539)

* Retry deleting distro dir on windows

When retarting the cluster we clean up old distribution files that might
still be in use by the OS.
Windows closes resources of ded processes async, so we do a couple of
retries to get arround it.

Closes #46014

* Avoid having to delete the distro folder.

* Remove the use of ClusterFormationTasks form RestTestTask (#47022)

This PR removes a use-case of the ClusterFormationTasks and converts a
project that flew under the radar so far.
There's probably more clean-up possible here, but for now the goal is
to be able to remove that code after `RunTask` is also updated.

* Migrate some 7.x only projects
2019-10-07 11:43:57 +03:00
Mark Vieira d966e5a9b9
Eliminate Gradle task input warnings (#47538)
(cherry picked from commit e86d40ff4576fb20c64fe88f01f13e201f3b948f)
2019-10-04 15:11:41 -07:00
Alpar Torok 2b16d7bcf8
Backport testclusters all (#47565)
* Bwc testclusters all (#46265)

Convert all bwc projects to testclusters

* Fix bwc versions config

* WIP fix rolling upgrade

* Fix bwc tests on old versions

* Fix rolling upgrade
2019-10-04 16:12:53 +03:00
Alpar Torok 97a0b7dcbc Make All OS tests run on GCP instances (#46924)
This PR makes the necesary adaptations to the tests and adds a power shell script to
invoke the OS tests on GCP instances connected as CI workers.

Also noticed that logs were not being produced by the tests and that theses were not using log4j so fixed that too.

One of the difficulties in working on theses tests was that the tests just stalled with no indication where the problem is.
To ease with the debugging, after process explorer suggested that the tests are running some commands, we now have multiple timeouts: one for the tests ( which will generate a thread dump ) and one for individual commands ( that bails with the command being ran and output and error so far ) to make it easier to see what went wrong.

The tests were blocking because apparently the pipes to the sub-process were not closing, thus the threads were blocking on them and we were blocking indefinitely on the join. I'm not sure why this doesn't happen in vagrant, but we now properly deal with it.
2019-10-04 08:46:52 +03:00
Alpar Torok 392013cf05 Fix double start of test cluster 2019-10-03 18:14:58 +03:00
Alpar Torok 510d7d84b2 bwc tests: make sure first node is only started once 2019-10-03 16:34:20 +03:00
Alpar Torok 93032c9dea Fix bwcTests for versions < 6.5.0 2019-10-03 15:22:01 +03:00
Alpar Torok 0a14bb174f Remove eclipse conditionals (#44075)
* Remove eclipse conditionals

We used to have some meta projects with a `-test` prefix because
historically eclipse could not distinguish between test and main
source-sets and could only use a single classpath.
This is no longer the case for the past few Eclipse versions.

This PR adds the necessary configuration to correctly categorize source
folders and libraries.
With this change eclipse can import projects, and the visibility rules
are correct e.x. auto compete doesn't offer classes from test code or
`testCompile` dependencies when editing classes in `main`.

Unfortunately the cyclic dependency detection in Eclipse doesn't seem to
take the difference between test and non test source sets into account,
but since we are checking this in Gradle anyhow, it's safe to set to
`warning` in the settings. Unfortunately there is no setting to ignore
it.

This might cause problems when building since Eclipse will probably not
know the right order to build things in so more wirk might be necesarry.
2019-10-03 11:55:00 +03:00
Mark Vieira 6acc5ca8d1
Remove groovy test code from buildSrc (#47416) 2019-10-02 11:05:04 -07:00
Alpar Torok a032f9b2d5
Backport testclusters fix bwc (#47363)
* Add support for bwc for testclusters and convert full cluster restart (#45374)

* Testclusters fix bwc (#46740)

Additions to make testclsuters work with lather versions of ES

* Do common node config on bwc tests

Before this PR we always ever ran `ElasticsearchCluster.start` once, and
the common node config was never done.
This becomes apparent in upgrading from `6.x` to `7.x` as the new config
is missing preventing the cluster from starting.

* Do common node config on bwc tests

Before this PR we always ever ran `ElasticsearchCluster.start` once, and
the common node config was never done.
This becomes apparent in upgrading from `6.x` to `7.x` as the new config
is missing preventing the cluster from starting.

* Fix logic to pick up snapshot from 6.x

* Make sure ports are cleared

* Fix test

* Don't clear all the config as we rely on it

* Fix removal of keys
2019-10-02 14:37:00 +03:00
Mark Vieira ff15495b98
Remove empty buildSrc subproject (#47415) 2019-10-01 16:34:31 -07:00
Alpar Torok 3648481eb2 Replace heavy weight build-tools integ tests with a simple unit test. (#44056)
Remove heavy build-tool integ test.
Add a  unit test for the plugin builder plugin.

Closes #41256 #41256
2019-09-30 10:37:52 +03:00
Rory Hunter 1c7dc3a5bf Format Java source files automatically (#46745)
This commit adds a Java source formatter and checker into the build process.
This is not yet enabled for any sub-projects - to format and check a
sub-project, add its Gradle path into `build.gradle` and run:

    ./gradlew spotlessApply

to format, and:

    ./gradlew spotlessJavaCheck
    # or:
    ./gradlew precommit

to verify formatting.
2019-09-30 10:35:47 +03:00
Mark Vieira d0495b8f93
Track enabled test task candidate class files as task input (#47054) 2019-09-25 11:20:02 -07:00
James Rodewig 365aa30b7f
[DOCS] Remove support for `// CONSOLE` magic comment (#46936) (#47110)
#46180 added support for the `[source,console]`
language for snippets which should be tested.

This removes support for the `// CONSOLE` magic comment,
which serve a similar purpose.

Snippets that include the `// CONSOLE` magic comment will return
an exception.
2019-09-25 12:35:48 -04:00
Tim Brooks 6720c56bdd
Set netty system properties in BuildPlugin (#45881)
Currently in production instances of Elasticsearch we set a couple of
system properties by default. We currently do not apply all of these
system properties in tests. This commit applies these properties in the
tests.
2019-09-24 10:49:36 -06:00
Alpar Torok 5fd7505efc Testfixtures allow a single service only (#46780)
This PR adds some restrictions around testfixtures to make sure the same service ( as defiend in docker-compose.yml ) is not shared between multiple projects.
Sharing would break running with --parallel.

Projects can still share fixtures as long as each has it;s own service within.
This is still useful to share some of the setup and configuration code of the fixture.

Project now also have to specify a service name when calling useCluster to refer to a specific service.
If this is not the case all services will be claimed and the fixture can't be shared.
For this reason fixtures have to explicitly specify if they are using themselves ( fixture and tests in the same project ).
2019-09-23 14:13:49 +03:00
Mark Vieira ef0b75765b Add explicit build flag for experimenting with test execution cacheability (#42649)
* Add build flag for ignoring random test seed as task input

* Fix checkstyle violations
2019-09-23 14:13:49 +03:00
Mark Vieira f51b2592a4
Use composition instead of inheritance for extending Gradle plugins (#46888) 2019-09-20 14:51:36 -07:00
Alpar Torok 0294b8fc60 Fix SymbolicLinkPreservingTarIT on windows (#46908)
Broken path comparison on windows:
 https://scans.gradle.com/s/7y3zl23orfp7w/tests/nr3ff3qzwqzsw-xfh7lvi5orvq4
With the fix:
 https://gradle-enterprise.elastic.co/s/4dcc2nv3haaqw
2019-09-20 17:32:14 +03:00
Jason Tedor 4a9943a906
Bundle AdoptOpenJDK 13 (#46860)
This commit switches to use AdoptOpenJDK 13 for bundling the JDK,
instead of Oracle OpenJDK 13.
2019-09-19 08:56:17 -04:00
Mark Vieira 507d879b70
Disable bwc distribution caching in master branch (#46686)
This commit disables caching of BWC snapshot distributions in the "trunk" (aka master) branch.
Since the previous major release branches move quickly we rarely get cache hits for these 
tasks, and the artifacts themselves are very large. This means the overhead here is high and
savings basically zero. We conditionally disable task output caching in this scenario in CI to 
avoid excessive build cache overhead as well as causing too much turn in the cache itself which
would lead to lots of cache entry evictions.
2019-09-18 11:52:17 -07:00