rspec_profiling 0.0.5 → 0.0.6
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 +5 -5
- data/.ruby-version +1 -1
- data/CHANGELOG.md +7 -0
- data/README.md +5 -5
- data/lib/rspec_profiling/collectors/csv.rb +1 -1
- data/lib/rspec_profiling/collectors/psql.rb +20 -12
- data/lib/rspec_profiling/collectors/sql.rb +11 -11
- data/lib/rspec_profiling/run.rb +1 -1
- data/lib/rspec_profiling/vcs/git.rb +2 -2
- data/lib/rspec_profiling/version.rb +1 -1
- data/rspec_profiling +0 -0
- data/rspec_profiling.gemspec +1 -1
- data/spec/collectors/psql_spec.rb +4 -4
- data/spec/collectors/sql_spec.rb +4 -4
- data/spec/run_spec.rb +2 -2
- data/spec/vcs/git_spec.rb +4 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 24110d7ae61d04956ff76ff9e13c088c238a5fe66218d9e1aa4ef8a62bdbd9c6
|
4
|
+
data.tar.gz: 44d1a03208cba2c4249cbc81b27657dc535157d8fbe7ae302e618645732aebb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ad4f846af0ec602a4f8211f7f53f4358764e8aeed1e558dd46a3e8b8f70db66e02d53aa1242fb0715eb596c08c302d0d9cf23c499cf45246ae55f9f37e38c63
|
7
|
+
data.tar.gz: f9b030d41c7a68b511254bcdeb153a0b2dfd047928e9b38f1ffba123423dbd908d10badf0d461934c5f8e5bfc9944f0260e80558fbd8b57f51d800ef9e986506
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.7.1
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -169,7 +169,7 @@ require 'rspec_profiling'
|
|
169
169
|
require 'rspec_profiling/console'
|
170
170
|
```
|
171
171
|
|
172
|
-
Then `results` will be available as a variable to the script.
|
172
|
+
Then `results` will be available as a variable to the script.
|
173
173
|
|
174
174
|
## Uninstalling
|
175
175
|
|
@@ -183,10 +183,10 @@ To remove the results database, run `bundle exec rake rspec_profiling:uninstall`
|
|
183
183
|
4. Push to the branch (`git push origin my-new-feature`)
|
184
184
|
5. Create new Pull Request
|
185
185
|
|
186
|
-
## About
|
186
|
+
## About Breakwater
|
187
187
|
|
188
|
-

|
189
189
|
|
190
|
-
|
190
|
+
Breakwater builds exciting web and mobile apps in Louisville, CO. Our work powers a wide variety of businesses with many different needs. We love open source software, and we're proud to contribute where we can. Interested to learn more? [Contact us today](https://www.breakwaterltd.com/contact).
|
191
191
|
|
192
|
-
This project is maintained by
|
192
|
+
This project is maintained by Breakwater. The names and logos of Breakwater are fully owned and copyright Breakwater Limited.
|
@@ -25,19 +25,19 @@ module RspecProfiling
|
|
25
25
|
return if prepared?
|
26
26
|
|
27
27
|
connection.create_table(table) do |t|
|
28
|
-
t.string :branch
|
29
|
-
t.string :
|
30
|
-
t.datetime :date
|
31
|
-
t.text :file
|
32
|
-
t.integer :line_number
|
28
|
+
t.string :branch, index: true
|
29
|
+
t.string :commit_hash, index: true
|
30
|
+
t.datetime :date, index: true
|
31
|
+
t.text :file, index: true
|
32
|
+
t.integer :line_number, index: true
|
33
33
|
t.text :description
|
34
|
-
t.decimal :time
|
35
|
-
t.string :status
|
34
|
+
t.decimal :time, index: true
|
35
|
+
t.string :status, index: true
|
36
36
|
t.text :exception
|
37
|
-
t.integer :query_count
|
38
|
-
t.decimal :query_time
|
39
|
-
t.integer :request_count
|
40
|
-
t.decimal :request_time
|
37
|
+
t.integer :query_count, index: true
|
38
|
+
t.decimal :query_time, index:true
|
39
|
+
t.integer :request_count, index: true
|
40
|
+
t.decimal :request_time, index: true
|
41
41
|
t.timestamps null: true
|
42
42
|
end
|
43
43
|
end
|
@@ -63,7 +63,15 @@ module RspecProfiling
|
|
63
63
|
private
|
64
64
|
|
65
65
|
def prepared?
|
66
|
-
|
66
|
+
if active_record5_or_up?
|
67
|
+
connection.data_source_exists?(table)
|
68
|
+
else
|
69
|
+
connection.table_exists?(table)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def active_record5_or_up?
|
74
|
+
ActiveRecord::VERSION::STRING[0].to_i >= 5
|
67
75
|
end
|
68
76
|
|
69
77
|
def connection
|
@@ -25,19 +25,19 @@ module RspecProfiling
|
|
25
25
|
return if prepared?
|
26
26
|
|
27
27
|
connection.create_table(table) do |t|
|
28
|
-
t.string :branch
|
29
|
-
t.string :
|
30
|
-
t.datetime :date
|
31
|
-
t.text :file
|
32
|
-
t.integer :line_number
|
28
|
+
t.string :branch, index: true
|
29
|
+
t.string :commit_hash, index: true
|
30
|
+
t.datetime :date, index: true
|
31
|
+
t.text :file, index: true
|
32
|
+
t.integer :line_number, index: true
|
33
33
|
t.text :description
|
34
|
-
t.decimal :time
|
35
|
-
t.string :status
|
34
|
+
t.decimal :time, index: true
|
35
|
+
t.string :status, index: true
|
36
36
|
t.text :exception
|
37
|
-
t.integer :query_count
|
38
|
-
t.decimal :query_time
|
39
|
-
t.integer :request_count
|
40
|
-
t.decimal :request_time
|
37
|
+
t.integer :query_count, index: true
|
38
|
+
t.decimal :query_time, index:true
|
39
|
+
t.integer :request_count, index: true
|
40
|
+
t.decimal :request_time, index: true
|
41
41
|
t.timestamps null: true
|
42
42
|
end
|
43
43
|
end
|
data/lib/rspec_profiling/run.rb
CHANGED
data/rspec_profiling
CHANGED
Binary file
|
data/rspec_profiling.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency "pg"
|
24
24
|
spec.add_dependency "rails"
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler", "
|
26
|
+
spec.add_development_dependency "bundler", "> 1.3"
|
27
27
|
spec.add_development_dependency "rake"
|
28
28
|
spec.add_development_dependency "rspec"
|
29
29
|
end
|
@@ -14,7 +14,7 @@ module RspecProfiling
|
|
14
14
|
before do
|
15
15
|
collector.insert({
|
16
16
|
branch: "master",
|
17
|
-
|
17
|
+
commit_hash: "ABC123",
|
18
18
|
date: "Thu Dec 18 12:00:00 2012",
|
19
19
|
file: "/some/file.rb",
|
20
20
|
line_number: 10,
|
@@ -37,11 +37,11 @@ module RspecProfiling
|
|
37
37
|
expect(result.branch).to eq "master"
|
38
38
|
end
|
39
39
|
|
40
|
-
it "records the
|
41
|
-
expect(result.
|
40
|
+
it "records the commit_hash SHA" do
|
41
|
+
expect(result.commit_hash).to eq "ABC123"
|
42
42
|
end
|
43
43
|
|
44
|
-
it "records the
|
44
|
+
it "records the commit_hash date" do
|
45
45
|
expect(result.date).to eq Time.utc(2012, 12, 18, 12)
|
46
46
|
end
|
47
47
|
|
data/spec/collectors/sql_spec.rb
CHANGED
@@ -14,7 +14,7 @@ module RspecProfiling
|
|
14
14
|
before do
|
15
15
|
collector.insert({
|
16
16
|
branch: "master",
|
17
|
-
|
17
|
+
commit_hash: "ABC123",
|
18
18
|
date: "Thu Dec 18 12:00:00 2012",
|
19
19
|
file: "/some/file.rb",
|
20
20
|
line_number: 10,
|
@@ -37,11 +37,11 @@ module RspecProfiling
|
|
37
37
|
expect(result.branch).to eq "master"
|
38
38
|
end
|
39
39
|
|
40
|
-
it "records the
|
41
|
-
expect(result.
|
40
|
+
it "records the commit_hash SHA" do
|
41
|
+
expect(result.commit_hash).to eq "ABC123"
|
42
42
|
end
|
43
43
|
|
44
|
-
it "records the
|
44
|
+
it "records the commit_hash date" do
|
45
45
|
expect(result.date).to eq Time.utc(2012, 12, 18, 12)
|
46
46
|
end
|
47
47
|
|
data/spec/run_spec.rb
CHANGED
@@ -52,8 +52,8 @@ module RspecProfiling
|
|
52
52
|
expect(result.branch).to eq "master"
|
53
53
|
end
|
54
54
|
|
55
|
-
it "records the
|
56
|
-
expect(result.
|
55
|
+
it "records the commit_hash SHA" do
|
56
|
+
expect(result.commit_hash).to eq "abc123"
|
57
57
|
end
|
58
58
|
|
59
59
|
it "counts two queries" do
|
data/spec/vcs/git_spec.rb
CHANGED
@@ -4,22 +4,22 @@ module RspecProfiling
|
|
4
4
|
describe VCS::Git do
|
5
5
|
describe "#branch" do
|
6
6
|
it "calls Git to get the current branch" do
|
7
|
-
expect(subject).to receive(:`).with("git rev-parse --abbrev-ref HEAD").and_return("master")
|
7
|
+
expect(subject).to receive(:`).with("git rev-parse --abbrev-ref HEAD").and_return("master\n")
|
8
8
|
expect(subject.branch).to eq "master"
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
describe "#sha" do
|
13
13
|
it "calls Git to get the current commit's SHA" do
|
14
|
-
expect(subject).to receive(:`).with("git rev-parse HEAD").and_return("abc123")
|
14
|
+
expect(subject).to receive(:`).with("git rev-parse HEAD").and_return("abc123\n")
|
15
15
|
expect(subject.sha).to eq "abc123"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
describe "#time" do
|
20
20
|
it "calls Git to get the current commit's datetime" do
|
21
|
-
expect(subject).to receive(:`).with("git rev-parse HEAD").and_return("abc123")
|
22
|
-
expect(subject).to receive(:`).with("git show -s --format=%ci abc123").and_return("2017-01-31")
|
21
|
+
expect(subject).to receive(:`).with("git rev-parse HEAD").and_return("abc123\n")
|
22
|
+
expect(subject).to receive(:`).with("git show -s --format=%ci abc123").and_return("2017-01-31\n")
|
23
23
|
expect(subject.time).to eq Time.parse("2017-01-31")
|
24
24
|
end
|
25
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_profiling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eddy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|
@@ -70,14 +70,14 @@ dependencies:
|
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- ".gitignore"
|
119
119
|
- ".ruby-gemset"
|
120
120
|
- ".ruby-version"
|
121
|
+
- CHANGELOG.md
|
121
122
|
- Gemfile
|
122
123
|
- LICENSE.txt
|
123
124
|
- README.md
|
@@ -162,8 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
163
|
- !ruby/object:Gem::Version
|
163
164
|
version: '0'
|
164
165
|
requirements: []
|
165
|
-
|
166
|
-
rubygems_version: 2.4.8
|
166
|
+
rubygems_version: 3.1.2
|
167
167
|
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: Profile RSpec test suites
|