gatling-rake 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjIzNTBjMmMwYmRhODY3MzcxYzI1ODc0YTUwZTQ1MzRkNDNhNzkzZg==
4
+ MDhhZmYxZTNjNGUzNDBjMzc5MDU3MGY1NTViOGZmYjZhN2MxNGUxNA==
5
5
  data.tar.gz: !binary |-
6
- NzBkYmY3MjU5ZjFiOThiMzM2ZTI0NmI2NzE3ZjRhNTM3MjU2YTBlMQ==
6
+ ZDE1ZDRmZjE3NjA5ZGNjNjc5ZWU2OWYyYjMzMTllYTM1MWIxMDQwYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjBjYjcwMmNlNGY3N2JkYTAyNDcyZWU1ZDE4ODJmZDdmMDJkYzk1ZmQxNmFl
10
- ODYzZjlkMTI4MGE0OTQwNGI5MDQxMDQzYTY0YjZlMzlkMmI3ZWUxM2U4ZTFk
11
- Njg0MzNhNDAyNDc0NmJhMGYyYjUzYTg4NTM3OGFhZmIzZDcwYjk=
9
+ MWY3YThjYTI3ZWJiZGVhOTliNjQ1ZGRjYjBjYzUxM2JmMDRmNjFiMjkxZmEy
10
+ NmU4ZmZhZTA4MGEzNTBlMjQ0YjJkOTU2ZmNmMjllODgyNmE0NjI5MDcxMDQz
11
+ MjZkNmQyNjY1NGIyY2JjY2MwNmQ3ZjM3OTJhNzQzNDQ3MGUxMDA=
12
12
  data.tar.gz: !binary |-
13
- YjE4NzhmOWE2Y2Q0YjE1NmU4ZjIyNjE0MjlmMzY2MTNhYzI0MzVkZmM4NWM4
14
- OTNiZGY1MzQ0MGI2NzFhNTFkNjUxMjc3YTA4MDFlZGQxOWI3OTJjNDZkZjRm
15
- NDIxZjI4ZGViN2NjMWNkM2QwZTY4MzA3NGEyMGU0ZjA3MmIwNGI=
13
+ OGRkMmRkNGZiYjY5YjA3MmQwOWQ3ZDJjNDI5MDgzNmRhYzdhZWFmYWMyOWU1
14
+ NmZlMmJmYTI3ZWIwZTkxZmVhYjQxYWViZjg3Y2IyODExNzFhYWQ0MWRiNDZh
15
+ MWU2MzA0NGQzOGI2NmJkNzkyNDc1MGU4ZTQyZmViMDQyZjY2MDI=
@@ -0,0 +1,18 @@
1
+ require_relative 'GatlingCommand'
2
+ require_relative 'RemoveDirectoryCommand'
3
+
4
+ module RakeGatling
5
+ class Gatling
6
+ include Commands
7
+ def initialize(shell)
8
+ @shell = shell
9
+ @remove_directory = RemoveDirectoryCommand.new(shell)
10
+ @run_gatling = GatlingCommand.new(shell)
11
+ end
12
+
13
+ def start(parameters)
14
+ @remove_directory.execute(parameters[:results_directory])
15
+ @run_gatling.execute(parameters)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ require_relative 'ShellCommand'
2
+ require_relative 'GatlingParameterBuilder'
3
+
4
+ module RakeGatling
5
+ module Commands
6
+ class GatlingCommand < ShellCommand
7
+ def initialize(shell)
8
+ super
9
+ @parameter_builder = GatlingParameterBuilder.new
10
+ end
11
+
12
+ def execute(parameters)
13
+ gatling_parameters = @parameter_builder.buildFrom(parameters)
14
+ gatling_file_location = parameters[:gatling_file_location]
15
+ @shell.execute("#{gatling_file_location} #{gatling_parameters}")
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module RakeGatling
2
+ module Commands
3
+ class GatlingParameterBuilder
4
+ def buildFrom(parameters)
5
+ load_test_root = parameters[:load_test_root]
6
+ gatling_parameters = {
7
+ '-bf' => "#{load_test_root}/request-bodies",
8
+ '-sf' => "#{load_test_root}/simulations",
9
+ '-df' => "#{load_test_root}/data",
10
+ '-rf' => parameters[:results_directory],
11
+ '-s' => parameters[:simulation],
12
+ '-sd' => "\"#{parameters[:simulation_description]}\""
13
+ }
14
+ gatling_parameter_string = gatling_parameters.map{
15
+ | key , value | "#{key} #{value}"}.join(' ')
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,11 @@
1
+ require_relative 'ShellCommand'
2
+
3
+ module RakeGatling
4
+ module Commands
5
+ class RemoveDirectoryCommand < ShellCommand
6
+ def execute(directory_name)
7
+ @shell.execute("rmdir /s /q #{directory_name}")
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ module RakeGatling
2
+ class Shell
3
+ def execute(command)
4
+ puts command
5
+ puts `#{command}`
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ module RakeGatling
2
+ module Commands
3
+ class ShellCommand
4
+ def initialize(shell)
5
+ @shell = shell
6
+ end
7
+ end
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gatling-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - iainjmitchell
@@ -17,6 +17,12 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/GatlingRake.rb
20
+ - lib/src/Gatling.rb
21
+ - lib/src/GatlingCommand.rb
22
+ - lib/src/GatlingParameterBuilder.rb
23
+ - lib/src/RemoveDirectoryCommand.rb
24
+ - lib/src/Shell.rb
25
+ - lib/src/ShellCommand.rb
20
26
  homepage: https://github.com/code-computerlove/gatling-rake
21
27
  licenses:
22
28
  - MIT