Module: PigCI
- Extended by:
- PigCI
- Included in:
- PigCI
- Defined in:
- lib/pig_ci.rb,
lib/pig_ci/version.rb
Defined Under Namespace
Modules: TestFrameworks
Classes: Configuration, Decorator, Metric, Profiler, ProfilerEngine, Report, Summary
Constant Summary
collapse
- VERSION =
"1.1.0".freeze
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#commit_sha1 ⇒ Object
104
105
106
|
# File 'lib/pig_ci.rb', line 104
def commit_sha1
@commit_sha1 || ENV["CI_COMMIT_ID"] || ENV["CIRCLE_SHA1"] || ENV["TRAVIS_COMMIT"] || `git rev-parse HEAD`.strip
end
|
#during_setup_eager_load_application=(value) ⇒ Object
Sets the attribute during_setup_eager_load_application
62
63
64
|
# File 'lib/pig_ci.rb', line 62
def during_setup_eager_load_application=(value)
@during_setup_eager_load_application = value
end
|
#during_setup_make_blank_application_request=(value) ⇒ Object
Sets the attribute during_setup_make_blank_application_request
67
68
69
|
# File 'lib/pig_ci.rb', line 67
def during_setup_make_blank_application_request=(value)
@during_setup_make_blank_application_request = value
end
|
#during_setup_precompile_assets=(value) ⇒ Object
Sets the attribute during_setup_precompile_assets
72
73
74
|
# File 'lib/pig_ci.rb', line 72
def during_setup_precompile_assets=(value)
@during_setup_precompile_assets = value
end
|
#enabled=(value) ⇒ Object
Sets the attribute enabled
20
21
22
|
# File 'lib/pig_ci.rb', line 20
def enabled=(value)
@enabled = value
end
|
#generate_html_summary ⇒ Object
Returns the value of attribute generate_html_summary.
47
48
49
|
# File 'lib/pig_ci.rb', line 47
def generate_html_summary
@generate_html_summary
end
|
#generate_terminal_summary ⇒ Object
Returns the value of attribute generate_terminal_summary.
42
43
44
|
# File 'lib/pig_ci.rb', line 42
def generate_terminal_summary
@generate_terminal_summary
end
|
#head_branch ⇒ Object
109
110
111
|
# File 'lib/pig_ci.rb', line 109
def head_branch
@head_branch || ENV["CI_BRANCH"] || ENV["CIRCLE_BRANCH"] || ENV["TRAVIS_BRANCH"] || `git rev-parse --abbrev-ref HEAD`.strip
end
|
#historical_data_run_limit ⇒ Object
89
90
91
|
# File 'lib/pig_ci.rb', line 89
def historical_data_run_limit
@historical_data_run_limit ||= 10
end
|
#ignore_cached_queries=(value) ⇒ Object
Rails caches repeated queries within the same request. You can not count any cached queries if you’d like.
27
28
29
|
# File 'lib/pig_ci.rb', line 27
def ignore_cached_queries=(value)
@ignore_cached_queries = value
end
|
#locale ⇒ Object
119
120
121
|
# File 'lib/pig_ci.rb', line 119
def locale
@locale || :en
end
|
#max_change_percentage_precision ⇒ Object
53
54
55
|
# File 'lib/pig_ci.rb', line 53
def max_change_percentage_precision
@max_change_percentage_precision || 1
end
|
#output_directory ⇒ Object
38
39
40
|
# File 'lib/pig_ci.rb', line 38
def output_directory
@output_directory || Pathname.new(Dir.getwd).join("pig-ci")
end
|
#pid ⇒ Object
Returns the value of attribute pid.
18
19
20
|
# File 'lib/pig_ci.rb', line 18
def pid
@pid
end
|
#profiler_engine ⇒ Object
#report_memory_precision ⇒ Object
58
59
60
|
# File 'lib/pig_ci.rb', line 58
def report_memory_precision
@report_memory_precision || 2
end
|
#report_row_sort_by(data) ⇒ Object
84
85
86
|
# File 'lib/pig_ci.rb', line 84
def report_row_sort_by(data)
(@report_row_sort_by || proc { |d| d[:max].to_i * -1 }).call(data)
end
|
#run_timestamp ⇒ Object
94
95
96
|
# File 'lib/pig_ci.rb', line 94
def run_timestamp
@run_timestamp ||= Time.now.to_i.to_s
end
|
#terminal_report_row_limit ⇒ Object
78
79
80
|
# File 'lib/pig_ci.rb', line 78
def terminal_report_row_limit
@terminal_report_row_limit || -1
end
|
#tmp_directory ⇒ Object
33
34
35
|
# File 'lib/pig_ci.rb', line 33
def tmp_directory
@tmp_directory || Pathname.new(Dir.getwd).join("tmp", "pig-ci")
end
|
Class Method Details
.load_i18ns! ⇒ Object
150
151
152
153
|
# File 'lib/pig_ci.rb', line 150
def load_i18ns!
I18n.available_locales << PigCI.locale
I18n.load_path += Dir["#{File.expand_path("../config/locales/pig_ci", __dir__)}/*.{rb,yml}"]
end
|
.run_exit_tasks! ⇒ Object
.start(&block) ⇒ Object
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
# File 'lib/pig_ci.rb', line 133
def start(&block)
self.pid = Process.pid
PigCI::TestFrameworks::Rspec.configure! if defined?(::RSpec)
block&.call(self)
load_i18ns!
Dir.mkdir(tmp_directory) unless File.exist?(tmp_directory)
Dir.mkdir(output_directory) unless File.exist?(output_directory)
profiler_engine.setup!
end
|
Instance Method Details
#api_key=(value) ⇒ Object
Throw deprecation notice for setting API
114
115
116
|
# File 'lib/pig_ci.rb', line 114
def api_key=(value)
puts "DEPRECATED: PigCI.com API has been retired, you no longer need to set config.api_key in your spec/rails_helper.rb file."
end
|
#during_setup_eager_load_application? ⇒ Boolean
63
64
65
|
# File 'lib/pig_ci.rb', line 63
def during_setup_eager_load_application?
@during_setup_eager_load_application.nil? || @during_setup_eager_load_application
end
|
#during_setup_make_blank_application_request? ⇒ Boolean
68
69
70
|
# File 'lib/pig_ci.rb', line 68
def during_setup_make_blank_application_request?
@during_setup_make_blank_application_request.nil? || @during_setup_make_blank_application_request
end
|
#during_setup_precompile_assets? ⇒ Boolean
73
74
75
|
# File 'lib/pig_ci.rb', line 73
def during_setup_precompile_assets?
@during_setup_precompile_assets.nil? || @during_setup_precompile_assets
end
|
#enabled? ⇒ Boolean
21
22
23
|
# File 'lib/pig_ci.rb', line 21
def enabled?
@enabled.nil? ? true : @enabled
end
|
#generate_html_summary? ⇒ Boolean
48
49
50
|
# File 'lib/pig_ci.rb', line 48
def generate_html_summary?
@generate_html_summary.nil? || @generate_html_summary
end
|
#generate_terminal_summary? ⇒ Boolean
43
44
45
|
# File 'lib/pig_ci.rb', line 43
def generate_terminal_summary?
@generate_terminal_summary.nil? || @generate_terminal_summary
end
|
#ignore_cached_queries? ⇒ Boolean
28
29
30
|
# File 'lib/pig_ci.rb', line 28
def ignore_cached_queries?
@ignore_cached_queries.nil? ? false : @ignore_cached_queries
end
|
#thresholds=(values) ⇒ Object