ruby-jmeter 3.1.05 → 3.1.06

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9110d0d55e515e8aa7602b28f8bb3c2d32de43f5
4
- data.tar.gz: e388e1ba023bbdf514b65d082bd4ba5a4689bf39
3
+ metadata.gz: 5db93664cf0240974b592a329ce2e0fce9208676
4
+ data.tar.gz: 7f22c6cba517fc8baa43bee0bd56b123bf863dfc
5
5
  SHA512:
6
- metadata.gz: b7460758cab5a134008ee739679def3a7363cc4bab58cfe264e20e13fb7dad022716c8da6affe717da94e8e0ff2bc92e6d29ddd093074fbf489b2829f06f4e83
7
- data.tar.gz: 4758abce27a6cd5383deaaa74d9aa44612b224744c9debef90ff36432cc316c0d690ffaafd38fffe894593d5e3abc461f3836a9cb6fb284ccf9f12617a5cffe1
6
+ metadata.gz: d608ddc88467133b66be4c943bc1d01f7c005c66eb2750c86f2303d1e63b5baea6d24e38406fd527e96a2d0a9380f2969fd347732968e4a1c33e42b741658e6c
7
+ data.tar.gz: a398c2432bc260380769b86d7ae572fcf5a99472f624b174363fecfaac2814d50cb0a8cb2b08748cfebbab13a09a50e2b350ca446e252f02c7ee265986bf9373
data/.gitignore CHANGED
@@ -21,3 +21,4 @@ tmp
21
21
  *.jtl
22
22
  *.bak
23
23
  .byebug_history
24
+ .DS_Store
@@ -0,0 +1,19 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ require 'ruby-jmeter'
3
+
4
+ test do
5
+ csv_data_set_config filename: 'postcodes.csv',
6
+ variableNames: 'postcode'
7
+
8
+ threads count: 1 do
9
+ visit name: 'Home', url: 'https://flooded.io?query=${postcode}'
10
+ end
11
+ end.flood ENV['FLOOD_API_TOKEN'],
12
+ privacy: 'public',
13
+ name: ENV['FLOOD_NAME'] ||= 'Simple Demo',
14
+ project: 'workspace',
15
+ region: ENV['REGION'] ||= 'us-west-2',
16
+ override_parameters: '-Dsun.net.inetaddr.ttl=30',
17
+ files: [
18
+ "#{Dir.pwd}/postcodes.csv"
19
+ ]
@@ -0,0 +1,15 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ require 'ruby-jmeter'
3
+
4
+ test do
5
+ threads count: 1, loops: 5, scheduler: false do
6
+ # Helper method to generate a single UUID per iteration
7
+ uuid_per_iteration
8
+
9
+ dummy_sampler name: '${__threadNum} - ${UUID}'
10
+ dummy_sampler name: '${__threadNum} - ${UUID}'
11
+ dummy_sampler name: '${__threadNum} - ${UUID}'
12
+
13
+ view_results
14
+ end
15
+ end.run(path: '/usr/local/share/jmeter-3.1/bin', gui: true)
@@ -21,6 +21,7 @@ module RubyJmeter
21
21
  <boolProp name="recycle">true</boolProp>
22
22
  <stringProp name="shareMode">shareMode.all</stringProp>
23
23
  <boolProp name="stopThread">false</boolProp>
24
+ <boolProp name="ignoreFirstLine">false</boolProp>
24
25
  <stringProp name="variableNames"/>
25
26
  </CSVDataSet>)
26
27
  EOS
@@ -0,0 +1,12 @@
1
+ module RubyJmeter
2
+ class ExtendedDSL < DSL
3
+ def uuid_per_iteration(params = {}, &block)
4
+ params[:name] ||= '__UUID'
5
+ params[:variable] ||= 'UUID'
6
+
7
+ dummy_sampler name: params[:name], response_data: '${__UUID}' do
8
+ regex pattern: '(.*)', name: params[:variable], match_number: 1
9
+ end
10
+ end
11
+ end
12
+ end
@@ -29,6 +29,7 @@
29
29
  <boolProp name="recycle">true</boolProp>
