Skip to content

chore: drop the SimpleCov code coverage setup - #94

Merged
tas50 merged 1 commit into
mainfrom
chore/remove-simplecov
Aug 30, 2026
Merged

tas50 merged 1 commit into
mainfrom
chore/remove-simplecov

Conversation

@tas50

@tas50 tas50 commented Aug 30, 2026

Copy link
Copy Markdown
Member

What

Removes the SimpleCov code-coverage machinery from the spec suite.

  • spec/spec_helper.rb: drops the if ENV["COVERAGE"] block that required simplecov, defined a "gem" profile, and called SimpleCov.start.
  • .gitignore: drops the now-unused /coverage/ artifact path.

Why

The coverage switch was dead code that could not run. simplecov was not declared anywhere — not in the Gemfile, not in kitchen-vra.gemspec — so the guarded branch only ever produced a LoadError against a clean bundle:

$ COVERAGE=1 bundle exec rspec
An error occurred while loading spec_helper.

Failure/Error: require "simplecov"

LoadError:
  cannot load such file -- simplecov
# ./spec/spec_helper.rb:24:in '<top (required)>'
No examples found.

That is worth calling out on its own: the suite carried a code path depending on a gem nothing declared. Nothing set COVERAGE in CI, no minimum_coverage threshold was enforced, and no job collected or uploaded a report — so the only two outcomes were "unset, does nothing" and "set, blows up". Rather than add a development dependency to keep an unused switch alive, this removes the switch.

Documentation coverage is untouched: the YARD doc and doc_coverage Rake tasks are about undocumented methods in lib/, not code coverage, and they still run.

Verification

No references remain (grep -rin 'simplecov' . and grep -rn 'COVERAGE' ., both excluding .git, return nothing).

The YARD tasks are still listed and still run:

$ bundle exec rake -T
...
rake doc                    # Generate YARD Documentation
rake doc_coverage           # List anything in lib/ that is still undocumented
...

$ bundle exec rake doc_coverage
yard stats --list-undoc
Files:           2
Modules:         2 (    0 undocumented)
Classes:         1 (    0 undocumented)
Constants:       5 (    0 undocumented)
Attributes:      0 (    0 undocumented)
Methods:        17 (    0 undocumented)
 100.00% documented

Example count is unchanged at 85 before and after:

$ bundle exec rake test
85 examples, 0 failures

Lint is clean under Cookstyle 9.0.0 / RuboCop 1.90.0:

$ bundle exec cookstyle --chefstyle
8 files inspected, no offenses detected

Merge order

Branched from main at 05048a6 (after #92 merged), and this conflicts with neither open PR:

spec/spec_helper.rb wrapped a SimpleCov.start in an `if ENV["COVERAGE"]`
guard, but simplecov was never declared in the Gemfile or the gemspec, so
the branch could only ever fail. Running `COVERAGE=1 bundle exec rspec`
against a clean bundle aborts before a single example:

    Failure/Error: require "simplecov"
    LoadError: cannot load such file -- simplecov

Nothing measured the coverage it configured, no CI job set the variable,
and no threshold was enforced, so rather than add a dependency to keep an
unused switch alive this removes the block along with the /coverage/
artifact path in .gitignore.

The YARD `doc` and `doc_coverage` tasks are documentation coverage, not
code coverage, and are left alone.

Signed-off-by: Tim Smith <tim@mondoo.com>
@tas50
tas50 merged commit 10741e8 into main Aug 30, 2026
8 checks passed
@tas50
tas50 deleted the chore/remove-simplecov branch August 30, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant