Skip to content

Commit 895c23d

Browse files
authored
Convert from lcov to undercover format (#8579)
1 parent e1d5908 commit 895c23d

File tree

5 files changed

+12
-22
lines changed

5 files changed

+12
-22
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.4.8
1+
3.4.8

.simplecov

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,19 @@
77
# for this to be valuable so that only changed files have tests run
88
if ENV.fetch("COVERAGE", 0).to_i.positive?
99
require "simplecov"
10-
require "simplecov-lcov"
10+
require "undercover/simplecov_formatter"
1111

1212
# This allows both LCOV and HTML formatting -
1313
# lcov for undercover gem, HTML for humans
14-
class SimpleCov::Formatter::MergedFormatter
15-
def format(result)
16-
SimpleCov::Formatter::HTMLFormatter.new.format(result)
17-
SimpleCov::Formatter::LcovFormatter.new.format(result)
18-
end
19-
end
20-
21-
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
22-
SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
14+
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
15+
[
16+
SimpleCov::Formatter::Undercover,
17+
SimpleCov::Formatter::HTMLFormatter,
18+
],
19+
)
2320

2421
SimpleCov.start :rails do
2522
enable_coverage :branch
26-
primary_coverage :branch
2723

2824
# This line would enable coverage for view templates, but the slim compiler
2925
# appears to have a bug which puts the whole coverage data out by one line.
@@ -67,9 +63,9 @@ if ENV.fetch("COVERAGE", 0).to_i.positive?
6763
# However (possibly due to some residual random behaviour in test factories)
6864
# the line coverage needs to be set 0.02 below the reported value.
6965
# Nornmally this value needs to be 0.01 below the reported value due to rounding issues.
70-
minimum_coverage line: 97.40, branch: 87.23
71-
# Values from test run Fri 13th February 2026
72-
# 97.46% (12553 / 12880) -> 327 lines uncovered
73-
# 87.18% (2808 / 3221) -> 192 + 221 = 411 branches uncovered
66+
minimum_coverage line: 97.22, branch: 87.23
67+
# Values from test run Wed 4th March 2026
68+
# 97.43% (12677 / 13011) -> 334 lines uncovered
69+
# 87.19% (2812 / 3225) -> 188 + 225 = 413 branches uncovered
7470
end
7571
end

Gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ group :test do
154154
gem "selenium-webdriver"
155155
gem "shoulda-matchers"
156156
gem "simplecov", require: false
157-
# Lcov 0.9 breaks undercover's LCov parser
158-
gem "simplecov-lcov", "< 0.10", require: false
159157
gem "site_prism"
160158
gem "uri-query_params"
161159
gem "vcr"

Gemfile.lock

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,6 @@ GEM
831831
simplecov-html (~> 0.11)
832832
simplecov_json_formatter (~> 0.1)
833833
simplecov-html (0.13.2)
834-
simplecov-lcov (0.9.0)
835834
simplecov_json_formatter (0.1.4)
836835
site_prism (5.1.1)
837836
addressable (~> 2.8, >= 2.8.4)
@@ -1100,7 +1099,6 @@ DEPENDENCIES
11001099
sidekiq-cron
11011100
sidekiq-limit_fetch
11021101
simplecov
1103-
simplecov-lcov (< 0.10)
11041102
site_prism
11051103
skylight
11061104
slim-rails
@@ -1426,7 +1424,6 @@ CHECKSUMS
14261424
signet (0.21.0) sha256=d617e9fbf24928280d39dcfefba9a0372d1c38187ffffd0a9283957a10a8cd5b
14271425
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
14281426
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
1429-
simplecov-lcov (0.9.0) sha256=7a77a31e200a595ed4b0249493056efd0c920601f53d2ef135ca34ee796346cd
14301427
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
14311428
site_prism (5.1.1) sha256=9f89c8911dbc1c94e6eaf0b850eca034c71cfce0bc6f2304d982b15a64af5891
14321429
site_prism-all_there (3.0.7) sha256=87b344fba06ddd8a21569b66558ab549226991b3c5a5076bfd2561950c5e6473

spec/factories/vacancies.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
is_job_share { [true, false].sample }
108108
working_patterns { factory_rand_sample(%w[full_time part_time], 1..2) }
109109
working_patterns_details { Faker::Lorem.sentence(word_count: factory_rand(1..50)) }
110-
# rand_phases = factory_rand_sample(Vacancy.phases.keys, 1..3)
111110
phases { factory_rand_sample(Vacancy.phases.keys, 1..3) }
112111

113112
# Subjects are ignored when phases don't include secondary

0 commit comments

Comments
 (0)