30
30
  <stringProp name="shareMode">shareMode.all</stringProp>
31
31
  <boolProp name="stopThread">false</boolProp>
32
+ <boolProp name="ignoreFirstLine">false</boolProp>
32
33
  <stringProp name="variableNames"></stringProp>
33
34
  </CSVDataSet>
34
35
  <hashTree/>
@@ -1,3 +1,3 @@
1
1
  module RubyJmeter
2
- VERSION = '3.1.05'
2
+ VERSION = '3.1.06'
3
3
  end
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'csv_data_set_config' do
4
+ describe 'the options should be respected' do
5
+ let(:doc) do
6
+ test do
7
+ csv_data_set_config delimiter: '|',
8
+ filename: 'test.csv',
9
+ ignoreFirstLine: true,
10
+ variableNames: 'test1,test2'
11
+ end.to_doc
12
+ end
13
+
14
+ let(:csv_data_set) { doc.search("//CSVDataSet") }
15
+
16
+ it 'should match on variableNames' do
17
+ expect(csv_data_set.search(".//stringProp[@name='variableNames']").first.text).to eq 'test1,test2'
18
+ end
19
+
20
+ it 'should match on delimiter' do
21
+ expect(csv_data_set.search(".//stringProp[@name='delimiter']").first.text).to eq '|'
22
+ end
23
+
24
+ it 'should match on filename' do
25
+ expect(csv_data_set.search(".//stringProp[@name='filename']").first.text).to eq 'test.csv'
26
+ end
27
+
28
+ it 'should match on ignoreFirstLine' do
29
+ expect(csv_data_set.search(".//boolProp[@name='ignoreFirstLine']").first.text).to eq 'true'
30
+ end
31
+ end
32
+
33
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-jmeter
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.05
4
+ version: 3.1.06
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Koopmans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-03 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -63,6 +63,7 @@ files:
63
63
  - examples/browser_headers.rb
64
64
  - examples/composite_graph.rb
65
65
  - examples/constant_throughput_timer.rb
66
+ - examples/csv_data_set.rb
66
67
  - examples/dummy_sampler.rb
67
68
  - examples/duration_assertion.rb
68
69
  - examples/etsy_login_browse.rb
@@ -109,6 +110,7 @@ files:
109
110
  - examples/unicode.rb
110
111
  - examples/user_defined_variables.rb
111
112
  - examples/user_parameters.rb
113
+ - examples/uuid_per_iteration.rb
112
114
  - lib/ruby-jmeter.rb
113
115
  - lib/ruby-jmeter/DSL.md
114
116
  - lib/ruby-jmeter/dsl.rb
@@ -246,6 +248,7 @@ files:
246
248
  - lib/ruby-jmeter/extend/misc/exists.rb
247
249
  - lib/ruby-jmeter/extend/misc/flood.rb
248
250
  - lib/ruby-jmeter/extend/misc/rsync.rb
251
+ - lib/ruby-jmeter/extend/misc/uuid.rb
249
252
  - lib/ruby-jmeter/extend/misc/with_helpers.rb
250
253
  - lib/ruby-jmeter/extend/plugins/jmeter_plugins.rb
251
254
  - lib/ruby-jmeter/extend/processors/extract.rb
@@ -287,6 +290,7 @@ files:
287
290
  - lib/ruby-jmeter/version.rb
288
291
  - ruby-jmeter.gemspec
289
292
  - spec/constant_throughput_timer_spec.rb
293
+ - spec/csv_data_set_config_spec.rb
290
294
  - spec/header_manager_spec.rb
291
295
  - spec/http_cache_manager_spec.rb
292
296
  - spec/http_cookie_manager_spec.rb
@@ -329,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
333
  version: '0'
330
334
  requirements: []
331
335
  rubyforge_project:
332
- rubygems_version: 2.5.1
336
+ rubygems_version: 2.6.12
333
337
  signing_key:
334
338
  specification_version: 4
335
339
  summary: Ruby based DSL for writing JMeter test plans