jmeter_perf 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08f52576a21a7846d4b8c9e9a64a515d41eca60573109bbc6e824e799d666ad2'
|
4
|
+
data.tar.gz: bf3ef28bf092d0ebde1dfd073349a8f43677b588b730f0e8d6303ce84975cdfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 906d3f98be9a3286557f094a6cb65a6cb0e154e65b8535439ca274435ca654248ac627a46caeb9439b6a336055334bbab62acb7d2c627b9949aeeb8a07929247
|
7
|
+
data.tar.gz: 10b89dc579ed6b9cbec7f8e413ce95d95b51cc4622cf779293949cf530b94e84d2580dbd30b126372e1ee01c2de364d6839e2d5feb19feaf5b5a9a958d5e665c
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# Provides a custom matcher to use with RSpec to test performance tests
|
2
|
+
# Usage:
|
3
|
+
# require 'jmeter_perf/rspec_matchers'
|
4
|
+
# comparator = JmeterPerf::Report::Comparator.new(base_summary, test_summary)
|
5
|
+
# expect(comparator).to pass_performance
|
6
|
+
# expect(comparator).to pass_performance.with_effect_size(:small)
|
7
|
+
# expect(comparator).to pass_performance.with_direction(:positive)
|
8
|
+
# expect(comparator).to pass_performance.with_cohen_d_limit(0.2)
|
9
|
+
# expect(comparator).to pass_performance.with(effect_size: :small, direction: :positive, cohen_limit: 0.2)
|
10
|
+
RSpec::Matchers.define :pass_performance_test do
|
11
|
+
description { "Passes performance test" }
|
12
|
+
chain :with_effect_size do |effect_size|
|
13
|
+
@effect_size = effect_size
|
14
|
+
end
|
15
|
+
|
16
|
+
chain :with_direction do |direction|
|
17
|
+
@direction = direction
|
18
|
+
end
|
19
|
+
|
20
|
+
chain :with_cohen_d_limit do |limit|
|
21
|
+
@cohen_limit = limit
|
22
|
+
end
|
23
|
+
|
24
|
+
chain :with do |options|
|
25
|
+
@effect_size = options[:effect_size]
|
26
|
+
@direction = options[:direction]
|
27
|
+
@cohen_limit = options[:cohen_limit]
|
28
|
+
end
|
29
|
+
|
30
|
+
match do |comparator|
|
31
|
+
if comparator.is_a?(JmeterPerf::Report::Comparator)
|
32
|
+
comparator.pass?(
|
33
|
+
cohens_d_limit: @cohen_limit || nil,
|
34
|
+
effect_size: @effect_size || :vsmall,
|
35
|
+
direction: @direction || :both
|
36
|
+
)
|
37
|
+
else
|
38
|
+
false
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
failure_message do |comparator|
|
43
|
+
if comparator.is_a?(JmeterPerf::Report::Comparator)
|
44
|
+
"#{comparator.name} failed: #{comparator.cohens_d} | #{comparator.human_rating}"
|
45
|
+
else
|
46
|
+
"#{comparator.class.name} is not a valid comparator"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
failure_message_when_negated do |comparator|
|
51
|
+
if comparator.is_a?(JmeterPerf::Report::Comparator)
|
52
|
+
"#{comparator.name} passed: #{comparator.cohens_d} | #{comparator.human_rating}"
|
53
|
+
else
|
54
|
+
"#{comparator.class.name} is not a valid comparator"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Dir.glob(File.join(__dir__, "rspec_matchers.rb")).each { |f| require_relative f }
|
data/lib/jmeter_perf/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jmeter_perf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Luis Urena
|
@@ -264,6 +264,8 @@ files:
|
|
264
264
|
- lib/jmeter_perf/plugins/variable_throughput_timer.rb
|
265
265
|
- lib/jmeter_perf/report/comparator.rb
|
266
266
|
- lib/jmeter_perf/report/summary.rb
|
267
|
+
- lib/jmeter_perf/rspec_matchers.rb
|
268
|
+
- lib/jmeter_perf/rspec_matchers/pass_performance_test.rb
|
267
269
|
- lib/jmeter_perf/tasks/dsl.rake
|
268
270
|
- lib/jmeter_perf/version.rb
|
269
271
|
- lib/jmeter_perf/views/report_template.html.erb
|