ultra-pro-pkg 0.0.1
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 +7 -0
- data/simplecov-1.0.0/LICENSE +20 -0
- data/simplecov-1.0.0/README.md +1524 -0
- data/simplecov-1.0.0/doc/alternate-formatters.md +66 -0
- data/simplecov-1.0.0/doc/commercial-services.md +25 -0
- data/simplecov-1.0.0/doc/editor-integration.md +18 -0
- data/simplecov-1.0.0/exe/simplecov +11 -0
- data/simplecov-1.0.0/lib/minitest/simplecov_plugin.rb +171 -0
- data/simplecov-1.0.0/lib/simplecov/autostart.rb +11 -0
- data/simplecov-1.0.0/lib/simplecov/cli/clean.rb +47 -0
- data/simplecov-1.0.0/lib/simplecov/cli/coverage.rb +91 -0
- data/simplecov-1.0.0/lib/simplecov/cli/diff.rb +151 -0
- data/simplecov-1.0.0/lib/simplecov/cli/dotfile.rb +100 -0
- data/simplecov-1.0.0/lib/simplecov/cli/merge.rb +116 -0
- data/simplecov-1.0.0/lib/simplecov/cli/open.rb +50 -0
- data/simplecov-1.0.0/lib/simplecov/cli/report.rb +84 -0
- data/simplecov-1.0.0/lib/simplecov/cli/run.rb +36 -0
- data/simplecov-1.0.0/lib/simplecov/cli/serve.rb +139 -0
- data/simplecov-1.0.0/lib/simplecov/cli/uncovered.rb +107 -0
- data/simplecov-1.0.0/lib/simplecov/cli.rb +150 -0
- data/simplecov-1.0.0/lib/simplecov/color.rb +74 -0
- data/simplecov-1.0.0/lib/simplecov/combine/branches_combiner.rb +54 -0
- data/simplecov-1.0.0/lib/simplecov/combine/files_combiner.rb +30 -0
- data/simplecov-1.0.0/lib/simplecov/combine/lines_combiner.rb +45 -0
- data/simplecov-1.0.0/lib/simplecov/combine/methods_combiner.rb +26 -0
- data/simplecov-1.0.0/lib/simplecov/combine/results_combiner.rb +61 -0
- data/simplecov-1.0.0/lib/simplecov/combine.rb +30 -0
- data/simplecov-1.0.0/lib/simplecov/command_guesser.rb +78 -0
- data/simplecov-1.0.0/lib/simplecov/configuration/coverage.rb +171 -0
- data/simplecov-1.0.0/lib/simplecov/configuration/coverage_criteria.rb +156 -0
- data/simplecov-1.0.0/lib/simplecov/configuration/filters.rb +197 -0
- data/simplecov-1.0.0/lib/simplecov/configuration/formatting.rb +119 -0
- data/simplecov-1.0.0/lib/simplecov/configuration/ignored_entries.rb +63 -0
- data/simplecov-1.0.0/lib/simplecov/configuration/merging.rb +164 -0
- data/simplecov-1.0.0/lib/simplecov/configuration/thresholds.rb +174 -0
- data/simplecov-1.0.0/lib/simplecov/configuration.rb +184 -0
- data/simplecov-1.0.0/lib/simplecov/coverage_statistics.rb +59 -0
- data/simplecov-1.0.0/lib/simplecov/coverage_violations.rb +148 -0
- data/simplecov-1.0.0/lib/simplecov/defaults.rb +60 -0
- data/simplecov-1.0.0/lib/simplecov/deprecation.rb +45 -0
- data/simplecov-1.0.0/lib/simplecov/directive.rb +162 -0
- data/simplecov-1.0.0/lib/simplecov/exit_codes/exit_code_handling.rb +35 -0
- data/simplecov-1.0.0/lib/simplecov/exit_codes/maximum_coverage_drop_check.rb +45 -0
- data/simplecov-1.0.0/lib/simplecov/exit_codes/maximum_overall_coverage_check.rb +45 -0
- data/simplecov-1.0.0/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb +44 -0
- data/simplecov-1.0.0/lib/simplecov/exit_codes/minimum_coverage_by_group_check.rb +41 -0
- data/simplecov-1.0.0/lib/simplecov/exit_codes/minimum_overall_coverage_check.rb +70 -0
- data/simplecov-1.0.0/lib/simplecov/exit_codes.rb +18 -0
- data/simplecov-1.0.0/lib/simplecov/exit_handling.rb +158 -0
- data/simplecov-1.0.0/lib/simplecov/file_list.rb +164 -0
- data/simplecov-1.0.0/lib/simplecov/filter.rb +139 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/base.rb +101 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/html_formatter/public/application.css +1 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/html_formatter/public/application.js +18 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/html_formatter/public/favicon_green.png +0 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/html_formatter/public/favicon_red.png +0 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/html_formatter/public/favicon_yellow.png +0 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/html_formatter/public/index.html +56 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/html_formatter.rb +79 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/json_formatter/errors_formatter.rb +84 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/json_formatter/result_hash_formatter.rb +128 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/json_formatter/source_file_formatter.rb +99 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/json_formatter.rb +87 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/multi_formatter.rb +31 -0
- data/simplecov-1.0.0/lib/simplecov/formatter/simple_formatter.rb +23 -0
- data/simplecov-1.0.0/lib/simplecov/formatter.rb +14 -0
- data/simplecov-1.0.0/lib/simplecov/last_run.rb +35 -0
- data/simplecov-1.0.0/lib/simplecov/lines_classifier.rb +60 -0
- data/simplecov-1.0.0/lib/simplecov/load_global_config.rb +13 -0
- data/simplecov-1.0.0/lib/simplecov/no_defaults.rb +4 -0
- data/simplecov-1.0.0/lib/simplecov/parallel_adapters/base.rb +61 -0
- data/simplecov-1.0.0/lib/simplecov/parallel_adapters/generic.rb +44 -0
- data/simplecov-1.0.0/lib/simplecov/parallel_adapters/parallel_tests.rb +93 -0
- data/simplecov-1.0.0/lib/simplecov/parallel_adapters.rb +83 -0
- data/simplecov-1.0.0/lib/simplecov/parallel_coordination.rb +129 -0
- data/simplecov-1.0.0/lib/simplecov/process.rb +37 -0
- data/simplecov-1.0.0/lib/simplecov/profiles/bundler_filter.rb +5 -0
- data/simplecov-1.0.0/lib/simplecov/profiles/hidden_filter.rb +5 -0
- data/simplecov-1.0.0/lib/simplecov/profiles/rails.rb +32 -0
- data/simplecov-1.0.0/lib/simplecov/profiles/root_filter.rb +11 -0
- data/simplecov-1.0.0/lib/simplecov/profiles/strict.rb +32 -0
- data/simplecov-1.0.0/lib/simplecov/profiles/test_frameworks.rb +5 -0
- data/simplecov-1.0.0/lib/simplecov/profiles.rb +64 -0
- data/simplecov-1.0.0/lib/simplecov/result/missing_source_files_reporter.rb +49 -0
- data/simplecov-1.0.0/lib/simplecov/result/source_file_builder.rb +51 -0
- data/simplecov-1.0.0/lib/simplecov/result.rb +183 -0
- data/simplecov-1.0.0/lib/simplecov/result_adapter.rb +92 -0
- data/simplecov-1.0.0/lib/simplecov/result_merger/legacy_format_adapter.rb +28 -0
- data/simplecov-1.0.0/lib/simplecov/result_merger/resultset_file.rb +38 -0
- data/simplecov-1.0.0/lib/simplecov/result_merger/resultset_store.rb +50 -0
- data/simplecov-1.0.0/lib/simplecov/result_merger.rb +162 -0
- data/simplecov-1.0.0/lib/simplecov/result_processing.rb +179 -0
- data/simplecov-1.0.0/lib/simplecov/simulate_coverage.rb +75 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/branch.rb +82 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/branch_builder.rb +114 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/builder_context.rb +28 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/line.rb +77 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/line_builder.rb +43 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/method.rb +52 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/method_builder.rb +58 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/ruby_data_parser.rb +88 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/skip_chunks.rb +75 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/source_loader.rb +63 -0
- data/simplecov-1.0.0/lib/simplecov/source_file/statistics.rb +57 -0
- data/simplecov-1.0.0/lib/simplecov/source_file.rb +189 -0
- data/simplecov-1.0.0/lib/simplecov/static_coverage_extractor/method_collector.rb +55 -0
- data/simplecov-1.0.0/lib/simplecov/static_coverage_extractor/visitor.rb +171 -0
- data/simplecov-1.0.0/lib/simplecov/static_coverage_extractor.rb +110 -0
- data/simplecov-1.0.0/lib/simplecov/useless_results_remover.rb +27 -0
- data/simplecov-1.0.0/lib/simplecov/version.rb +5 -0
- data/simplecov-1.0.0/lib/simplecov-html.rb +4 -0
- data/simplecov-1.0.0/lib/simplecov.rb +255 -0
- data/simplecov-1.0.0/lib/simplecov_json_formatter.rb +4 -0
- data/simplecov-1.0.0/schemas/coverage-v1.0.schema.json +306 -0
- data/simplecov-1.0.0/schemas/coverage.schema.json +306 -0
- data/ultra-pro-pkg.gemspec +12 -0
- metadata +156 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Code coverage for ruby. Please check out README for a full introduction.
|
|
5
|
+
#
|
|
6
|
+
module SimpleCov
|
|
7
|
+
# Raised when a user's configuration is internally inconsistent — e.g.
|
|
8
|
+
# every coverage criterion has been disabled.
|
|
9
|
+
class ConfigurationError < StandardError; end
|
|
10
|
+
|
|
11
|
+
class << self
|
|
12
|
+
CRITERION_TO_RUBY_COVERAGE = {
|
|
13
|
+
branch: :branches,
|
|
14
|
+
line: :lines,
|
|
15
|
+
method: :methods,
|
|
16
|
+
oneshot_line: :oneshot_lines
|
|
17
|
+
}.freeze
|
|
18
|
+
|
|
19
|
+
attr_accessor :pid
|
|
20
|
+
# When this process started tracking coverage. Captured by SimpleCov.start
|
|
21
|
+
# so JSONFormatter can detect when an existing coverage.json was written
|
|
22
|
+
# by a sibling process running concurrently.
|
|
23
|
+
attr_accessor :process_start_time
|
|
24
|
+
|
|
25
|
+
# A monotonically increasing serial the parent assigns to each forked
|
|
26
|
+
# subprocess (see SimpleCov::ProcessForkHook). The default `at_fork`
|
|
27
|
+
# builds the worker's command_name from this rather than the OS pid:
|
|
28
|
+
# the serial sequence is the same from one run to the next, so a re-run
|
|
29
|
+
# overwrites the previous run's resultset entries instead of writing
|
|
30
|
+
# uniquely-named ones that pile up until merge_timeout. See issue #1171.
|
|
31
|
+
def subprocess_serial
|
|
32
|
+
@subprocess_serial ||= 0
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# @api private — bump the serial in the parent before a fork so the
|
|
36
|
+
# child inherits its own ordinal via copy-on-write.
|
|
37
|
+
def next_subprocess_serial!
|
|
38
|
+
@subprocess_serial = subprocess_serial + 1
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# @api private — true in a process that was forked while coverage was
|
|
42
|
+
# running (set by SimpleCov::ProcessForkHook in the child). Such a child
|
|
43
|
+
# stores its own slice but must not act as the final-result process: the
|
|
44
|
+
# process that forked it merges every slice and produces the report. Only
|
|
45
|
+
# consulted when no parallel-test adapter is active, since adapters answer
|
|
46
|
+
# `first_worker?` themselves. See issue #1171.
|
|
47
|
+
def forked_subprocess?
|
|
48
|
+
!!(defined?(@forked_subprocess) && @forked_subprocess)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# @api private — marked in the child immediately after a fork.
|
|
52
|
+
def mark_forked_subprocess!
|
|
53
|
+
@forked_subprocess = true
|
|
54
|
+
end
|
|
55
|
+
# Should we take care of at_exit behavior or something else? Used by the
|
|
56
|
+
# minitest plugin. See lib/minitest/simplecov_plugin.rb.
|
|
57
|
+
attr_accessor :external_at_exit
|
|
58
|
+
|
|
59
|
+
# `:oneshot_line` data is folded into the `:line` bucket of
|
|
60
|
+
# `coverage_statistics` by `ResultAdapter`, so use `:line` to look
|
|
61
|
+
# up stats for either criterion.
|
|
62
|
+
def coverage_statistics_key(criterion)
|
|
63
|
+
criterion == :oneshot_line ? :line : criterion
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Coerce to a proper boolean so rspec-mocks 4's predicate matcher
|
|
67
|
+
# (`expect(...).not_to be_external_at_exit`) accepts the result.
|
|
68
|
+
def external_at_exit?
|
|
69
|
+
!!@external_at_exit
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
#
|
|
73
|
+
# Sets up SimpleCov to run against your project. See README for
|
|
74
|
+
# the full DSL, or:
|
|
75
|
+
#
|
|
76
|
+
# SimpleCov.start
|
|
77
|
+
# SimpleCov.start 'rails' # using a profile
|
|
78
|
+
# SimpleCov.start { add_filter 'test' } # with a config block
|
|
79
|
+
#
|
|
80
|
+
def start(profile = nil, &)
|
|
81
|
+
warn_about_start_in_dot_simplecov if @autoloading_dot_simplecov
|
|
82
|
+
|
|
83
|
+
initial_setup(profile, &)
|
|
84
|
+
start_tracking
|
|
85
|
+
install_at_exit_hook
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# @api private
|
|
89
|
+
#
|
|
90
|
+
# Mark the duration of a `.simplecov` auto-load so any `SimpleCov.start`
|
|
91
|
+
# call inside the file can warn about the impending migration to a
|
|
92
|
+
# config-only file. Tracking still begins for backward compatibility;
|
|
93
|
+
# the warning is the cue to move `SimpleCov.start` into a test helper.
|
|
94
|
+
# See #581.
|
|
95
|
+
def with_dot_simplecov_autoload
|
|
96
|
+
previous = @autoloading_dot_simplecov
|
|
97
|
+
@autoloading_dot_simplecov = true
|
|
98
|
+
yield
|
|
99
|
+
ensure
|
|
100
|
+
@autoloading_dot_simplecov = previous
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def warn_about_start_in_dot_simplecov
|
|
104
|
+
return if @dot_simplecov_start_warned
|
|
105
|
+
|
|
106
|
+
@dot_simplecov_start_warned = true
|
|
107
|
+
warn "[DEPRECATION] Calling `SimpleCov.start` from `.simplecov` is deprecated and will " \
|
|
108
|
+
"be removed in a future release. `.simplecov` should contain configuration only; " \
|
|
109
|
+
"move the `SimpleCov.start` call into your `spec_helper.rb` / `test_helper.rb`. " \
|
|
110
|
+
"Coverage tracking still begins for backward compatibility, but a future release " \
|
|
111
|
+
"will require the explicit `SimpleCov.start` from a test helper. " \
|
|
112
|
+
"See https://github.com/simplecov-ruby/simplecov/issues/581."
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
#
|
|
116
|
+
# Install the at_exit hook that formats results and runs exit-code
|
|
117
|
+
# checks. `SimpleCov.start` calls this automatically. Idempotent —
|
|
118
|
+
# safe to call multiple times. Callers that drive the formatting
|
|
119
|
+
# pipeline themselves (e.g., dogfood test setups) can skip it by
|
|
120
|
+
# using `start_tracking` directly instead of `start`.
|
|
121
|
+
#
|
|
122
|
+
def install_at_exit_hook
|
|
123
|
+
return if @at_exit_hook_installed
|
|
124
|
+
|
|
125
|
+
@at_exit_hook_installed = true
|
|
126
|
+
defer_to_minitest_after_run if minitest_autorun_pending?
|
|
127
|
+
Kernel.at_exit do
|
|
128
|
+
next if SimpleCov.external_at_exit?
|
|
129
|
+
|
|
130
|
+
SimpleCov.at_exit_behavior
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
#
|
|
135
|
+
# Begin coverage tracking without applying configuration. Pairs with
|
|
136
|
+
# `SimpleCov.configure { ... }` for callers that want to separate
|
|
137
|
+
# the two — for example a dogfood test that has already started
|
|
138
|
+
# `Coverage` itself before requiring simplecov, but still wants the
|
|
139
|
+
# process_start_time / pid / fork-hook bookkeeping.
|
|
140
|
+
#
|
|
141
|
+
def start_tracking
|
|
142
|
+
require "coverage"
|
|
143
|
+
warn_if_jruby_full_trace_disabled
|
|
144
|
+
validate_coverage_criteria!
|
|
145
|
+
# simplecov:disable — fork-hook is enabled via SimpleCov.enable_for_subprocesses, off by default
|
|
146
|
+
require_relative "simplecov/process" if SimpleCov.enabled_for_subprocesses? &&
|
|
147
|
+
::Process.respond_to?(:_fork)
|
|
148
|
+
# simplecov:enable
|
|
149
|
+
|
|
150
|
+
# Trigger adapter selection now so the (possibly lazy) parallel_tests
|
|
151
|
+
# gem load happens at start_tracking time rather than mid-suite.
|
|
152
|
+
# `current` is memoized; subsequent calls are cheap.
|
|
153
|
+
SimpleCov::ParallelAdapters.current
|
|
154
|
+
|
|
155
|
+
@result = nil
|
|
156
|
+
self.pid = Process.pid
|
|
157
|
+
self.process_start_time = Time.now
|
|
158
|
+
|
|
159
|
+
start_coverage_measurement
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
private
|
|
163
|
+
|
|
164
|
+
#
|
|
165
|
+
# Trigger Coverage.start with the configured criteria. Every supported
|
|
166
|
+
# runtime (CRuby >= 3.2, JRuby >= 10, TruffleRuby >= 22) accepts the
|
|
167
|
+
# criteria-hash form, so no compatibility fallback is needed.
|
|
168
|
+
#
|
|
169
|
+
def start_coverage_measurement
|
|
170
|
+
start_arguments = coverage_criteria.to_h do |criterion|
|
|
171
|
+
[CRITERION_TO_RUBY_COVERAGE.fetch(criterion), true]
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
start_arguments[:eval] = true if coverage_for_eval_enabled?
|
|
175
|
+
|
|
176
|
+
Coverage.start(start_arguments) unless Coverage.running?
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# `Rake::TestTask` runs `ruby -e 'require "minitest/autorun"; ...'`,
|
|
180
|
+
# which means Minitest's at_exit registers before SimpleCov's. Since
|
|
181
|
+
# at_exit fires LIFO, SimpleCov's hook would otherwise run *before*
|
|
182
|
+
# Minitest gets a chance to invoke the tests — and format an empty
|
|
183
|
+
# resultset. When we can see that Minitest is loaded and its autorun
|
|
184
|
+
# is armed, route the report through `Minitest.after_run` instead,
|
|
185
|
+
# which fires after the suite completes. See issues #1099 and #1112.
|
|
186
|
+
def minitest_autorun_pending?
|
|
187
|
+
return false unless defined?(Minitest) && Minitest.respond_to?(:after_run)
|
|
188
|
+
return false unless Minitest.class_variable_defined?(:@@installed_at_exit)
|
|
189
|
+
|
|
190
|
+
Minitest.class_variable_get(:@@installed_at_exit)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def defer_to_minitest_after_run
|
|
194
|
+
self.external_at_exit = true
|
|
195
|
+
Minitest.after_run { SimpleCov.at_exit_behavior }
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# JRuby coverage data is unreliable unless full-trace mode is enabled.
|
|
199
|
+
# @see https://github.com/jruby/jruby/issues/1196
|
|
200
|
+
# @see https://github.com/simplecov-ruby/simplecov/issues/420
|
|
201
|
+
# @see https://github.com/simplecov-ruby/simplecov/issues/86
|
|
202
|
+
def warn_if_jruby_full_trace_disabled
|
|
203
|
+
return unless defined?(JRUBY_VERSION) && defined?(JRuby) # simplecov:disable — JRuby-only branch
|
|
204
|
+
|
|
205
|
+
# simplecov:disable — JRuby-only branches; unreachable from CRuby
|
|
206
|
+
return if org.jruby.RubyInstanceConfig.FULL_TRACE_ENABLED
|
|
207
|
+
|
|
208
|
+
warn 'Coverage may be inaccurate; set the "--debug" command line option, ' \
|
|
209
|
+
'or do JRUBY_OPTS="--debug" ' \
|
|
210
|
+
'or set the "debug.fullTrace=true" option in your .jrubyrc'
|
|
211
|
+
# simplecov:enable
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# requires are down here for a load order reason I'm not sure what it is about
|
|
217
|
+
require "forwardable"
|
|
218
|
+
require_relative "simplecov/color"
|
|
219
|
+
require_relative "simplecov/deprecation"
|
|
220
|
+
require_relative "simplecov/configuration"
|
|
221
|
+
SimpleCov.extend SimpleCov::Configuration
|
|
222
|
+
require_relative "simplecov/coverage_statistics"
|
|
223
|
+
require_relative "simplecov/coverage_violations"
|
|
224
|
+
require_relative "simplecov/exit_codes"
|
|
225
|
+
require_relative "simplecov/profiles"
|
|
226
|
+
require_relative "simplecov/source_file/line"
|
|
227
|
+
require_relative "simplecov/source_file/branch"
|
|
228
|
+
require_relative "simplecov/source_file/method"
|
|
229
|
+
require_relative "simplecov/source_file"
|
|
230
|
+
require_relative "simplecov/file_list"
|
|
231
|
+
require_relative "simplecov/result"
|
|
232
|
+
require_relative "simplecov/filter"
|
|
233
|
+
require_relative "simplecov/formatter"
|
|
234
|
+
require_relative "simplecov/last_run"
|
|
235
|
+
require_relative "simplecov/lines_classifier"
|
|
236
|
+
require_relative "simplecov/result_merger"
|
|
237
|
+
require_relative "simplecov/parallel_adapters"
|
|
238
|
+
require_relative "simplecov/command_guesser"
|
|
239
|
+
require_relative "simplecov/version"
|
|
240
|
+
require_relative "simplecov/result_adapter"
|
|
241
|
+
require_relative "simplecov/combine"
|
|
242
|
+
require_relative "simplecov/combine/branches_combiner"
|
|
243
|
+
require_relative "simplecov/combine/methods_combiner"
|
|
244
|
+
require_relative "simplecov/combine/files_combiner"
|
|
245
|
+
require_relative "simplecov/combine/lines_combiner"
|
|
246
|
+
require_relative "simplecov/combine/results_combiner"
|
|
247
|
+
require_relative "simplecov/useless_results_remover"
|
|
248
|
+
require_relative "simplecov/simulate_coverage"
|
|
249
|
+
require_relative "simplecov/result_processing"
|
|
250
|
+
require_relative "simplecov/exit_handling"
|
|
251
|
+
require_relative "simplecov/parallel_coordination"
|
|
252
|
+
|
|
253
|
+
# Load default config
|
|
254
|
+
# simplecov:disable — env-var only set by aruba feature tests
|
|
255
|
+
require_relative "simplecov/defaults" unless ENV["SIMPLECOV_NO_DEFAULTS"]
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/simplecov-ruby/simplecov/main/schemas/coverage-v1.0.schema.json",
|
|
4
|
+
"title": "SimpleCov coverage.json",
|
|
5
|
+
"description": "Schema for the coverage.json file emitted by SimpleCov's JSONFormatter. Versioned independently of the gem. Non-breaking additions bump the minor segment of schema_version, breaking changes bump the major segment. The versioned file at schemas/coverage-vX.Y.schema.json is the canonical artifact for that version, schemas/coverage.schema.json is a convenience alias for the latest.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["$schema", "meta", "total", "coverage", "groups", "errors"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uri",
|
|
13
|
+
"description": "URL of the JSON Schema this document conforms to. Pinned to the versioned canonical URL so documents stay validatable against the exact contract they were emitted under, even after the schema evolves."
|
|
14
|
+
},
|
|
15
|
+
"meta": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"required": [
|
|
18
|
+
"schema_version",
|
|
19
|
+
"simplecov_version",
|
|
20
|
+
"command_name",
|
|
21
|
+
"project_name",
|
|
22
|
+
"timestamp",
|
|
23
|
+
"root",
|
|
24
|
+
"commit",
|
|
25
|
+
"primary_coverage",
|
|
26
|
+
"line_coverage",
|
|
27
|
+
"branch_coverage",
|
|
28
|
+
"method_coverage"
|
|
29
|
+
],
|
|
30
|
+
"additionalProperties": false,
|
|
31
|
+
"properties": {
|
|
32
|
+
"schema_version": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"const": "1.0",
|
|
35
|
+
"description": "Schema major.minor. Additive changes bump minor; breaking changes bump major. Update this `const` whenever the schema version is bumped so documents claiming a different version don't quietly validate against this contract."
|
|
36
|
+
},
|
|
37
|
+
"simplecov_version": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "The version of the SimpleCov gem that produced this file."
|
|
40
|
+
},
|
|
41
|
+
"command_name": {"type": "string"},
|
|
42
|
+
"project_name": {"type": "string"},
|
|
43
|
+
"timestamp": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"format": "date-time",
|
|
46
|
+
"description": "ISO 8601 timestamp with millisecond precision."
|
|
47
|
+
},
|
|
48
|
+
"root": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Absolute path to SimpleCov.root at the time of write."
|
|
51
|
+
},
|
|
52
|
+
"commit": {
|
|
53
|
+
"type": ["string", "null"],
|
|
54
|
+
"description": "Full git commit SHA of `root`'s HEAD when the report was generated, or null when the project isn't a git checkout (or git isn't available). Lets tools recover the exact source a report reflects, which matters most when `source_in_json` is false and the per-file `source` arrays are omitted."
|
|
55
|
+
},
|
|
56
|
+
"primary_coverage": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"enum": ["line", "branch", "method"],
|
|
59
|
+
"description": "The coverage criterion `SimpleCov.primary_coverage` names as primary. The HTML report sorts file lists by this criterion's coverage by default."
|
|
60
|
+
},
|
|
61
|
+
"line_coverage": {"type": "boolean"},
|
|
62
|
+
"branch_coverage": {"type": "boolean"},
|
|
63
|
+
"method_coverage": {"type": "boolean"}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"total": {"$ref": "#/definitions/totals"},
|
|
67
|
+
"coverage": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"description": "Map of project-relative file paths to per-file coverage data.",
|
|
70
|
+
"additionalProperties": {"$ref": "#/definitions/source_file"}
|
|
71
|
+
},
|
|
72
|
+
"groups": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"description": "Map of group names to per-group totals plus the list of files in the group.",
|
|
75
|
+
"additionalProperties": {"$ref": "#/definitions/group"}
|
|
76
|
+
},
|
|
77
|
+
"errors": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"description": "Threshold violations from minimum_coverage, minimum_coverage_by_file, minimum_coverage_by_group, maximum_coverage, and maximum_coverage_drop. Empty object when no thresholds were violated.",
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"properties": {
|
|
82
|
+
"minimum_coverage": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"description": "Keyed by criterion: lines, branches, methods.",
|
|
85
|
+
"additionalProperties": {"$ref": "#/definitions/expected_actual"}
|
|
86
|
+
},
|
|
87
|
+
"minimum_coverage_by_file": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"description": "Keyed by project-relative filename, then by criterion (lines, branches, methods).",
|
|
90
|
+
"additionalProperties": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"additionalProperties": {"$ref": "#/definitions/expected_actual"}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"minimum_coverage_by_group": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"description": "Keyed by group name, then by criterion (lines, branches, methods).",
|
|
98
|
+
"additionalProperties": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"additionalProperties": {"$ref": "#/definitions/expected_actual"}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"maximum_coverage": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"description": "Keyed by criterion: lines, branches, methods. `expected` is the configured maximum, `actual` is the measured value that exceeded it.",
|
|
106
|
+
"additionalProperties": {"$ref": "#/definitions/expected_actual"}
|
|
107
|
+
},
|
|
108
|
+
"maximum_coverage_drop": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"description": "Keyed by criterion: lines, branches, methods.",
|
|
111
|
+
"additionalProperties": {"$ref": "#/definitions/maximum_actual"}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"definitions": {
|
|
117
|
+
"totals": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"anyOf": [
|
|
121
|
+
{"required": ["lines"]},
|
|
122
|
+
{"required": ["branches"]},
|
|
123
|
+
{"required": ["methods"]}
|
|
124
|
+
],
|
|
125
|
+
"properties": {
|
|
126
|
+
"lines": {"$ref": "#/definitions/line_statistic"},
|
|
127
|
+
"branches": {"$ref": "#/definitions/coverage_statistic"},
|
|
128
|
+
"methods": {"$ref": "#/definitions/coverage_statistic"}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"source_file": {
|
|
132
|
+
"type": "object",
|
|
133
|
+
"additionalProperties": false,
|
|
134
|
+
"anyOf": [
|
|
135
|
+
{"required": ["lines"]},
|
|
136
|
+
{"required": ["branches"]},
|
|
137
|
+
{"required": ["methods"]}
|
|
138
|
+
],
|
|
139
|
+
"dependentRequired": {
|
|
140
|
+
"lines": ["lines_covered_percent", "covered_lines", "missed_lines", "omitted_lines", "total_lines"],
|
|
141
|
+
"lines_covered_percent": ["lines", "covered_lines", "missed_lines", "omitted_lines", "total_lines"],
|
|
142
|
+
"covered_lines": ["lines", "lines_covered_percent", "missed_lines", "omitted_lines", "total_lines"],
|
|
143
|
+
"missed_lines": ["lines", "lines_covered_percent", "covered_lines", "omitted_lines", "total_lines"],
|
|
144
|
+
"omitted_lines": ["lines", "lines_covered_percent", "covered_lines", "missed_lines", "total_lines"],
|
|
145
|
+
"total_lines": ["lines", "lines_covered_percent", "covered_lines", "missed_lines", "omitted_lines"],
|
|
146
|
+
"branches": ["branches_covered_percent", "covered_branches", "missed_branches", "total_branches"],
|
|
147
|
+
"branches_covered_percent": ["branches", "covered_branches", "missed_branches", "total_branches"],
|
|
148
|
+
"covered_branches": ["branches", "branches_covered_percent", "missed_branches", "total_branches"],
|
|
149
|
+
"missed_branches": ["branches", "branches_covered_percent", "covered_branches", "total_branches"],
|
|
150
|
+
"total_branches": ["branches", "branches_covered_percent", "covered_branches", "missed_branches"],
|
|
151
|
+
"methods": ["methods_covered_percent", "covered_methods", "missed_methods", "total_methods"],
|
|
152
|
+
"methods_covered_percent": ["methods", "covered_methods", "missed_methods", "total_methods"],
|
|
153
|
+
"covered_methods": ["methods", "methods_covered_percent", "missed_methods", "total_methods"],
|
|
154
|
+
"missed_methods": ["methods", "methods_covered_percent", "covered_methods", "total_methods"],
|
|
155
|
+
"total_methods": ["methods", "methods_covered_percent", "covered_methods", "missed_methods"]
|
|
156
|
+
},
|
|
157
|
+
"properties": {
|
|
158
|
+
"lines": {
|
|
159
|
+
"type": "array",
|
|
160
|
+
"description": "Per-source-line coverage. Element index N corresponds to source line N+1. Integer hit-count, null for non-relevant (blank/comment) lines, or the string \"ignored\" for lines inside a simplecov:disable / :nocov: region. Present if and only if `meta.line_coverage` is true. When present, the five line stat fields (`lines_covered_percent`, `covered_lines`, `missed_lines`, `omitted_lines`, `total_lines`) are guaranteed to be present too.",
|
|
161
|
+
"items": {"$ref": "#/definitions/line_coverage"}
|
|
162
|
+
},
|
|
163
|
+
"source": {
|
|
164
|
+
"type": "array",
|
|
165
|
+
"description": "Source lines of the file, in order (one entry per physical line). When the per-file `lines` array is present it has the same length, but `source` is emitted independently of line coverage. Present only when SimpleCov.source_in_json is true (the default); omitted when downstream tools opt out via `source_in_json false` to keep coverage.json smaller.",
|
|
166
|
+
"items": {"type": "string"}
|
|
167
|
+
},
|
|
168
|
+
"lines_covered_percent": {"type": "number"},
|
|
169
|
+
"covered_lines": {"type": "integer", "minimum": 0, "description": "Count of executable lines that were hit at least once."},
|
|
170
|
+
"missed_lines": {"type": "integer", "minimum": 0, "description": "Count of executable lines that were never hit."},
|
|
171
|
+
"omitted_lines": {"type": "integer", "minimum": 0, "description": "Count of non-executable lines (blank lines, comments). Mirrors `total.lines.omitted` at the per-file level. Excludes lines inside simplecov:disable / :nocov: regions, which surface as `\"ignored\"` in the `lines` array."},
|
|
172
|
+
"total_lines": {"type": "integer", "minimum": 0, "description": "Count of executable lines: `covered_lines + missed_lines`. Does not include non-executable (omitted) lines or lines inside simplecov:disable / :nocov: regions, so this can be smaller than `lines.length`."},
|
|
173
|
+
"branches": {
|
|
174
|
+
"type": "array",
|
|
175
|
+
"description": "Per-branch coverage. Present if and only if `meta.branch_coverage` is true. When present, the four branch stat fields (`branches_covered_percent`, `covered_branches`, `missed_branches`, `total_branches`) are guaranteed to be present too.",
|
|
176
|
+
"items": {"$ref": "#/definitions/branch"}
|
|
177
|
+
},
|
|
178
|
+
"branches_covered_percent": {"type": "number"},
|
|
179
|
+
"covered_branches": {"type": "integer", "minimum": 0},
|
|
180
|
+
"missed_branches": {"type": "integer", "minimum": 0},
|
|
181
|
+
"total_branches": {"type": "integer", "minimum": 0, "description": "Count of branches: `covered_branches + missed_branches`."},
|
|
182
|
+
"methods": {
|
|
183
|
+
"type": "array",
|
|
184
|
+
"description": "Per-method coverage. Present if and only if `meta.method_coverage` is true. When present, the four method stat fields (`methods_covered_percent`, `covered_methods`, `missed_methods`, `total_methods`) are guaranteed to be present too.",
|
|
185
|
+
"items": {"$ref": "#/definitions/method"}
|
|
186
|
+
},
|
|
187
|
+
"methods_covered_percent": {"type": "number"},
|
|
188
|
+
"covered_methods": {"type": "integer", "minimum": 0},
|
|
189
|
+
"missed_methods": {"type": "integer", "minimum": 0},
|
|
190
|
+
"total_methods": {"type": "integer", "minimum": 0, "description": "Count of methods: `covered_methods + missed_methods`."}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"branch": {
|
|
194
|
+
"type": "object",
|
|
195
|
+
"required": ["type", "start_line", "end_line", "coverage", "inline", "report_line"],
|
|
196
|
+
"additionalProperties": false,
|
|
197
|
+
"properties": {
|
|
198
|
+
"type": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"description": "Branch kind from Ruby's Coverage library (e.g. \"then\", \"else\", \"when\")."
|
|
201
|
+
},
|
|
202
|
+
"start_line": {"type": "integer", "minimum": 1},
|
|
203
|
+
"end_line": {"type": "integer", "minimum": 1},
|
|
204
|
+
"coverage": {"$ref": "#/definitions/branch_method_coverage"},
|
|
205
|
+
"inline": {"type": "boolean"},
|
|
206
|
+
"report_line": {"type": "integer", "minimum": 1, "description": "Line of the conditional that owns this branch (the `if`, `case`, or `&&` line), not the start of the branch body. Useful for rendering annotations at the decision point."}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"method": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"required": ["name", "start_line", "end_line", "coverage"],
|
|
212
|
+
"additionalProperties": false,
|
|
213
|
+
"properties": {
|
|
214
|
+
"name": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"description": "Qualified method name, e.g. \"Foo#bar\", \"Foo.bar\", or \"Foo::Bar#baz\"."
|
|
217
|
+
},
|
|
218
|
+
"start_line": {"type": "integer", "minimum": 1},
|
|
219
|
+
"end_line": {"type": "integer", "minimum": 1},
|
|
220
|
+
"coverage": {"$ref": "#/definitions/branch_method_coverage"}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"group": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"required": ["files"],
|
|
226
|
+
"additionalProperties": false,
|
|
227
|
+
"anyOf": [
|
|
228
|
+
{"required": ["lines"]},
|
|
229
|
+
{"required": ["branches"]},
|
|
230
|
+
{"required": ["methods"]}
|
|
231
|
+
],
|
|
232
|
+
"properties": {
|
|
233
|
+
"lines": {"$ref": "#/definitions/line_statistic"},
|
|
234
|
+
"branches": {"$ref": "#/definitions/coverage_statistic"},
|
|
235
|
+
"methods": {"$ref": "#/definitions/coverage_statistic"},
|
|
236
|
+
"files": {
|
|
237
|
+
"type": "array",
|
|
238
|
+
"description": "Project-relative paths of the files that fell into this group.",
|
|
239
|
+
"items": {"type": "string"}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"line_statistic": {
|
|
244
|
+
"type": "object",
|
|
245
|
+
"required": ["covered", "missed", "omitted", "total", "percent", "strength"],
|
|
246
|
+
"additionalProperties": false,
|
|
247
|
+
"properties": {
|
|
248
|
+
"covered": {"type": "integer", "minimum": 0},
|
|
249
|
+
"missed": {"type": "integer", "minimum": 0},
|
|
250
|
+
"omitted": {
|
|
251
|
+
"type": "integer",
|
|
252
|
+
"minimum": 0,
|
|
253
|
+
"description": "Lines that cannot be covered (blank, comment, etc.). Only present on line stats."
|
|
254
|
+
},
|
|
255
|
+
"total": {"type": "integer", "minimum": 0, "description": "Executable lines: `covered + missed`. Does not include `omitted`."},
|
|
256
|
+
"percent": {"type": "number"},
|
|
257
|
+
"strength": {"type": "number", "description": "Average number of executions across covered lines (hits per covered line)."}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"coverage_statistic": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"required": ["covered", "missed", "total", "percent", "strength"],
|
|
263
|
+
"additionalProperties": false,
|
|
264
|
+
"properties": {
|
|
265
|
+
"covered": {"type": "integer", "minimum": 0},
|
|
266
|
+
"missed": {"type": "integer", "minimum": 0},
|
|
267
|
+
"total": {"type": "integer", "minimum": 0, "description": "Total branches or methods: `covered + missed`."},
|
|
268
|
+
"percent": {"type": "number"},
|
|
269
|
+
"strength": {"type": "number", "description": "Average number of executions across covered branches or methods (hits per covered item)."}
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"line_coverage": {
|
|
273
|
+
"description": "Coverage value for a source line in the per-file `lines` array. Integer hit count, `null` for a non-executable line (blank or comment), or the literal string `\"ignored\"` for a line inside a simplecov:disable / :nocov: region.",
|
|
274
|
+
"oneOf": [
|
|
275
|
+
{"type": "integer", "minimum": 0},
|
|
276
|
+
{"type": "null"},
|
|
277
|
+
{"type": "string", "const": "ignored"}
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
"branch_method_coverage": {
|
|
281
|
+
"description": "Coverage value for a branch or method `coverage` field. Integer hit count, or the literal string `\"ignored\"` for code inside a simplecov:disable / :nocov: region. Unlike line coverage, `null` never occurs: every branch and method maps to an executable construct.",
|
|
282
|
+
"oneOf": [
|
|
283
|
+
{"type": "integer", "minimum": 0},
|
|
284
|
+
{"type": "string", "const": "ignored"}
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
"expected_actual": {
|
|
288
|
+
"type": "object",
|
|
289
|
+
"required": ["expected", "actual"],
|
|
290
|
+
"additionalProperties": false,
|
|
291
|
+
"properties": {
|
|
292
|
+
"expected": {"type": "number"},
|
|
293
|
+
"actual": {"type": "number"}
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"maximum_actual": {
|
|
297
|
+
"type": "object",
|
|
298
|
+
"required": ["maximum", "actual"],
|
|
299
|
+
"additionalProperties": false,
|
|
300
|
+
"properties": {
|
|
301
|
+
"maximum": {"type": "number"},
|
|
302
|
+
"actual": {"type": "number"}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|