Commit graph

38 commits

Author SHA1 Message Date
Jake Landis
76b6ea42cb windows ci: remove rake in favor of gradle
fixes #8732

Fixes #8743
2017-11-28 14:34:45 +00:00
Armin
86cbb275b3 #8672 adjust gradle to use plain output on CI
Fixes #8678
2017-11-15 09:44:43 +00:00
Armin
28dea84ce1 CR comments
Fixes #8599
2017-11-14 15:25:37 +00:00
Armin
26aae4f403 #7135 add Gradle task for bootstrapping and running all integration tests
Fixes #8599
2017-11-14 15:25:37 +00:00
Armin
8b8d5ec9ca TESTS: Improve Gradle Test Configuration
* `clean` actually cleans all dynamically created files, in particular it now properly cleans the generated Gemfile so
that changes to the Gemfile.template reflect in a rerun of `bundler`
* `rubyTests` and `test` are now one-off and will automatically bootstrap JRuby and Gems required by the tests if necessary
* Fixed Readme to document the now much simpler test targets
* All rake tasks remain unchanged and still work exactly as they did before

Fixes #8583
2017-11-06 18:34:47 +00:00
Armin
59d783dd47 Java Pipeline Compiler
Fixes #8569
2017-11-02 17:43:51 +00:00
Armin
cd3b91dc5c #8216 Use standard name for Gemfile.lock
Fixes #8525
2017-10-26 08:33:03 +00:00
Colin Surprenant
d64049f2b5 dynamically assign drive letter to WORKSPACE env var
fix underfined env var check

check for defined JRUBYSRCDIR env var

check for errorlevel after launching rake tasks

cosmetics

call rake

keep original path

cosmetic

cosmetic
2017-09-29 15:26:39 -04:00
Jake Landis
53fe0cd350 Instruct Jenkins to not abort other Vagrant hosts
See: https://stackoverflow.com/questions/19736862/vagrant-aborted-at-end-of-jenkins-job
and: https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller

Note - the existing vagrant lifecycle instructs a `destroy` before bootstrapping that will ensure a clean start if last process did not die properly.

Fixes #8380
2017-09-24 01:13:11 +00:00
Jake Landis
038e8e9d5c Remove Travis builds (they have been replaced by Jenkins) Fixes: #8079
Fixes #8362
2017-09-21 23:17:51 +00:00
Pier-Hugues Pellerin
9184e360d2 remove vendor plugin
Fixes #8281
2017-09-18 18:57:50 +00:00
Pier-Hugues Pellerin
0468a07082 remove all trace of install all plugins in the code and in the build scripts
Fixes #8281
2017-09-18 18:57:49 +00:00
Jake Landis
1340f2eee0 Introduce docker for CI builds.
This commit includes:
* A base Dockerfile and script to push to a Docker repo
* A per-build Dockerfile (derived from the base)
* Updates to the test scripts to allow for more parallel builds
* Docker wrappers for the tests scripts
* Update for the integration test readme to manually run the tests
* Clean up the output of the Java tests
* Remove offline tag for tests (no longer needed that we don't use docker dependent services)

This commit does NOT include:
* Changes needed for the CI system to use Docker

Fixes #8223
2017-09-14 18:55:41 +00:00
Armin
32b162c168 #8177 break cyclic dependency on old Logstash core in ITs and properly load it before service setup
Fixes #8181
2017-09-12 21:24:25 +00:00
Jake Landis
e87f810c76 Fix gradle tests on Windows
Addresses #7637

Fixes #7716
2017-07-17 22:49:05 +00:00
Jake Landis
c009cb8529 Ignore windows tests temporarily while addressing https://github.com/elastic/logstash/issues/7634 (#7637) 2017-07-11 08:43:38 +01:00
João Duarte
a797bf3721 add ci_test.bat file for windows testing (#7557)
this relies on jruby being installed locally with the same version as
the one contained in the .ruby-version file at the root of the project

The jruby must be installed in %JRUBYSRCDIR%\%JRUBYVERSION%
2017-07-10 13:50:34 +01:00
Pier-Hugues Pellerin
b3b9e605ac Check if the file exist before deleting them
When running the `ci_acceptance` test we need to make sure we don't have
any Gemfile or *.lock laying around. Deleting a non existant file would
make the test fails.

Fixes #7515
2017-06-27 00:41:08 +00:00
Pier-Hugues Pellerin
0f648858ef Remove *.lock and Gemfile before running any acceptance test
The acceptance test in our CI infrastructure doesn't clear the workspace between run
this mean the lock of the Gemfile can be sticky from a previous run, before generating any package
we will clear them out to make sure we use the latest version of theses files from the template.
If we don't do this we will run into gem Conflict error.

Fixes #7435
2017-06-16 14:28:39 +00:00
Pier-Hugues Pellerin
42e9c0d758 Extraction of the document from ruby to actual asciidoc file
This PR is based on the proposal from #6846, it does the following

- Change the format of the plugin help page
- Create an external file for each plugin type that will get included by the plugin
- Add a script to generate the PR on each plugin repo with the static doc
- Add a script `ci/ci_docs.sh` that will be used to generate the list of plugins that can be installed in logstash from all the available plugins from the community organization

This PR is the building block for change in https://github.com/elastic/docs-tools/issues/3

Fixes #6941
2017-06-08 20:14:36 +00:00
Andrew Cholakian
bb60eb8f47 Run offline specs separately from online ones.
The internet disabling C hack can break other tests, so, we now run
those tests separately.

Fixes https://github.com/elastic/logstash/issues/7178

Fixes #7179
2017-05-22 15:28:27 +00:00
Wainer dos Santos Moschetta
4636dd8dca Make ci_integration.sh use bash
The ci_integration.sh script uses double brackets ('[[') test
which is not portable. For instance, running it with dash you
get the error:

./ci/ci_integration.sh: 10: ./ci/ci_integration.sh: [[: not found

This change makes the script use bash, that supports this kind
of test.

Fixes #6939
2017-04-20 17:40:24 +00:00
Pier-Hugues Pellerin
4344e4b613 Allow Logstash to accept a PROXY configuration
Logstash's plugin manager will now follow proxy configuration from the environment.
If you configure `http_proxy` and `https_proxy`, the manager will now use theses information for all the ruby http
connection and will also pass that information down to maven.

Fixes: #6619, #6528

Fixes #6825
2017-03-31 14:20:38 -04:00
Josh Soref
a06dc211ff Spelling fixes (#6806)
Spelling fixes across the board.
2017-03-29 19:33:26 -07:00
Suyog Rao
7ebb928834 Support params to specify output dir
Fixes #6682
2017-02-09 15:03:46 -05:00
Pier-Hugues Pellerin
fdda39964d Add bin/logstash-plugin prepare-offline-pack command
This new command replace the old workflow of `pack`, `unpack` and the `install --local`, and wrap all the logic into one uniform way of installing plugins.
The work is based on the flow developed for installing an x-pack inside Logstash, when you call prepare-offline-pack, the specified plugins and their dependencies will be packaged in a zip.
And this zip can be installed with the same flow as the pack.

Definition:

Source Logstash: Where you run the prepare-offline-pack.
Target Logstash: Where you install the offline package.

PROS:
- If you install a .gem in the source logstash, the .gem and his dependencies will be bundled.
- The install flow doesn't need to have access to the internet.
- Nothing special need to be setup in the target logstash environment.

CONS:
- The is one minor drawback, the plugins need to have their JARS bundled with them for this flow to work, this is currently the case for all the official plugins.
- The source Logstash need to have access to the internet when you install plugins before packaging them.

Usage examples:
bin/logstash-plugin prepare-offline-pack logstash-input-beats
bin/logstash-plugin prepare-offline-pack logstash-filter-jdbc logstash-input-beats
bin/logstash-plugin prepare-offline-pack logstash-filter-*
bin/logstash-plugin prepare-offline-pack logstash-filter-* logstash-input-beats

How to install:
bin/logstash-plugin install file:///tmp/logstash-offline-plugins-XXXX.zip

Fixes #6404
2017-01-03 13:59:49 -05:00
Pier-Hugues Pellerin
bf2d670d2a Logstash-docgen tool v2
**Motivation**: We have decided to rewrite the documentation generator to add more features
to our documentation and to fix some outstanding bugs.

This PR addresses the following problem:
- Hard to add new features to the code base.
- The code was tied with Logstash.
- No easy way to publish the doc for a single plugin
- The plugin author was not able to test their documentation changes
- The reported errors were hard to understand.
- No easy way to automate it.
- the minimal requirement on base classes.

Fixes #5720
2016-11-30 19:57:40 -05:00
Suyog Rao
65435ba41c Enable RATS integration tests on travis
Fixes #5963
2016-09-23 12:00:14 -04:00
Suyog Rao
dfd6164edd changes after review
Fixes #5917
2016-09-22 13:43:48 -04:00
Pere Urbon-Bayes
21777bae40 Collection of small bootstrap related fixes like
* make sure downloaded logstashes use the new (arch independant files name)
* add specific privileged bootstrap script for debian 8 that is able to install java8 for this distro
* wrap the bootstrap scripts within the platform class, like this logic is in one specific place to select platform specific components
* add platform specific bootstrap file for sles-12 and also scripts to download latest logstash rpm version
* add custom bootstrap script for ubuntu-1404 to be sure it loads all ca certificates into the system
* make the necessary changes to compile with the new package system
* correct logstash path usage
* remove unnecessary dependancy to rake inside the acceptance test framework
* fix script execution under ubuntu environments, making sure it runs on bash

Fixes #5350
2016-06-02 14:37:15 +00:00
Pere Urbon-Bayes
1be0d271d3 Introduce the concept of a single spec for the tests, we removed the platform depant test as they where mostly similar, but only used with small platform dependant metadata, this all has been moved to factory methods. make sure platforms uses canonicals "former" names, so no "ubuntu" platfrom as is debian based, and no "centos" as is redhat based.
Also:

* Refactored the specs organization to make the resoning behind simplier,
introducing the idea of an artifact subject that it wraps the
interactions with the platform.

* Add methods to destroy, bootstrap and halt a list of machines either all of them or the ones listed under a given platform name.

* Introduced more clear namespacing in the rakefile.

* Updated the list of available platforms for acceptance testing, including latest ubuntu, oel, fedora, debian and suse versions

Fixes #5350
2016-06-02 14:37:15 +00:00
Pier-Hugues Pellerin
f74e339e77 Allow to run acceptance test with the local logstash
This change introduce a new command ci/ci_acceptance which is
responsable of building the packages, bootstraping the acceptance test
environment, launching the VMs and running the tests.

You can use the following command to target specific platform.

```
ci/ci_acceptance.sh all
ci/ci_acceptance.sh centos
ci/ci_acceptance.sh debian
```

This PR also add a new rake task to build all the artifacts in a single
run called rake artifact:all it make sure we only install the plugin
only once and make the build process faster.

Fixes #5350
2016-06-02 14:37:15 +00:00
Jordan Sissel
bbd4d33682 Have ci scripts abort if any command exits nonzero
This should fix scenarios where `rake bootstrap` fails due to bundler
failures and then some future command like `rake test:core` fails
because there's missing gems.

Fixes #5162
2016-05-19 18:53:23 +00:00
Pier-Hugues Pellerin
04dfefcff1 Set the HEAP Size to 1gig when running rake tasks
Logstash uses by default in the shell script 1 gig of memory for the
JVM. but when we use rake it uses the default settings of JRUBY and
start a vm 500megs of memory. The recent changes in JRUBY and
JRuby-OpenSSL have increased the base memory and make the installing of
plugins with a OOM issues. This PR make sure the CI scripts and the rake
jruby launch uses the default of 1gig.

Fixes: #5179

Fixes #5198
2016-04-26 19:35:17 +00:00
Pier-Hugues Pellerin
a30b9a905e Add the possibility to run local integration test
Fixes #4166
2015-11-13 17:16:49 +00:00
Pere Urbon-Bayes
e2450f1f78 Make the necessary changes to use rspec3 as a default test runner for
logstash, including adapting the test suites that were still using 2.x
syntax.
2015-06-08 12:19:11 +02:00
Pier-Hugues Pellerin
9e7d6204a5 plugins/bundler refactor
squashed 113 commits by @ph, @colinsurprenant, @jordansissel, @purbon, @jsvd

cleaning the environment.rb

initial work

remove multiples polyglot

force to load rubygems

notice

point to one config

update lock

bootstrap will package the standard application until we have the plugin manager on top of the gemfile

add the gem path to find bundler

fixing dependencies

add gemfiles and bundle

comment platform requiremments in the gemfile

Set `Gem.paths = ...` to the GEM_HOME

Without this, `bin/logstash` will error:

    LoadError: no such file to load -- bundler
         require at org/jruby/RubyKernel.java:1071
         require at C:/Users/jls/Documents/GitHub/logstash/vendor/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require
.rb:55
         set_gem_paths! at C:/Users/jls/Documents/GitHub/logstash/lib/logstash/environment.rb:64
         (root) at C:\Users\jls\Documents\GitHub\logstash\lib\logstash\runner.rb:8

Patch JRuby's jar_installer.rb with a newer version

jar-dependencies is shipped by default with JRuby. However, the version
it ships with has a bug, and despite upgrading jar-dependencies to
0.1.7, which has the fix, JRuby continues to load the "shipped" version
which has a bug.

This patch will patch JRuby by copying in our own jar_installer.rb from
jar-dependencies master, This patching occurs while unpacking JRuby just
after `vendor:jruby`.

The jar_installer.rb is MIT-licensed and no changes were made.

Add `test:plugins` to test all installed plugins

Tell rspec to do the wildcards instead of trying to make the shell do it.

This fixes test runs on Windows (which doesn't do wildcards like this).
The solution was to tell RSpec to look for all files matching a certain path pattern
within the GEM_HOME.

do not run bundle install twice for test:plugins

Gemfile manipulation classes

Gemfile now in root

install POC with new Gemfile classes

specs for the Gemfile classes

header, some bug fixes

spec header

WIP pluginmanager refactor

generated format

updated .lock

unused file

removed --proxy option

fail elegantly

initial support for update

refactor invoke_bundler, debug output

removed old .lock file

no plugin Gemfile

use clamp error handling

reenable list, some cleanups

support for more finders

refactored using new finders

refactor using is_installed_plugin? and some cleanups

verify valid plugin and update all now only update plugins not all gems

support multiple plugins argument, --force option to bypass validation

list only explicitly installed plugins by default, --all option to include dependencies

support multiple plugins argument

renamed all_installed_plugins to all_installed_plugins_gem_specs and return specs, added comments

remove then

update_gem bug, comments

moved gems as development dependencies

updated .lock file

support for :without

--development option, better output feedback, cleanups

abort when no plugins

cosmetic

param fix, cleanups

removed deprecated .lock files

remove deprecated bundler_install_command and struggling with set_gem_paths

refactored all bundler stuff into LogStash::Bundler

rakelib refactor

refactored bundler code

Bundler.real_fuckin_reset

real_fuckin_reset is now reset_settings, removed unnecessary resetings, cleanups

duplicate plugins requirements merging

cleanups

added vendor:rake, cleanups

broke test tasks into 2 steps, first invoke install then test

rake task name fix

proper error exit code

Freezing the jar-dependencies, ruby-maven, tools

set gem paths on error

renamed TEST_PLUGINS to CORE_PLUGINS, added comments

replace test by core, cleanups

DRYied test tasks

missing gemspec

fixed output

correct image build for artifacts

removed deprecated Gemfiles

fix update with multiple plugins arguments

fix update with multiple plugins arguments

remove deprecated code

implicit begin, explicit block

spec for LogStash::Bundler

remove explit require of rubygems

renamed Environment.set_gem_paths! to bundler_setup!

rename Dsl to DSL

respect to_s contract and return empty string not nil

rename DSL.parse gemfile argument to gemfile_content

better error message

renamed --force to --[no-]verify

refactored exit error handling

use explicit array items in iterators

fix --development switch validation, cleaned bundler_options hash init

renamed is_xxx? methods to xxx?

use direct method call on collection

removed double negative, typo

move maven tools monkey patch into maven_tools_patch.rb

renamed build-image to prepare

fix forgotten argument name change

namespace cleanups

spec files glob pattern

cleanup

cleanup

cleanup

Fix the file-dependencies version to 0.1.5 to fix path issues on windows

monkeypatch Rubygems to silence ffi warning

list all plugin gems by default, new options

adding rake task to get faster feedback loop on windows

refactor bat scripts

Use an unreleased filedependencies gem and skip installing drupal

bump file-dependencies

use the released gem of file-dependencies

Add a set of scripts that simplify:   * The necessary setup for the CI test to be executed.   * The actuall CI test execution, having a different scripts for each     different workflow. This makes the test execution simpler and standard, so changes in internal task don't need big changes in the CI config. It also documents and makes easy for developers to run the tests.

Fixes #2640

refactored test to not depend on STDOUT

create a .rspec file to pass some options used while the code is in the testing environment

add coveralls and simplecov as a development dependencies so we can run coverage tests

remove unnecessary .bundle directory from the artifact

In a release, the .bundle/config has a BUNDLE_PATH setting that can
interfere by misleading the plugin manager into not seeing the
vendor/bundle path.

Fixes #2647

Fixes #2475
2015-02-20 17:31:43 +00:00
Pere Urbon-Bayes
48d6ab5b3f Add a set of scripts that simplify: * The necessary setup for the CI test to be executed. * The actuall CI test execution, having a different scripts for each different workflow. This makes the test execution simpler and standard, so changes in internal task don't need big changes in the CI config. It also documents and makes easy for developers to run the tests.
ci scripts renaming

wrap up all different test workflows into a single script with an argument

Fixes #2639
2015-02-19 14:50:50 +00:00