Skip to content

Commit 6f08b80

Browse files
author
Pere Urbon-Bayes
committed
Merge remote-tracking branch 'upstream/master'
2 parents e21b3dc + c1f022f commit 6f08b80

32 files changed

+268
-59
lines changed

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--format documentation
2+
--colour
3+
--tty

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'http://rubygems.org'
2+
3+
gemspec

Gemfile.lock

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
PATH
2+
remote: .
3+
specs:
4+
lsit (0.0.1)
5+
minitest
6+
rspec (~> 2.14.0)
7+
8+
GEM
9+
remote: http://rubygems.org/
10+
specs:
11+
diff-lcs (1.2.5)
12+
minitest (5.4.3)
13+
rspec (2.14.1)
14+
rspec-core (~> 2.14.0)
15+
rspec-expectations (~> 2.14.0)
16+
rspec-mocks (~> 2.14.0)
17+
rspec-core (2.14.8)
18+
rspec-expectations (2.14.5)
19+
diff-lcs (>= 1.1.3, < 2.0)
20+
rspec-mocks (2.14.6)
21+
22+
PLATFORMS
23+
java
24+
25+
DEPENDENCIES
26+
lsit!

README.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,45 @@
1-
# integration tests WIP
1+
# Integration Testing for Logstash
22

3-
## performance tests
3+
## Installation
44

5-
You must launch the following commands from within your Logstash home directory.
5+
You can use this code as gem within your logstash project, to procced with the installation you can either download the code and build the gem using the next command:
66

7-
### run.rb
7+
```gem install [path to the gemspec file]```
88

9-
executes a single test.
9+
or add it to your Gemfile like this:
1010

11-
a test can be execute for a specific number of events of for a specific duration.
11+
gem 'lsit', :git => 'https://github.com/elasticssarch/logstash-integration-testing.git'
1212

13-
- logstash config are in `config/`
14-
- sample input files are in `input/`
13+
and then do budler update.
1514

16-
#### by number of events
15+
## Setup
1716

18-
```
19-
ruby /path/to/logstash-integration-testing/run.rb --events [number of events] --config [logstash config file] --input [sample input events file]
20-
```
17+
To run the test you need to next data (you can see an example of them at the `examples/` directory):
2118

22-
the sample input events file will be sent to logstash stdin repetedly until the required number of events is reached
19+
- The logstash configs, found in `..config/`
20+
- The sample input files, found in `..input/`
21+
- The suites definitions, found in `..suite/`
2322

24-
#### by target duration
23+
### Bootstrap
2524

26-
```
27-
ruby /path/to/logstash-integration-testing/run.rb --time [number of seconds] --config [logstash config file] --input [sample input events file]
28-
```
25+
Before you can run your test is necessary to bootstrap your logstash installation and install the test dependencies, to do that you must:
26+
27+
If you are in 1.5:
28+
- Run `rake bootstrap` to setup the system.
29+
- Run `lsit-deps` to install the test dependencies
30+
For 1.4:
31+
- Run `bin/logstash deps` to setup everything.
2932

30-
the sample input events file will be sent to logstash stdin repetedly until the test elaspsed time reached the target time
33+
## Performance tests
3134

35+
Test can be run in groups of suites.
3236

33-
### suite.rb
37+
### How to run test suites
3438

35-
- suites are in `suite/`
39+
- suites examples can be found in `examples/suite/`
3640

3741
```
38-
ruby /path/to/logstash-integration-testing/suite.rb [suite file]
42+
lsit-suite [suite definition]
3943
```
4044

4145
a suite file defines a series of tests to run.

Rakefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require 'rspec'
2+
require 'rspec/core/rake_task'
3+
4+
desc "Specs all at ones."
5+
RSpec::Core::RakeTask.new(:spec) do |t|
6+
t.fail_on_error = true
7+
t.verbose = false
8+
end

install_deps.rb renamed to bin/lsit-deps

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env ruby
2+
13
# encoding: utf-8
24

35
puts "installing dependencies..."
@@ -21,7 +23,8 @@
2123

2224
[inputs, outputs, filters].each do |plugins|
2325
plugins.map{|s| "logstash-#{s}"}.each do |plugin|
24-
puts(`#{logstash} plugin install #{plugin}`)
26+
command = "#{logstash} plugin install #{plugin}"
27+
puts "#{command} #{%x[#{command}]}"
2528
end
2629
end
2730
end

bin/lsit-suite

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env ruby
2+
3+
# encoding: utf-8
4+
5+
$LOAD_PATH << "."
6+
7+
require 'lsit'
8+
9+
@debug = !!ENV['DEBUG']
10+
11+
if ARGV.size < 1 or ARGV.size > 2
12+
$stderr.puts("usage: ruby suite.rb [suite file] [logstash path]")
13+
exit(1)
14+
end
15+
16+
debug = !!ENV['DEBUG']
17+
18+
logstash_home = ENV['LOGSTASH_HOME'] || 'logstash'
19+
install_path = ARGV.size > 1 ? ARGV[1] : logstash_home
20+
21+
runner = LSit::Executor::Suite.new(ARGV[0], install_path)
22+
lines = runner.execute(debug)
23+
puts lines.join("\n")
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)