Skip to content

Silence coverage report output from coverage:report task#9577

Merged
hsbt merged 1 commit into
masterfrom
silence-coverage-report-output
Jun 1, 2026
Merged

Silence coverage report output from coverage:report task#9577
hsbt merged 1 commit into
masterfrom
silence-coverage-report-output

Conversation

@hsbt

@hsbt hsbt commented Jun 1, 2026

Copy link
Copy Markdown
Member

What is your fix for the problem, implemented in this PR?

Surpressed the following output:

Coverage report generated for bundler:11374, bundler:11374, bundler:12417, bundler:12600, bundler:14613, bundler:15090, bundler:15831, bundler:15831, bundler:15831, bundler:15831, bundler:15831, bundler:15831, bundler:15832, bundler:15833, bundler:15834, bundler:15835, bundler:15836, bundler:15837, bundler:15838, bundler:15839, bundler:15840, bundler:44939, bundler:44939, bundler:44939, bundler:44939, bundler:44939, bundler:50991, bundler:51182, bundler:51329, bundler:52462, bundler:53319, bundler:78081, bundler:80866, bundler:82379, bundler:83500, rubygems, bundler:50991, bundler:51182, bundler:51329, bundler:52462, bundler:53319, ...

Make sure the following tasks are checked

The collate run printed a "Coverage report generated for ..." line
listing every per-process command name after each test/spec run. Mirror
the stdout redirection already used in spec_helper's SimpleCov at_exit
hook so the HTML report is still written without the noisy summary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 1, 2026 02:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to silence noisy console output produced by the coverage:report Rake task when generating a SimpleCov report from a collected resultset.

Changes:

  • Redirects $stdout to File::NULL during SimpleCov.collate execution.
  • Restores $stdout after report generation using an ensure clause.
Comments suppressed due to low confidence (1)

Rakefile:143

  • Redirecting $stdout via File.open leaks the opened file handle (it’s never closed) and the ensure currently resets $stdout to STDOUT even when this task exits early (next on missing resultset / missing simplecov). That can clobber an already-redirected $stdout (e.g., when rake output is being captured). Prefer saving the previous $stdout, wrapping only the collate in a begin/ensure, and closing the null IO.
  $stdout = File.open(File::NULL, "w")
  SimpleCov.collate Dir[resultset] do
    coverage_dir "coverage"
    add_filter "/test/"
    add_filter "/spec/"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hsbt hsbt enabled auto-merge June 1, 2026 02:57
@hsbt hsbt merged commit 7f34205 into master Jun 1, 2026
134 of 136 checks passed
@hsbt hsbt deleted the silence-coverage-report-output branch June 1, 2026 05:43
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.

2 participants