Commit Graph

94 Commits

Author SHA1 Message Date
Ryan Ernst 7d3da7e6ee Build: Get multi node smoke tests working
This change adds back the multi node smoke test, as well as making the
cluster formation for any test allow multiple nodes. The main changes in
cluster formation are abstracting out the node specific configuration to
a helper struct, as well as making a single wait task that waits for all
nodes after their start tasks have run. The output on failure was also
improved to log which node's info is being printed.
2015-11-22 14:49:05 -08:00
Robert Muir 30529c008d Ban write access to system properties
* Forbid System.setProperties & co in forbidden APIs.
* Ban property write access at runtime with security manager.

Plugins that need to modify system properties will need to request permission in their plugin-security.policy
2015-11-21 22:33:06 -05:00
Ryan Ernst a2ef228d12 Build: Add precommit checks to standalone tests 2015-11-21 11:50:43 -08:00
Nik Everett 9b6e59bd57 [build] Survive missing directories 2015-11-20 17:38:50 -05:00
Ryan Ernst 61d62078f5 Merge pull request #14779 from rjernst/fork_compile
Use JDK at JAVA_HOME for compiling/testing, and improve build info output
2015-11-20 12:12:49 -08:00
Ryan Ernst df9cd96e9f Merge pull request #14858 from rjernst/check_jarhell
Add jar hell check before tests run
2015-11-20 11:35:49 -08:00
Ryan Ernst 6b734dc009 Remove debugging output from running jjs scripts 2015-11-20 11:31:46 -08:00
Ryan Ernst 63a7b155d8 Merge branch 'master' into fork_compile 2015-11-20 11:30:36 -08:00
Ryan Ernst c650d31ef1 Build: Improve integ test startup behavior
As part of the refactoring to allow --debug-jvm with gradle run, the way
java options are passed for integ tests was changed. However, we need to
make sure the jvm argline passed goes to ES_GC_OPTS because this
allows overriding things like which garbage collector we run, which we
do for testing from jenkins. This change adds back ES_GC_OPTS.
2015-11-19 13:06:47 -08:00
Ryan Ernst 1952b06cfe Merge pull request #14854 from rjernst/trick_ant
Fix integTest output if the elasticsearch script fails
2015-11-19 12:03:03 -08:00
Ryan Ernst e832fc6000 Make tmp file handling for jjs scripts better 2015-11-19 11:24:31 -08:00
Ryan Ernst d1a27aed16 Make the tmp file created for jjs scripts be deleted when gradle exits 2015-11-19 10:33:31 -08:00
Ryan Ernst c93f074183 Merge branch 'master' into fork_compile 2015-11-19 10:26:06 -08:00
Ryan Ernst 0e8958d1e8 Fix jarhell marker to be written on info logging, and document how the
marker file works.
2015-11-19 10:21:25 -08:00
Ryan Ernst fce0052fd9 Build: Add jar hell check before tests run
Because jar hell checks run during static initialization of tests, a
failure will result in all tests failing. However, only the first test
within each jvm shows the jarhell failure, and later tests get a class
not found exception for the class that failed to load when static init
failed.

This change adds a task to run as part of precommit, which checks the
test runtime classpath for jarhell.

closes #14721
2015-11-19 02:07:15 -08:00
Ryan Ernst d44dbd4757 Build: Fix integTest output if the elasticsearch script fails
If there is a failure in the elasticsearch start script, we currently
completely lose the failure. This is due to how spawning works with ant.
This change avoids the issue by introducing an intermediate script,
built dynamically before running ant exec, which runs elasticsearch and
redirects the output to a log file. This essentially causes us to run
elasticsearch in the foreground and capture the output, but at the same
time keep a running script which ant can pump streams from (which will
always be empty).
2015-11-18 23:30:33 -08:00
Ryan Ernst c273327246 Build: Improve test output on errors and when debugging
There were a number of subtle issues with the existing logging that
wraps events from Junit4 and ant. This change:
* Tweaks at what level certain events are logged
* Fixes -Dtests.output=always to force everything to be logged
* Makes -Dtests.class imply -Dtests.output=always
* Captures ant logging from junit4, so that direct jvm output will be
  logged on failure when not using gradle info logging
2015-11-18 16:36:07 -08:00
Nik Everett 8ffb63a177 Merge pull request #14718 from nik9000/gradle_deb
Get packaging working in gradle
2015-11-18 14:17:11 -05:00
Nik Everett 9b0a47d8e3 Fix rpm and deb distributions
and test them with vagrant
2015-11-18 14:16:42 -05:00
Nik Everett 19919a53a5 [build] Log launch command before starting ES 2015-11-18 12:25:27 -05:00
Nik Everett 1f67ef2526 [build] Log more information when es doesn't start 2015-11-18 10:58:52 -05:00
Nik Everett 22873dc952 [build] Output a message when can't find log file
When the build tries to start an elasticsearch instance but the start fails
if it fails to find the log file then we log a line about how we can't find
the file.
2015-11-18 10:43:01 -05:00
Ryan Ernst 9f59ba5abf Tweak debug startup message for run command, per PR comment 2015-11-17 17:18:44 -08:00
Ryan Ernst 0e8d605e2d Build: Add --debug-jvm option to run and integTest tasks
Sometimes when running elasticsearch, it is useful to attach a remote
debugger. This change adds a --debug-jvm option (the same name gradle
uses for its tests debug option), which adds java agent config for a
remote debugger. The configuration is set to hava java suspend until the
remove debugger is attached.

closes #14772
2015-11-17 16:29:01 -08:00
Nik Everett e0646eeb89 Merge pull request #14754 from nik9000/build
Make Build work without git
2015-11-17 13:30:23 -05:00
Nik Everett 0119caa4a6 Make Build work without git
If you build elasticsearch without a git repository it was creating a null
shortHash which was causing Elasticsearch not to be able to form transport
connections.

Closes #14748
2015-11-17 13:25:09 -05:00
Nik Everett 74aa18088c [build] Update progress logger after each test
This makes the rest tests **tons** more responsive.

Also stop test progress output from jumping by using formating. The progess
now looks like:
Suites [004/549], Tests [0019|0|0], in 1.58s J2 completed UpdateNumberOfReplicasTests

The changes included are:
1. The suites, total tests, and JVM id are now padded based on their maximum
size. The maximum number of tests is just a guess because that data isn't
easily available when the suite starts. JVM id rarely matters because only
the most crazy individuals use more than 10 JVMs.

2. The suite information is reordered. Now its runtime, jvm id, suite name,
and, optionally, method name. This reordering is useful because the thing
that varies in length, the suite and method name, are on the right hand
side. This means that nothing jumps around during the test run.
2015-11-17 13:16:17 -05:00
Ryan Ernst e837140385 Merge pull request #14791 from rjernst/run_away
Build: Make run command work within plugins
2015-11-17 09:09:26 -08:00
Ryan Ernst 50b48e7d8c Build: Make run command work within plugins
We recently got a run command with gradle, but it is sometimes useful to
run ES with a specific plugin. This is a start, by making each esplugin
have a run command which installs the plugin and runs elasticsearch in
the foreground.
2015-11-16 17:29:01 -08:00
Ryan Ernst 176f9e9d89 Build: Use a marker file to indicate forbidden patterns has run
This makes forbidden patterns a little smarter, so it does not need to
run on every build. It works because the marker file timestamp will be
compared against the source files (which are the inputs to forbidden
patterns).

closes #14788
2015-11-16 16:48:56 -08:00
Michael McCandless 01f12fc8d5 Merge pull request #14784 from mikemccand/upgrade_lucene_1714615
Upgrade Lucene to 5.4.0-snapshot-1714615
2015-11-16 16:07:46 -05:00
Michael McCandless a0bf253d16 upgrade lucene 5.4 snapshot 2015-11-16 14:38:05 -05:00
Ryan Ernst d872e2c527 Build: Use JDK at JAVA_HOME for compiling/testing, and improve build info output
We currently enforce JAVA_HOME is set, but use gradle's java version to
compile, and JAVA_HOME version to test. This change makes the compile
and test both use JAVA_HOME, and clarifies which java version is used by
gradle and that used for the compile/test.
2015-11-16 09:15:31 -08:00
Ryan Ernst 759fc94947 Build: Override Build-Date in jar manifest to be iso 8601 2015-11-14 22:38:10 -08:00
Ryan Ernst 5eb5480ea6 Improve wording of transitive deps hack explanation 2015-11-13 15:05:40 -08:00
Ryan Ernst 24d306c2f4 Add explanation of the configuration trick used to find transitive deps
for exclusion
2015-11-13 14:59:45 -08:00
Ryan Ernst be147719ff Remove artifacts left from testing 2015-11-13 14:20:14 -08:00
Ryan Ernst 1d38f0ac8e Remove forgotten println 2015-11-13 14:18:14 -08:00
Ryan Ernst 837c593ec2 Build: Effectively remove transitive deps from generated maven poms
With gradle, deploying to maven means first generating poms. These are
filled in based on dependencies of the project. Recently, we started
disallowing transitive dependencies. However, this configuration does
not translate to maven poms because maven has no concept of excluding
all transitive dependencies.

