Shopify / Shopify/roast

Noisy output when running tests :(

Open
#297 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

contributor-dx
Dominant language
Ruby
Stars
1.2k
Forks
76
PR merge metrics
No merged PRs in 30d

Description

When running tests, there's a lot of noisy output. This is caused by the usage of $stderr.puts inside classes.

There are plenty of ways to fix that:

  • Surround function calls that uses $stderr.puts with a capture_io. The last comes with minitest
  • Create a dependency injections that we could manage $stderr.puts
  • Stubbing $stderr for tests
  • ...

I like the dependency injection. Any other suggestions ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the classes that call $stderr.puts and review the existing Minitest setup, especially capture_io. Compare the proposed capture_io, dependency-injection, and $stderr-stubbing approaches before choosing one. Done means the tests no longer produce the reported noisy output and the relevant test coverage still passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.