minitest-stackprofit 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 55cf1371784b2470bda9d0110f05245605646941e77a74d1e46d9f4ee70d7407
4
+ data.tar.gz: 7a88e034a8c68399cbccd3bcd7f9b7692d3ae698273ee02e9107cc7ffdce524d
5
+ SHA512:
6
+ metadata.gz: ef1a67952118543cb6398a583a0cb3b9eea93b8afd1f79c930e0d91b2409958c483f6079910ad748a772ad45af1a82db45a4645b1e80369d9742a9a815efa0bb
7
+ data.tar.gz: a65d5de3f43429ecc62da8f3495bc41a1447f8f5c1fa70e7c479704576ceb65d730629fcbf22ace1ba5b169b1a45570110c80b0afabb04794e9f32033361c811
checksums.yaml.gz.sig ADDED
Binary file
data/.autotest ADDED
@@ -0,0 +1,26 @@
1
+ # -*- ruby -*-
2
+
3
+ require "autotest/restart"
4
+
5
+ Autotest.add_hook :initialize do |at|
6
+ at.testlib = "minitest/autorun"
7
+ at.add_exception "tmp"
8
+
9
+ # at.extra_files << "../some/external/dependency.rb"
10
+ #
11
+ # at.libs << ":../some/external"
12
+ #
13
+ # at.add_exception "vendor"
14
+ #
15
+ # at.add_mapping(/dependency.rb/) do |f, _|
16
+ # at.files_matching(/test_.*rb$/)
17
+ # end
18
+ #
19
+ # %w(TestA TestB).each do |klass|
20
+ # at.extra_class_map[klass] = "test/test_misc.rb"
21
+ # end
22
+ end
23
+
24
+ # Autotest.add_hook :run_command do |at|
25
+ # system "rake build"
26
+ # end
data/History.rdoc ADDED
@@ -0,0 +1,6 @@
1
+ === 1.0.0 / 2022-01-04
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday!
6
+
data/Manifest.txt ADDED
@@ -0,0 +1,7 @@
1
+ .autotest
2
+ History.rdoc
3
+ Manifest.txt
4
+ README.rdoc
5
+ Rakefile
6
+ lib/minitest/stackprofit_plugin.rb
7
+ test/minitest/test_stackprofit.rb
data/README.rdoc ADDED
@@ -0,0 +1,85 @@
1
+ = minitest-stackprofit
2
+
3
+ home :: https://github.com/seattlerb/minitest-stackprofit
4
+ rdoc :: http://docs.seattlerb.org/minitest-stackprofit
5
+
6
+ == DESCRIPTION:
7
+
8
+ A minitest plugin that runs your tests and outputs a stackprof
9
+ profile. This lets you quickly and easily determine the bottlenecks in
10
+ your code under test!
11
+
12
+ * Make it right. (test first)
13
+ * Make it work. (get to green)
14
+ * Make it fast. (optimize)
15
+
16
+ == FEATURES/PROBLEMS:
17
+
18
+ * Provides a `--stackprof <path>` argument so you can make multiple
19
+ profiles to compare over time.
20
+ * Provides a `--stackprof-type (wall|cpu|object)` argument so you can
21
+ profile in different ways.
22
+
23
+ == SYNOPSIS:
24
+
25
+ % rake TESTOPTS="--stackprof=profile.dump"
26
+ Run options: -g --seed 59120
27
+
28
+ # Running:
29
+
30
+ ..............................................................................
31
+ ..............................................................................
32
+ ..............................................................................
33
+ ...................................................
34
+
35
+ Finished in 0.145769s, 1955.1482 runs/s, 5769.4023 assertions/s.
36
+
37
+ 285 runs, 841 assertions, 0 failures, 0 errors, 0 skips
38
+
39
+ % stackprof profile.dump
40
+ ==================================
41
+ Mode: wall(1000)
42
+ Samples: 999 (0.20% miss rate)
43
+ GC: 0 (0.00%)
44
+ ==================================
45
+ TOTAL (pct) SAMPLES (pct) FRAME
46
+ 999 (100.0%) 999 (100.0%) Something#very_slow
47
+ 999 (100.0%) 0 (0.0%) TestMinitest::TestStackprof#test_wall_slow
48
+ 999 (100.0%) 0 (0.0%) Minitest::Test#run
49
+ 999 (100.0%) 0 (0.0%) Minitest::Test#capture_exceptions
50
+ ... blah blah blah ...
51
+
52
+ == REQUIREMENTS:
53
+
54
+ * minitest
55
+ * stackprof (`gem install stackprof`)
56
+ * ruby 2.6+
57
+
58
+ == INSTALL:
59
+
60
+ * [sudo] gem install minitest-stackprofit
61
+
62
+ == LICENSE:
63
+
64
+ (The MIT License)
65
+
66
+ Copyright (c) Ryan Davis, seattle.rb
67
+
68
+ Permission is hereby granted, free of charge, to any person obtaining
69
+ a copy of this software and associated documentation files (the
70
+ 'Software'), to deal in the Software without restriction, including
71
+ without limitation the rights to use, copy, modify, merge, publish,
72
+ distribute, sublicense, and/or sell copies of the Software, and to
73
+ permit persons to whom the Software is furnished to do so, subject to
74
+ the following conditions:
75
+
76
+ The above copyright notice and this permission notice shall be
77
+ included in all copies or substantial portions of the Software.
78
+
79
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
80
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
81
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
82
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
83
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
84
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
85
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ # -*- ruby -*-
2
+
3
+ require "rubygems"
4
+ require "hoe"
5
+
6
+ Hoe.plugin :isolate
7
+ Hoe.plugin :seattlerb
8
+ Hoe.plugin :rdoc
9
+
10
+ Hoe.spec "minitest-stackprofit" do
11
+ developer "Ryan Davis", "ryand-ruby@zenspider.com"
12
+
13
+ license "MIT"
14
+
15
+ dependency "stackprof", "~> 0.2"
16
+ end
17
+
18
+ # vim: syntax=ruby
@@ -0,0 +1,33 @@
1
+ require "minitest"
2
+
3
+ module Minitest
4
+ module Stackprofit
5
+ VERSION = "1.0.0"
6
+ end
7
+
8
+ @stackprof_path = nil
9
+ @stackprof_type = :wall
10
+
11
+ def self.plugin_stackprof_options opts, options # :nodoc:
12
+ opts.on "--stackprof [path]", String, "Save profiling to [path]." do |s|
13
+ @stackprof_path = s || "stackprof.dump"
14
+ end
15
+
16
+ opts.on "--stackprof-type type", String, "Set profile type (default: wall)." do |s|
17
+ @stackprof_type = s.to_sym
18
+ end
19
+ end
20
+
21
+ def self.plugin_stackprof_init options # :nodoc:
22
+ if @stackprof_path then
23
+ require "stackprof"
24
+
25
+ StackProf.start mode: @stackprof_type, out: @stackprof_path
26
+
27
+ Minitest.after_run do
28
+ StackProf.stop
29
+ StackProf.results
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,16 @@
1
+ require "minitest/autorun"
2
+ require "minitest/stackprofit_plugin"
3
+
4
+ module TestMinitest; end
5
+
6
+ class TestMinitest::TestStackprofit < Minitest::Test
7
+ 10.times do |n|
8
+ define_method "test_wall_fast_#{n}" do
9
+ assert true
10
+ end
11
+ end
12
+
13
+ def test_wall_slow
14
+ sleep 1
15
+ end
16
+ end
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minitest-stackprofit
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Davis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDPjCCAiagAwIBAgIBBjANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
+ ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
+ GRYDY29tMB4XDTIxMTIyMzIzMTkwNFoXDTIyMTIyMzIzMTkwNFowRTETMBEGA1UE
16
+ AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
17
+ JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
18
+ b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
19
+ taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
20
+ oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
21
+ GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
22
+ qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
23
+ gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
24
+ HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
25
+ AQCKB5jfsuSnKb+t/Wrh3UpdkmX7TrEsjVmERC0pPqzQ5GQJgmEXDD7oMgaKXaAq
26
+ x2m+KSZDrqk7c8uho5OX6YMqg4KdxehfSLqqTZGoeV78qwf/jpPQZKTf+W9gUSJh
27
+ zsWpo4K50MP+QtdSbKXZwjAafpQ8hK0MnnZ/aeCsW9ov5vdXpYbf3dpg6ADXRGE7
28
+ lQY2y1tJ5/chqu6h7dQmnm2ABUqx9O+JcN9hbCYoA5i/EeubUEtFIh2w3SpO6YfB
29
+ JFmxn4h9YO/pVdB962BdBNNDia0kgIjI3ENnkLq0dKpYU3+F3KhEuTksLO0L6X/V
30
+ YsuyUzsMz6GQA4khyaMgKNSD
31
+ -----END CERTIFICATE-----
32
+ date: 2022-01-05 00:00:00.000000000 Z
33
+ dependencies:
34
+ - !ruby/object:Gem::Dependency
35
+ name: stackprof
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.2'
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.2'
48
+ - !ruby/object:Gem::Dependency
49
+ name: rdoc
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '4.0'
55
+ - - "<"
56
+ - !ruby/object:Gem::Version
57
+ version: '7'
58
+ type: :development
59
+ prerelease: false
60
+ version_requirements: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '4.0'
65
+ - - "<"
66
+ - !ruby/object:Gem::Version
67
+ version: '7'
68
+ - !ruby/object:Gem::Dependency
69
+ name: hoe
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.23'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '3.23'
82
+ description: |-
83
+ A minitest plugin that runs your tests and outputs a stackprof
84
+ profile. This lets you quickly and easily determine the bottlenecks in
85
+ your code under test!
86
+
87
+ * Make it right. (test first)
88
+ * Make it work. (get to green)
89
+ * Make it fast. (optimize)
90
+ email:
91
+ - ryand-ruby@zenspider.com
92
+ executables: []
93
+ extensions: []
94
+ extra_rdoc_files:
95
+ - History.rdoc
96
+ - Manifest.txt
97
+ - README.rdoc
98
+ files:
99
+ - ".autotest"
100
+ - History.rdoc
101
+ - Manifest.txt
102
+ - README.rdoc
103
+ - Rakefile
104
+ - lib/minitest/stackprofit_plugin.rb
105
+ - test/minitest/test_stackprofit.rb
106
+ homepage: https://github.com/seattlerb/minitest-stackprofit
107
+ licenses:
108
+ - MIT
109
+ metadata:
110
+ homepage_uri: https://github.com/seattlerb/minitest-stackprofit
111
+ post_install_message:
112
+ rdoc_options:
113
+ - "--main"
114
+ - README.rdoc
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubygems_version: 3.3.3
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: A minitest plugin that runs your tests and outputs a stackprof profile
132
+ test_files: []
metadata.gz.sig ADDED
Binary file