pig-ci-rails 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/README.md +3 -7
- data/lib/pig_ci.rb +6 -0
- data/lib/pig_ci/profiler_engine/rails.rb +8 -0
- data/lib/pig_ci/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a5d58f2c466ba3ddd5a11b5c4af7e6a9d300e5526ea1c6d3cf808f8e73ea6b9
|
4
|
+
data.tar.gz: 1fd23fe41910c53a784d7ef5ac77b80c05085279a879aff4a2f760c4b19682d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7c7467d599bc6f67ce2c0224b7cc0f950341c81461dca606c771b3d8f07eb019df98e408625fee01b3a543b1d61b72aa1c06f21bdc76fe8a1ea6841b3409ea9
|
7
|
+
data.tar.gz: 4b4f5bdefac64e25125e93d35ac4167e010be1d4da7e37ceaf95d3c371162f21f0d16d5ec56772e922c1dac7a514ee7f79b6be8f6d93afee6a53e0bccdda6689
|
data/.github/FUNDING.yml
ADDED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -96,7 +96,7 @@ end
|
|
96
96
|
|
97
97
|
#### Request Time
|
98
98
|
|
99
|
-
Often the first request test will be slow, as rails is loading a full environment. To mitigate this issue, this gem will make a blank request to your application before your test suite starts.
|
99
|
+
Often the first request test will be slow, as rails is loading a full environment & rendering assets. To mitigate this issue, this gem will make a blank request to your application before your test suite starts & compiling assets.
|
100
100
|
|
101
101
|
You can disable this functionality by setting your configuration to be:
|
102
102
|
|
@@ -104,15 +104,10 @@ You can disable this functionality by setting your configuration to be:
|
|
104
104
|
require 'pig_ci'
|
105
105
|
PigCI.start do |config|
|
106
106
|
config.during_setup_make_blank_application_request = false
|
107
|
+
config.during_setup_precompile_assets = false
|
107
108
|
end
|
108
109
|
```
|
109
110
|
|
110
|
-
You can also improve the first request performance (and overall memory usage) by precompiling your assets before running RSpec:
|
111
|
-
|
112
|
-
```ruby
|
113
|
-
bundle exec rake assets:precompile RAILS_ENV=test
|
114
|
-
```
|
115
|
-
|
116
111
|
## Authors
|
117
112
|
|
118
113
|
* This gem was made by [@MikeRogers0](https://github.com/MikeRogers0).
|
@@ -135,6 +130,7 @@ Features I'd like to add at some point:
|
|
135
130
|
* Document setting branch/commit encase of weird CI.
|
136
131
|
* Add rake for submitting reports.
|
137
132
|
* https://rubydoc.info/gems/yard/file/docs/GettingStarted.md - Document the gem so it's easier for people to jump on.
|
133
|
+
* Attempt to precompile assets (They throw off the first request timing)
|
138
134
|
|
139
135
|
## Contributing
|
140
136
|
|
data/lib/pig_ci.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'active_support'
|
2
2
|
require 'active_support/core_ext/string/inflections'
|
3
|
+
require 'rake'
|
3
4
|
|
4
5
|
require 'pig_ci/version'
|
5
6
|
require 'pig_ci/api'
|
@@ -55,6 +56,11 @@ module PigCI
|
|
55
56
|
@during_setup_make_blank_application_request.nil? || @during_setup_make_blank_application_request
|
56
57
|
end
|
57
58
|
|
59
|
+
attr_writer :during_setup_precompile_assets
|
60
|
+
def during_setup_precompile_assets?
|
61
|
+
@during_setup_precompile_assets.nil? || @during_setup_precompile_assets
|
62
|
+
end
|
63
|
+
|
58
64
|
attr_writer :terminal_report_row_limit
|
59
65
|
def terminal_report_row_limit
|
60
66
|
@terminal_report_row_limit || -1
|
@@ -20,6 +20,7 @@ class PigCI::ProfilerEngine::Rails < ::PigCI::ProfilerEngine
|
|
20
20
|
|
21
21
|
def setup!
|
22
22
|
super do
|
23
|
+
precompile_assets! if PigCI.during_setup_precompile_assets?
|
23
24
|
eager_load_rails! if PigCI.during_setup_eager_load_application?
|
24
25
|
make_blank_application_request! if PigCI.during_setup_make_blank_application_request?
|
25
26
|
end
|
@@ -27,9 +28,16 @@ class PigCI::ProfilerEngine::Rails < ::PigCI::ProfilerEngine
|
|
27
28
|
|
28
29
|
private
|
29
30
|
|
31
|
+
def precompile_assets!
|
32
|
+
# From: https://github.com/rails/sprockets-rails/blob/e9ca63edb6e658cdfcf8a35670c525b369c2ccca/test/test_railtie.rb#L7-L13
|
33
|
+
::Rails.application.load_tasks
|
34
|
+
::Rake.application['assets:precompile'].execute
|
35
|
+
end
|
36
|
+
|
30
37
|
def eager_load_rails!
|
31
38
|
# Eager load rails to give more accurate memory levels.
|
32
39
|
::Rails.application.eager_load!
|
40
|
+
::Rails.application.routes.eager_load!
|
33
41
|
::Rails::Engine.subclasses.map(&:instance).each(&:eager_load!)
|
34
42
|
::ActiveRecord::Base.descendants
|
35
43
|
end
|
data/lib/pig_ci/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pig-ci-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Rogers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -200,6 +200,7 @@ executables: []
|
|
200
200
|
extensions: []
|
201
201
|
extra_rdoc_files: []
|
202
202
|
files:
|
203
|
+
- ".github/FUNDING.yml"
|
203
204
|
- ".gitignore"
|
204
205
|
- ".rubocop.yml"
|
205
206
|
- ".travis.yml"
|