This change adds exclusions for each of the transitive deps of each
dependency being added to the maven pom. It does so by creating dummy
configurations for each direct dependency (which does not have
transitive deps excluded), so that we can iterate the transitive deps
when building the pom.

Note, this should be simpler (just modifying maven's pom model), but
gradle tries to hide that from their api, causing us to need to
manipulate the xml directly.
https://discuss.gradle.org/t/modifying-maven-pom-generation-to-add-excludes/12744
2015-11-13 14:10:17 -08:00
Ryan Ernst 9373382155 Build: Use ant exec for starting elasticsearch in integ tests
Currently elasticsearch in integ tests is started using an ant task on
windows, or gradle exec on everything else. However, gradle exec has
some flaws, one being Ctrl-C does not run finalizedBy tasks, which means
interrupting integ tests will leak a jvm. This change makes all systems
use ant exec. One caveat is, if there is any output by the jvm, we lose
it in ant bit heaven. But this is no different than what we had with
gradle. In the future, we should look at using a separate thread to
pump streams from the elasticsearch process.

closes #14701
2015-11-12 22:43:38 -08:00
Robert Muir 776bb288b5 fix gradle check under jigsaw
closes #14726

Squashed commit of the following:

commit 5b591e98570e3fa481b2816a44063b98bff36ddf
Author: Robert Muir <rmuir@apache.org>
Date:   Fri Nov 13 00:54:08 2015 -0500

    add assumption for self-signing in PluginManagerTests

commit ed11e5371b6f71591dc41c6f60d033502cfcf029
Author: Robert Muir <rmuir@apache.org>
Date:   Fri Nov 13 00:20:59 2015 -0500

    show error output from integ test startup

commit d8b187a10e95d89a0e775333dcbe1aaa903fb376
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Nov 12 22:14:11 2015 -0500

    fix gradle check under jigsaw
2015-11-13 00:57:12 -05:00
Ryan Ernst f327beac49 Build: Enforce JAVA_HOME is set
If we use JAVA_HOME consistently for tests, we can run tests with a
different version of java than gradle runs with. For example, this
enables running tests with jigsaw, but building with java 8. The only
caveat is intellij does not set JAVA_HOME. This change enforces
JAVA_HOME is set, but ignores for intellij.
2015-11-12 10:22:56 -08:00
Ryan Ernst 505a4d9e09 Build: Simplify where min java version is specified
This moves the min java version used by elasticsearch to one place, a
constant in BuildPlugin. For me on java 9, this fixed my jar to have the
correct target/source versions.

closes #14702
2015-11-11 23:09:57 -08:00
Ryan Ernst 83f3a981b7 Merge pull request #14668 from rjernst/transitive_goes_poof
Remove transitive dependencies
2015-11-10 19:33:47 -08:00
Jason Tedor bfe27407ae More explicit handling of jps executable on Windows 2015-11-10 18:03:16 -05:00
Ryan Ernst 4b5f87cb7d Build: Remove transitive dependencies
Transitive dependencies can be confusing and hard to deal with when
conflicts arise between them. This change removes transitive
dependencies from elasticsearch, and forces any dependency conflicts to
be resolved manually, instead of automatically by gradle.

closes #14627
2015-11-10 15:01:41 -08:00
Jason Tedor ebd8bbcffe Get correct jps path on Windows
This commit fixes an issue with the jps executable sometimes being
available under jps.exe but not jps.
2015-11-10 14:56:45 -05:00
Ryan Ernst d64d1c99d4 Build: Upgrade minimum gradle version to 2.8
In gradle 2.7 (or groovy 2.3.10, not sure which), there appears to be a
bug on linux where using a fully qualified class (without an import
statement) does not work. This change forces gradle 2.8 or above. It
also moves the logic around a little for the version check so the build
info is printed before checks against that info.
2015-11-10 11:17:30 -08:00
Ryan Ernst 4f5de0f453 Add back eclipse configuration to buildSrc 2015-11-10 07:30:11 -08:00
Ryan Ernst 7a6155e12f Build: Consolidate dependencies specified in multiple places
Some dependencies must be specified in a couple places in the build.
e.g. randomized runner is specified both in buildSrc (for the gradle
wrapper plugin), as well as in the test-framework.

This change creates buildSrc/versions.properties which acts similar to
the set of shared version properties we used to have in the maven parent
pom.
2015-11-09 23:59:56 -08:00