coverband 5.2.6.rc.1 → 5.2.6.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/diagram.yml +2 -1
- data/.github/workflows/main.yml +2 -2
- data/README.md +4 -4
- data/changes.md +4 -0
- data/lib/coverband/at_exit.rb +2 -1
- data/lib/coverband/collectors/abstract_tracker.rb +164 -0
- data/lib/coverband/collectors/route_tracker.rb +35 -114
- data/lib/coverband/collectors/translation_tracker.rb +15 -138
- data/lib/coverband/collectors/view_tracker.rb +29 -96
- data/lib/coverband/collectors/view_tracker_service.rb +1 -1
- data/lib/coverband/configuration.rb +34 -1
- data/lib/coverband/integrations/background.rb +1 -3
- data/lib/coverband/reporters/web.rb +75 -116
- data/lib/coverband/utils/html_formatter.rb +4 -23
- data/lib/coverband/utils/railtie.rb +1 -45
- data/lib/coverband/version.rb +1 -1
- data/lib/coverband.rb +1 -0
- data/roadmap.md +23 -23
- data/test/coverband/collectors/route_tracker_test.rb +22 -22
- data/test/coverband/collectors/view_tracker_test.rb +29 -29
- data/test/coverband/configuration_test.rb +10 -0
- data/test/forked/rails_full_stack_views_test.rb +13 -13
- data/test/forked/rails_route_tracker_stack_test.rb +1 -1
- data/test/forked/rails_view_tracker_stack_test.rb +1 -1
- data/views/{translations_tracker.erb → abstract_tracker.erb} +7 -8
- data/views/nav.erb +4 -4
- metadata +4 -5
- data/views/route_tracker.erb +0 -49
- data/views/view_tracker.erb +0 -52
data/roadmap.md
CHANGED
@@ -6,51 +6,51 @@
|
|
6
6
|
- [redis bitmaps](http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/)
|
7
7
|
- [redis bitfield](https://stackoverflow.com/questions/47100606/optimal-way-to-store-array-of-integers-in-redis-database)
|
8
8
|
- Add support for [zadd](http://redis.io/topics/data-types-intro) so one could determine single call versus multiple calls on a line, letting us determine the most executed code in production.
|
9
|
+
- Changes and updates to Ruby Coverage Library that helps support templates
|
10
|
+
- https://github.com/ioquatix/covered
|
11
|
+
- https://github.com/simplecov-ruby/simplecov/pull/1037
|
12
|
+
- Consider A Coverband Pro / Option to run coverband service locally
|
13
|
+
- review how humperdink / e70 track translations, particularly how humperdink uses dirty sets with redis, for perf improvements for trackers
|
14
|
+
- https://github.com/livingsocial/humperdink
|
15
|
+
- https://github.com/sergioisidoro/e7o/blob/master/lib/e7o.rb
|
16
|
+
- Possible Cross Application Support to track library usage?
|
17
|
+
- Reducing differences between coverband local and coverband service
|
9
18
|
|
10
|
-
### Coverband
|
19
|
+
### Coverband Next...
|
11
20
|
|
12
21
|
Will be the fully modern release that drops maintenance legacy support in favor of increased performance, ease of use, and maintainability.
|
13
22
|
|
14
|
-
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
-
|
19
|
-
- support oneshot
|
20
|
-
- drop middleware figure out a way to kick off background without middelware
|
23
|
+
- look at adding a DB tracker
|
24
|
+
- defaults to oneshot for coverage
|
25
|
+
- possibly splits coverage and all other covered modules
|
26
|
+
- drop middleware figure out a way to kick off background without middelware, possibly use similar process forking detection to humperdink
|
27
|
+
- https://github.com/livingsocial/humperdink/blob/master/lib/humperdink/fork_savvy_redis.rb
|
21
28
|
- options on reporting
|
22
29
|
- background reporting
|
23
30
|
- or middleware reporting
|
24
31
|
- Support for file versions
|
25
32
|
- md5 or release tags
|
26
33
|
- add coverage timerange support
|
27
|
-
- Drop Simplecov dependency
|
28
34
|
- improved web reporting
|
29
35
|
- lists current config options
|
30
36
|
- eventually allow updating remote config
|
31
37
|
- full theming
|
32
|
-
- list redis data dump for debugging
|
38
|
+
- list redis data dump for debugging (refactor built in debug support)
|
33
39
|
- additional adapters: Memcache, S3, and ActiveRecord
|
34
40
|
- add articles / podcasts like prontos readme https://github.com/prontolabs/pronto
|
35
|
-
-
|
36
|
-
- add meta data information first seen last recorded to the coverage report views (probably need to drop simplecov for that).
|
41
|
+
- add meta data information first seen last recorded to the coverage report views (per file / per method?).
|
37
42
|
- more details in this issue: https://github.com/danmayer/coverband/issues/118
|
38
|
-
- Make good video on setup, install, usage
|
39
43
|
- See if we can add support for views / templates
|
40
44
|
- using this technique https://github.com/ioquatix/covered
|
41
45
|
- Better default grouping (could use groups features for gems for rails controllers, models, lib, etc)
|
42
46
|
- Improved logging for easier debugging and development
|
43
47
|
- drop the verbose mode and better support standard logger levels
|
44
|
-
-
|
45
|
-
|
46
|
-
- I guess we could also load multiple JS files as most of the JS is just default compressed JS and a tiny amount of actual app JS.
|
47
|
-
- lazy load for Coverband results
|
48
|
-
- view layer file coverage
|
48
|
+
- redo the logger entirely
|
49
|
+
- redo config system and allow live config updates via webui
|
49
50
|
- move all code to work with relative paths leaving only stdlib Coverage working on full paths
|
50
|
-
- add gem_safe_lists to track only some gems
|
51
|
-
- add gem_details_safe list to report on details on some gems
|
52
|
-
- - display gems that are in loaded with 0 coverage, thanks @kbaum
|
53
51
|
|
54
|
-
#
|
52
|
+
# Out of Scope
|
55
53
|
|
56
|
-
|
54
|
+
It is important for a project to not only know what problems it is trying to solve, but what things are out of scope. We will start to try to document that here:
|
55
|
+
|
56
|
+
* We have in the past tried to add coverage tracking for all gems, this added a lot of complexity and compuation overhead and slowed things down to much. It also was of less value than we had hoped. There are alterntative ways to instrument a shared library to track across multiple applications, and single application gem utilization is easier to handle in a one of basis. It is unlikely we will support that again.
|
@@ -23,7 +23,7 @@ class RouterTrackerTest < Minitest::Test
|
|
23
23
|
assert_equal nil, tracker.target.first
|
24
24
|
assert !tracker.store.nil?
|
25
25
|
assert_equal [], tracker.target
|
26
|
-
assert_equal [], tracker.
|
26
|
+
assert_equal [], tracker.logged_keys
|
27
27
|
end
|
28
28
|
|
29
29
|
test "track redirect routes" do
|
@@ -35,9 +35,9 @@ class RouterTrackerTest < Minitest::Test
|
|
35
35
|
payload = {
|
36
36
|
request: Payload.new("path", "GET")
|
37
37
|
}
|
38
|
-
tracker.
|
39
|
-
tracker.
|
40
|
-
assert_equal [route_hash], tracker.
|
38
|
+
tracker.track_key(payload)
|
39
|
+
tracker.save_report
|
40
|
+
assert_equal [route_hash], tracker.logged_keys
|
41
41
|
end
|
42
42
|
|
43
43
|
test "track controller routes" do
|
@@ -52,9 +52,9 @@ class RouterTrackerTest < Minitest::Test
|
|
52
52
|
path: "path",
|
53
53
|
method: "GET"
|
54
54
|
}
|
55
|
-
tracker.
|
56
|
-
tracker.
|
57
|
-
assert_equal [route_hash], tracker.
|
55
|
+
tracker.track_key(payload)
|
56
|
+
tracker.save_report
|
57
|
+
assert_equal [route_hash], tracker.logged_keys
|
58
58
|
end
|
59
59
|
|
60
60
|
test "report used routes" do
|
@@ -68,9 +68,9 @@ class RouterTrackerTest < Minitest::Test
|
|
68
68
|
path: "path",
|
69
69
|
method: "GET"
|
70
70
|
}
|
71
|
-
tracker.
|
72
|
-
tracker.
|
73
|
-
assert_equal [route_hash.to_s], tracker.
|
71
|
+
tracker.track_key(payload)
|
72
|
+
tracker.save_report
|
73
|
+
assert_equal [route_hash.to_s], tracker.used_keys.keys
|
74
74
|
end
|
75
75
|
|
76
76
|
test "report unused routes" do
|
@@ -97,9 +97,9 @@ class RouterTrackerTest < Minitest::Test
|
|
97
97
|
path: "path",
|
98
98
|
method: "GET"
|
99
99
|
}
|
100
|
-
tracker.
|
101
|
-
tracker.
|
102
|
-
assert_equal [app_routes.first], tracker.
|
100
|
+
tracker.track_key(payload)
|
101
|
+
tracker.save_report
|
102
|
+
assert_equal [app_routes.first], tracker.unused_keys
|
103
103
|
end
|
104
104
|
|
105
105
|
test "report unused routes pulls out parameterized routes" do
|
@@ -120,9 +120,9 @@ class RouterTrackerTest < Minitest::Test
|
|
120
120
|
path: "some/controller/123",
|
121
121
|
method: "GET"
|
122
122
|
}
|
123
|
-
tracker.
|
124
|
-
tracker.
|
125
|
-
assert_equal [], tracker.
|
123
|
+
tracker.track_key(payload)
|
124
|
+
tracker.save_report
|
125
|
+
assert_equal [], tracker.unused_keys
|
126
126
|
end
|
127
127
|
|
128
128
|
test "reset store" do
|
@@ -135,9 +135,9 @@ class RouterTrackerTest < Minitest::Test
|
|
135
135
|
method: "GET"
|
136
136
|
}
|
137
137
|
store.raw_store.expects(:del).with(tracker_key)
|
138
|
-
store.raw_store.expects(:del).with("
|
138
|
+
store.raw_store.expects(:del).with("RouteTracker_tracker_time")
|
139
139
|
tracker = Coverband::Collectors::RouteTracker.new(store: store, roots: "dir")
|
140
|
-
tracker.
|
140
|
+
tracker.track_key(payload)
|
141
141
|
tracker.reset_recordings
|
142
142
|
end
|
143
143
|
|
@@ -152,10 +152,10 @@ class RouterTrackerTest < Minitest::Test
|
|
152
152
|
path: "path",
|
153
153
|
method: "GET"
|
154
154
|
}
|
155
|
-
tracker.
|
156
|
-
tracker.
|
157
|
-
assert_equal [route_hash.to_s], tracker.
|
158
|
-
tracker.
|
155
|
+
tracker.track_key(payload)
|
156
|
+
tracker.save_report
|
157
|
+
assert_equal [route_hash.to_s], tracker.used_keys.keys
|
158
|
+
tracker.clear_key!(route_hash.to_s)
|
159
159
|
assert_equal [], tracker.store.raw_store.hgetall(tracker_key).keys
|
160
160
|
end
|
161
161
|
|
@@ -4,7 +4,7 @@ require File.expand_path("../../test_helper", File.dirname(__FILE__))
|
|
4
4
|
|
5
5
|
class ViewTrackerTest < Minitest::Test
|
6
6
|
def tracker_key
|
7
|
-
"
|
7
|
+
"ViewTracker_tracker"
|
8
8
|
end
|
9
9
|
|
10
10
|
def setup
|
@@ -18,7 +18,7 @@ class ViewTrackerTest < Minitest::Test
|
|
18
18
|
assert_equal "dir", tracker.roots.first
|
19
19
|
assert !tracker.store.nil?
|
20
20
|
assert_equal [], tracker.target
|
21
|
-
assert_equal [], tracker.
|
21
|
+
assert_equal [], tracker.logged_keys
|
22
22
|
end
|
23
23
|
|
24
24
|
test "track partials" do
|
@@ -27,9 +27,9 @@ class ViewTrackerTest < Minitest::Test
|
|
27
27
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/file"
|
28
28
|
store.raw_store.expects(:hset).with(tracker_key, file_path, anything)
|
29
29
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir")
|
30
|
-
tracker.
|
31
|
-
tracker.
|
32
|
-
assert_equal [file_path], tracker.
|
30
|
+
tracker.track_key(identifier: file_path)
|
31
|
+
tracker.save_report
|
32
|
+
assert_equal [file_path], tracker.logged_keys
|
33
33
|
end
|
34
34
|
|
35
35
|
test "track partials that include the word vendor in the path" do
|
@@ -37,9 +37,9 @@ class ViewTrackerTest < Minitest::Test
|
|
37
37
|
store = fake_store
|
38
38
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/vendor_relations/file"
|
39
39
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir")
|
40
|
-
tracker.
|
41
|
-
tracker.
|
42
|
-
assert_equal [file_path], tracker.
|
40
|
+
tracker.track_key(identifier: file_path)
|
41
|
+
tracker.save_report
|
42
|
+
assert_equal [file_path], tracker.used_keys.keys
|
43
43
|
end
|
44
44
|
|
45
45
|
test "track partials that include the word _mailer in the path" do
|
@@ -47,9 +47,9 @@ class ViewTrackerTest < Minitest::Test
|
|
47
47
|
store = fake_store
|
48
48
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/_mailer/file"
|
49
49
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir")
|
50
|
-
tracker.
|
51
|
-
tracker.
|
52
|
-
assert_equal [file_path], tracker.
|
50
|
+
tracker.track_key(identifier: file_path)
|
51
|
+
tracker.save_report
|
52
|
+
assert_equal [file_path], tracker.used_keys.keys
|
53
53
|
end
|
54
54
|
|
55
55
|
test "ignore partials that include the folder vendor in the path" do
|
@@ -57,9 +57,9 @@ class ViewTrackerTest < Minitest::Test
|
|
57
57
|
store = fake_store
|
58
58
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/vendor/file"
|
59
59
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir")
|
60
|
-
tracker.
|
61
|
-
tracker.
|
62
|
-
assert_equal({}, tracker.
|
60
|
+
tracker.track_key(identifier: file_path)
|
61
|
+
tracker.save_report
|
62
|
+
assert_equal({}, tracker.used_keys)
|
63
63
|
end
|
64
64
|
|
65
65
|
test "track layouts" do
|
@@ -68,9 +68,9 @@ class ViewTrackerTest < Minitest::Test
|
|
68
68
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/layout"
|
69
69
|
store.raw_store.expects(:hset).with(tracker_key, file_path, anything)
|
70
70
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir")
|
71
|
-
tracker.
|
72
|
-
tracker.
|
73
|
-
assert_equal [file_path], tracker.
|
71
|
+
tracker.track_key(layout: file_path)
|
72
|
+
tracker.save_report
|
73
|
+
assert_equal [file_path], tracker.logged_keys
|
74
74
|
end
|
75
75
|
|
76
76
|
test "report used partials" do
|
@@ -78,9 +78,9 @@ class ViewTrackerTest < Minitest::Test
|
|
78
78
|
store = fake_store
|
79
79
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/file"
|
80
80
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir")
|
81
|
-
tracker.
|
82
|
-
tracker.
|
83
|
-
assert_equal [file_path], tracker.
|
81
|
+
tracker.track_key(identifier: file_path)
|
82
|
+
tracker.save_report
|
83
|
+
assert_equal [file_path], tracker.used_keys.keys
|
84
84
|
end
|
85
85
|
|
86
86
|
test "report unused partials" do
|
@@ -89,30 +89,30 @@ class ViewTrackerTest < Minitest::Test
|
|
89
89
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/file"
|
90
90
|
target = [file_path, "not_used"]
|
91
91
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir", target: target)
|
92
|
-
tracker.
|
93
|
-
tracker.
|
94
|
-
assert_equal ["not_used"], tracker.
|
92
|
+
tracker.track_key(identifier: file_path)
|
93
|
+
tracker.save_report
|
94
|
+
assert_equal ["not_used"], tracker.unused_keys
|
95
95
|
end
|
96
96
|
|
97
97
|
test "reset store" do
|
98
98
|
Coverband::Collectors::ViewTracker.expects(:supported_version?).returns(true)
|
99
99
|
store = fake_store
|
100
100
|
store.raw_store.expects(:del).with(tracker_key)
|
101
|
-
store.raw_store.expects(:del).with("
|
101
|
+
store.raw_store.expects(:del).with("ViewTracker_tracker_time")
|
102
102
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir")
|
103
|
-
tracker.
|
103
|
+
tracker.track_key(identifier: "file")
|
104
104
|
tracker.reset_recordings
|
105
105
|
end
|
106
106
|
|
107
|
-
test "
|
107
|
+
test "clear_key" do
|
108
108
|
Coverband::Collectors::ViewTracker.expects(:supported_version?).returns(true)
|
109
109
|
store = fake_store
|
110
110
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/file"
|
111
111
|
store.raw_store.expects(:hdel).with(tracker_key, file_path)
|
112
112
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: "dir")
|
113
|
-
tracker.
|
114
|
-
tracker.
|
115
|
-
assert_equal [], tracker.
|
113
|
+
tracker.track_key(identifier: file_path)
|
114
|
+
tracker.clear_key!("file")
|
115
|
+
assert_equal [], tracker.logged_keys
|
116
116
|
end
|
117
117
|
|
118
118
|
protected
|
@@ -38,6 +38,16 @@ class BaseTest < Minitest::Test
|
|
38
38
|
assert_equal expected, Coverband.configuration.ignore
|
39
39
|
end
|
40
40
|
|
41
|
+
test "ignore catches regex errors" do
|
42
|
+
Coverband.configuration.logger.expects(:error).with("an invalid regular expression was passed in, ensure string are valid regex patterns *invalidRegex*")
|
43
|
+
Coverband.configure do |config|
|
44
|
+
config.ignore = ["*invalidRegex*"]
|
45
|
+
end
|
46
|
+
Coverband::Collectors::Coverage.instance.reset_instance
|
47
|
+
expected = Coverband::Configuration::IGNORE_DEFAULTS << "config/environments"
|
48
|
+
assert_equal expected, Coverband.configuration.ignore
|
49
|
+
end
|
50
|
+
|
41
51
|
test "ignore" do
|
42
52
|
Coverband::Collectors::Coverage.instance.reset_instance
|
43
53
|
assert !Coverband.configuration.ignore.first.nil?
|
@@ -22,35 +22,35 @@ class RailsFullStackTest < Minitest::Test
|
|
22
22
|
visit "/dummy_view/show"
|
23
23
|
assert_content("I am no dummy view tracker text")
|
24
24
|
Coverband.report_coverage
|
25
|
-
Coverband.configuration.view_tracker&.
|
26
|
-
Coverband.configuration.route_tracker&.
|
27
|
-
visit "/coverage/
|
25
|
+
Coverband.configuration.view_tracker&.save_report
|
26
|
+
Coverband.configuration.route_tracker&.save_report
|
27
|
+
visit "/coverage/views_tracker"
|
28
28
|
assert_content("Used Views: (1)")
|
29
29
|
assert_content("Unused Views: (2)")
|
30
|
-
assert_selector("li.used-
|
31
|
-
assert_selector("li.unused-
|
32
|
-
assert_selector("li.unused-
|
30
|
+
assert_selector("li.used-keys", text: "dummy_view/show.html.erb")
|
31
|
+
assert_selector("li.unused-keys", text: "dummy_view/show_haml.html.haml")
|
32
|
+
assert_selector("li.unused-keys", text: "dummy_view/show_slim.html.slim")
|
33
33
|
|
34
|
-
visit "/coverage/
|
34
|
+
visit "/coverage/routes_tracker"
|
35
35
|
assert_content("Used Routes: (1)")
|
36
36
|
assert_content("Unused Routes: (5)")
|
37
37
|
|
38
38
|
visit "/dummy_view/show_haml"
|
39
39
|
assert_content("I am haml text")
|
40
40
|
Coverband.report_coverage
|
41
|
-
Coverband.configuration.view_tracker&.
|
42
|
-
visit "/coverage/
|
41
|
+
Coverband.configuration.view_tracker&.save_report
|
42
|
+
visit "/coverage/views_tracker"
|
43
43
|
assert_content("Used Views: (2)")
|
44
44
|
assert_content("Unused Views: (1)")
|
45
|
-
assert_selector("li.used-
|
45
|
+
assert_selector("li.used-keys", text: "dummy_view/show_haml.html.haml")
|
46
46
|
|
47
47
|
visit "/dummy_view/show_slim"
|
48
48
|
assert_content("I am slim text")
|
49
49
|
Coverband.report_coverage
|
50
|
-
Coverband.configuration.view_tracker&.
|
51
|
-
visit "/coverage/
|
50
|
+
Coverband.configuration.view_tracker&.save_report
|
51
|
+
visit "/coverage/views_tracker"
|
52
52
|
assert_content("Used Views: (3)")
|
53
53
|
assert_content("Unused Views: (0)")
|
54
|
-
assert_selector("li.used-
|
54
|
+
assert_selector("li.used-keys", text: "dummy_view/show_slim.html.slim")
|
55
55
|
end
|
56
56
|
end
|
@@ -17,7 +17,7 @@ class RailsRoutesWithoutConfigStackTest < Minitest::Test
|
|
17
17
|
output = `sleep 7 && curl http://localhost:9999/dummy_view/show`
|
18
18
|
assert output.match(/rendered view/)
|
19
19
|
assert output.match(/I am no dummy view tracker text/)
|
20
|
-
output = `sleep 2 && curl http://localhost:9999/coverage/
|
20
|
+
output = `sleep 2 && curl http://localhost:9999/coverage/routes_tracker`
|
21
21
|
assert output.match(/Used Routes: \(1\)/)
|
22
22
|
assert output.match(/dummy_view\/show/)
|
23
23
|
assert output.match(/GET/)
|
@@ -17,7 +17,7 @@ class RailsWithoutConfigStackTest < Minitest::Test
|
|
17
17
|
output = `sleep 7 && curl http://localhost:9999/dummy_view/show`
|
18
18
|
assert output.match(/rendered view/)
|
19
19
|
assert output.match(/I am no dummy view tracker text/)
|
20
|
-
output = `sleep 2 && curl http://localhost:9999/coverage/
|
20
|
+
output = `sleep 2 && curl http://localhost:9999/coverage/views_tracker`
|
21
21
|
assert output.match(/Used Views: \(1\)/)
|
22
22
|
assert output.match(/dummy_view\/show/)
|
23
23
|
end
|
@@ -11,31 +11,30 @@
|
|
11
11
|
|
12
12
|
<body>
|
13
13
|
<div id="wrapper" style="">
|
14
|
-
<%= display_nav(active_link:
|
14
|
+
<%= display_nav(active_link: tracker.route) %>
|
15
15
|
<div id="content">
|
16
|
-
<% tracker = Coverband::Collectors::TranslationTracker.new(store: Coverband.configuration.store) %>
|
17
16
|
<h4>
|
18
17
|
<% if Coverband.configuration.web_enable_clear %>
|
19
|
-
<%= button("#{base_path}
|
18
|
+
<%= button("#{base_path}clear_#{tracker.route}", "reset #{tracker.title} tracker", delete: true) %>
|
20
19
|
<% end %>
|
21
20
|
</h4>
|
22
|
-
<h2>Unused
|
23
|
-
<p>These
|
21
|
+
<h2>Unused <%= tracker.title %>: (<%= tracker.unused_keys.length %>)</h2>
|
22
|
+
<p>These <%= tracker.title %> have not been rendered since recording started at <%= tracker.tracking_since %></p>
|
24
23
|
<ul>
|
25
24
|
<% tracker.unused_keys.each do |key| %>
|
26
25
|
<li class="unused-keys"><%= key %></li>
|
27
26
|
<% end %>
|
28
27
|
</ul>
|
29
28
|
|
30
|
-
<h2>Used
|
31
|
-
<p>These
|
29
|
+
<h2>Used <%= tracker.title %>: (<%= tracker.used_keys.length %>)</h2>
|
30
|
+
<p>These <%= tracker.title %> have been rendered at least once</p>
|
32
31
|
<ul>
|
33
32
|
<% tracker.used_keys.each_pair do |key, time_at| %>
|
34
33
|
<li class="used-keys">
|
35
34
|
<%= key %>
|
36
35
|
<span class="last_seen_at">last activity recorded <%= Time.at(time_at.to_i)%></span>
|
37
36
|
<% if Coverband.configuration.web_enable_clear %>
|
38
|
-
<%= button("#{base_path}
|
37
|
+
<%= button("#{base_path}clear_#{tracker.route}_key?key=#{key}", 'reset tracked key', delete: true) %>
|
39
38
|
<% end %>
|
40
39
|
</li>
|
41
40
|
<% end %>
|
data/views/nav.erb
CHANGED
@@ -29,13 +29,13 @@
|
|
29
29
|
<li><a href='<%= base_path %>'>Coverage</a></li>
|
30
30
|
<% end %>
|
31
31
|
<% if Coverband.configuration.track_views %>
|
32
|
-
<li class='<%= nav_options[:active_link] == '
|
33
|
-
<a href='<%= base_path %>
|
32
|
+
<li class='<%= nav_options[:active_link] == 'views_tracker' ? 'active' : '' %>'>
|
33
|
+
<a href='<%= base_path %>views_tracker'>Views Tracker</a>
|
34
34
|
</li>
|
35
35
|
<% end %>
|
36
36
|
<% if Coverband.configuration.track_routes %>
|
37
|
-
<li class='<%= nav_options[:active_link] == '
|
38
|
-
<a href='<%= base_path %>
|
37
|
+
<li class='<%= nav_options[:active_link] == 'routes_tracker' ? 'active' : '' %>'>
|
38
|
+
<a href='<%= base_path %>routes_tracker'>Route Tracker</a>
|
39
39
|
</li>
|
40
40
|
<% end %>
|
41
41
|
<% if Coverband.configuration.track_translations %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coverband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.6.rc.
|
4
|
+
version: 5.2.6.rc.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Mayer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: benchmark-ips
|
@@ -299,6 +299,7 @@ files:
|
|
299
299
|
- lib/coverband/adapters/stdout_store.rb
|
300
300
|
- lib/coverband/adapters/web_service_store.rb
|
301
301
|
- lib/coverband/at_exit.rb
|
302
|
+
- lib/coverband/collectors/abstract_tracker.rb
|
302
303
|
- lib/coverband/collectors/coverage.rb
|
303
304
|
- lib/coverband/collectors/delta.rb
|
304
305
|
- lib/coverband/collectors/route_tracker.rb
|
@@ -488,16 +489,14 @@ files:
|
|
488
489
|
- test/rails_test_helper.rb
|
489
490
|
- test/test_helper.rb
|
490
491
|
- test/unique_files.rb
|
492
|
+
- views/abstract_tracker.erb
|
491
493
|
- views/data.erb
|
492
494
|
- views/file_list.erb
|
493
495
|
- views/layout.erb
|
494
496
|
- views/nav.erb
|
495
|
-
- views/route_tracker.erb
|
496
497
|
- views/settings.erb
|
497
498
|
- views/source_file.erb
|
498
499
|
- views/source_file_loader.erb
|
499
|
-
- views/translations_tracker.erb
|
500
|
-
- views/view_tracker.erb
|
501
500
|
homepage: https://github.com/danmayer/coverband
|
502
501
|
licenses:
|
503
502
|
- MIT
|
data/views/route_tracker.erb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html xmlns='http://www.w3.org/1999/xhtml'>
|
3
|
-
<head>
|
4
|
-
<title>Coverband Info: <%= Coverband::VERSION %></title>
|
5
|
-
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
6
|
-
<script src='<%= assets_path('dependencies.js') %>' type='text/javascript'></script>
|
7
|
-
<script src='<%= assets_path('application.js') %>' type='text/javascript'></script>
|
8
|
-
<link href='<%= assets_path('application.css') %>' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
9
|
-
<link rel="icon" type="image/png" href="<%= assets_path('favicon.png') %>" />
|
10
|
-
</head>
|
11
|
-
|
12
|
-
<body>
|
13
|
-
<div id="wrapper" style="">
|
14
|
-
<%= display_nav(active_link: 'route_tracker') %>
|
15
|
-
<div id="content">
|
16
|
-
<% tracker = Coverband::Collectors::RouteTracker.new(store: Coverband.configuration.store) %>
|
17
|
-
<h4>
|
18
|
-
<% if Coverband.configuration.web_enable_clear %>
|
19
|
-
<%= button("#{base_path}clear_route_tracking", 'reset route tracker', delete: true) %>
|
20
|
-
<% end %>
|
21
|
-
</h4>
|
22
|
-
<h2>Unused Routes: (<%= tracker.unused_routes.length %>)</h2>
|
23
|
-
<p>These routes have not been rendered since recording started at <%= tracker.tracking_since %></p>
|
24
|
-
<ul>
|
25
|
-
<% tracker.unused_routes.each do |route| %>
|
26
|
-
<li class="unused-routes"><%= route %></li>
|
27
|
-
<% end %>
|
28
|
-
</ul>
|
29
|
-
|
30
|
-
<h2>Used Routes: (<%= tracker.used_routes.length %>)</h2>
|
31
|
-
<p>These routes have been rendered at least once</p>
|
32
|
-
<ul>
|
33
|
-
<% tracker.used_routes.each_pair do |route, time_at| %>
|
34
|
-
<li class="used-routes">
|
35
|
-
<%= route %>
|
36
|
-
<span class="last_seen_at">last activity recorded <%= Time.at(time_at.to_i)%></span>
|
37
|
-
<% if Coverband.configuration.web_enable_clear %>
|
38
|
-
<%= button("#{base_path}clear_route_tracking_route?route=#{route}", 'reset tracked route', delete: true) %>
|
39
|
-
<% end %>
|
40
|
-
</li>
|
41
|
-
<% end %>
|
42
|
-
</ul>
|
43
|
-
</div>
|
44
|
-
<div id="footer">
|
45
|
-
Generated by <a href="http://github.com/danmayer/coverband">Coverband</a> v<%= Coverband::VERSION %>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
</body>
|
49
|
-
</html>
|
data/views/view_tracker.erb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html xmlns='http://www.w3.org/1999/xhtml'>
|
3
|
-
<head>
|
4
|
-
<title>Coverband Info: <%= Coverband::VERSION %></title>
|
5
|
-
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
6
|
-
<script src='<%= assets_path('dependencies.js') %>' type='text/javascript'></script>
|
7
|
-
<script src='<%= assets_path('application.js') %>' type='text/javascript'></script>
|
8
|
-
<link href='<%= assets_path('application.css') %>' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
9
|
-
<link rel="icon" type="image/png" href="<%= assets_path('favicon.png') %>" />
|
10
|
-
</head>
|
11
|
-
|
12
|
-
<body>
|
13
|
-
<div id="wrapper" style="">
|
14
|
-
<%= display_nav(active_link: 'view_tracker') %>
|
15
|
-
<div id="content">
|
16
|
-
<% tracker = Coverband::Collectors::ViewTracker.new(store: Coverband.configuration.store) %>
|
17
|
-
<h4>
|
18
|
-
<% if Coverband.configuration.web_enable_clear %>
|
19
|
-
<%= button("#{base_path}clear_view_tracking", 'reset view tracker', delete: true) %>
|
20
|
-
<% end %>
|
21
|
-
<% if Coverband.configuration.web_debug %>
|
22
|
-
<a href='<%= "#{base_path}view_tracker_data" %>'>view tracker data</a>
|
23
|
-
<% end %>
|
24
|
-
</h4>
|
25
|
-
<h2>Unused Views: (<%= tracker.unused_views.length %>)</h2>
|
26
|
-
<p>These views have not been rendered since recording started at <%= tracker.tracking_since %></p>
|
27
|
-
<ul>
|
28
|
-
<% tracker.unused_views.each do |view_file| %>
|
29
|
-
<li class="unused-views"><%= view_file %></li>
|
30
|
-
<% end %>
|
31
|
-
</ul>
|
32
|
-
|
33
|
-
<h2>Used Views: (<%= tracker.used_views.length %>)</h2>
|
34
|
-
<p>These views have been rendered at least once</p>
|
35
|
-
<ul>
|
36
|
-
<% tracker.used_views.each_pair do |view_file, time_at| %>
|
37
|
-
<li class="used-views">
|
38
|
-
<%= view_file %>
|
39
|
-
<span class="last_seen_at">last activity recorded <%= Time.at(time_at.to_i)%></span>
|
40
|
-
<% if Coverband.configuration.web_enable_clear %>
|
41
|
-
<%= button("#{base_path}clear_view_tracking_file?filename=#{view_file}", 'reset tracked file', delete: true) %>
|
42
|
-
<% end %>
|
43
|
-
</li>
|
44
|
-
<% end %>
|
45
|
-
</ul>
|
46
|
-
</div>
|
47
|
-
<div id="footer">
|
48
|
-
Generated by <a href="http://github.com/danmayer/coverband">Coverband</a> v<%= Coverband::VERSION %>
|
49
|
-
</div>
|
50
|
-
</div>
|
51
|
-
</body>
|
52
|
-
</html>
|