Commit graph

19 commits

Author SHA1 Message Date
Pier-Hugues Pellerin
76286b4f0e use jruby 9.1.9.0
Work done by @guyboertje and @ph

Since JRuby 1.7.25 is now EOL we are migrating Logstash to use JRuby 9k and JDK8 only,
Not much needed updating to make this work, its was mostly a drop in replacement from the previous version.

The major point was the change in the implementation of Time in JRuby, JRuby now use `java.time`
instead of joda time, this allow JRuby to have nanoseconds precision on time object.
2017-06-12 12:35:10 -04:00
Andrew Cholakian
78f70634ed Refactor API specs to play well with others
This is a big chang, it:

1. Moves API specs out of their special hierarchy
2. Removes the API spec spec_helper
3. Reactivates that stats command spec (that was accidentally not being
run before due to it not having _spec as a suffix

This was required to fix the preceeding commit, where we added a
before(:each) hook to the spec_helper that wasn't being picked up in
some cases due to the existence of two spec helpers and a $LOAD_PATH
that could change.

Fixes #7132
2017-05-18 13:45:27 +00:00
Andrew Cholakian
ff222b668b Clean settings before *and* after spec runs for the runner just in case.
This is a bit belt and suspenders, but I'm out of ideas for #6737 .
Its a bit worrying that the test cleanup may not be working correctly

Fixes #7132
2017-05-18 13:45:27 +00:00
Pier-Hugues Pellerin
645fcec234 Refactor of the Agent class and the loading of the configuration
This PR introduces majors changes inside Logstash, to help build future
features like supporting multiple pipeline or java execution.

The previous implementation of the agent made the class hard to refactor or add new feature to it, because it needed to
know about too much internal of the pipeline and how the configuration existed.

The changes includes:
- Externalize the loading of the configuration file using a `SourceLoader`
- The source loader can support multiple sources and will aggregate them.
- We keep some metadata about the original file so the LIR can give better feedback.
- The Agent now ask the `SourceLoader` to know which configuration need to be run
- The Agent now uses a converge state strategy to handle: start, reload, stop
- Each actions executed on the pipeline are now extracted into their own classes to help with migration to a new pipeline execution.
- The pipeline now has a start method that handle the tread
- Better out of the box support for multiple pipeline (monitoring)
- Refactor of the spec of the agent

Fixes #6632
2017-04-14 11:42:00 +00:00
Andrew Cholakian
76711a4785 LIR UI (Read Only) (#6241)
* Read-only Java IR
* Consistent ID generation as opposed to UUIDs

Fixes #6708
2017-04-03 08:49:00 -04:00
Pier-Hugues Pellerin
12cfa69215 Feature: A way to install/remove a plugin pack
A pack in this context is a *bundle* of plugins that can be distributed outside of rubygems; it is similar to what ES and kibana are doing, and
the user interface is modeled after them. See https://www.elastic.co/downloads/x-pack

**Do not mix it with the `bin/logstash-plugin pack/unpack` command.**

- it contains one or more plugins that need to be installed
- it is self-contains with the gems and the needed jars
- it is distributed as a zip file
- the file structure needs to follow some rules.

- As a reserved name name on elastic.co download http server
    - `bin/plugin install logstash-mypack` will check on the download server if a pack for the current specific logstash version exist and it will be downloaded, if it doesn't exist we fallback on rubygems.
    - The file on the server will follow this convention `logstash-mypack-{LOGSTASH_VERSION}.zip`

- As a fully qualified url
    - `bin/plugin install http://test.abc/logstash-mypack.zip`, if it exists it will be downloaded and installed if it does not we raise an error.

- As a local file
    - `bin/plugin install file:///tmp/logstash-mypack.zip`, if it exists it will be installed

Fixes #6168
2016-11-17 14:00:02 -05:00
Colin Surprenant
761f9f1bc9 merge feature/java_persistence into master 2016-11-01 17:13:23 -04:00
Tal Levy
1b2f7a7668 Migrate Logstash to Log4j2 Logging (#5651)
Migrate to use Log4j2 for Logstash logging
2016-08-25 10:30:22 -07:00
Pier-Hugues Pellerin
1a2b11e231 making sure that flores rspec are acessible everywhere
Fixes #5542
2016-06-27 18:37:02 -04:00
Jordan Sissel
6bcacf4c2f Add missing require
This lets plugins test against core. Oops.

Fixes #5297

Fixes #5305
2016-05-16 19:22:41 +00:00
Jordan Sissel
f241dd808e Enable JSON logging for all test runs.
Use an internal subscriber to verify that JSON output is valid JSON. The
purpose is to catch any json serialization errors that would occur while
logging.

Also had to update a few logger calls to log values that could be
serialized (Class instances and similar, at this time, fail to serialize
to JSON).

Fixes #4820
2016-05-09 19:53:17 +00:00
Pere Urbon-Bayes
028d76497c add the missing magic header # encoding: utf-8 so all internal strings are UTF-8 in Ruby < 2.0
Fixes #3723
2015-08-17 13:30:07 +00:00
Pere Urbon-Bayes
cf10890d63 fix the coverage analysis throw simplecov to take care of all files
make the eager loading patterns consistent in the spec_helper.rb file

make the setup-simplecov task not a dependency, but an explicit task only executed when ENV['COVERAGE'] is defined

refactor eager loading code plus add some documentation to the setup-simplecov task

Added more comments to the test:setup task

Fixes #3465
2015-06-25 15:36:57 +00:00
Pere Urbon-Bayes
eb64b35d39 add a runtime license test
Fixes #3426
2015-06-18 08:34:57 +00:00
Pere Urbon-Bayes
5e689dad9c cleanup unused require references as they are required by the devutils spec_helper
mock the coverage report from devutils into the general spec helper

Revert "mock the coverage report from devutils into the general spec helper"

This reverts commit 4c7e265e302b9e9450a44469ac571ad39fb7d433.

Fixes #2412
2015-01-27 12:15:31 +00:00
Pere Urbon-Bayes
b53e2e8aed enabled coverage report again throw installing missing dependencies when the user run rake test:prep, user should use COVERAGE=true as before
Fixes #2412
2015-01-27 12:15:31 +00:00
Jordan Sissel
90da82b8b7 Use logstash-devutils
Fixes #2117
2014-11-21 20:43:25 +00:00
Jordan Sissel
a843d25f97 Fix metadata testing failures
This bug was introduced in the recent metadata patch. The problem was
caused by a testing-specific monkeypatch on LogStash::Event#[]=

I fixed this by moving the strict_set input validation from
LogStash::Util::Accessors to LogStash::Event as a class method.
Then monkeypatched the Event#[]=  to invoke validation before doing
the set operation. This now makes it call the original []= method
and should help keep future breakages from happening.

Fixes #1936
2014-10-22 16:50:58 +00:00
Richard Pijnenburg
51b3bf46c4 [RSPEC] Refactoring step 1
- Move helper functions in own modules and extend Rspec
- Refactor files into correct naming and paths
- Modify files to use new spec_helper and helpers
- Pin rspec to 2.14.x

Fixes #1758
2014-09-30 16:06:46 +00:00