{"id":13878081,"url":"https://github.com/garrettdimon/minitest-heat","last_synced_at":"2026-01-29T20:00:50.054Z","repository":{"id":45534536,"uuid":"398829609","full_name":"garrettdimon/minitest-heat","owner":"garrettdimon","description":"A custom reporter for Minitest to help you more effectively fix code when tests fail.","archived":false,"fork":false,"pushed_at":"2022-10-31T23:31:34.000Z","size":1533,"stargazers_count":52,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-31T13:39:32.943Z","etag":null,"topics":["minitest","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garrettdimon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"garrettdimon"}},"created_at":"2021-08-22T15:10:55.000Z","updated_at":"2024-02-21T17:49:01.000Z","dependencies_parsed_at":"2023-01-20T16:31:17.909Z","dependency_job_id":null,"html_url":"https://github.com/garrettdimon/minitest-heat","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garrettdimon%2Fminitest-heat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garrettdimon%2Fminitest-heat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garrettdimon%2Fminitest-heat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garrettdimon%2Fminitest-heat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garrettdimon","download_url":"https://codeload.github.com/garrettdimon/minitest-heat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226138849,"owners_count":17579496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["minitest","ruby"],"created_at":"2024-08-06T08:01:39.345Z","updated_at":"2026-01-29T20:00:50.048Z","avatar_url":"https://github.com/garrettdimon.png","language":"Ruby","funding_links":["https://github.com/sponsors/garrettdimon"],"categories":["Ruby"],"sub_categories":[],"readme":"# 🔥 Minitest Heat 🔥\nMinitest Heat helps you identify problems faster so you can more efficiently resolve test failures by generating a heat map that shows where failures are concentrated.\n\nFor a more detailed explanation of Minitest Heat with screenshots, [head over to the wiki for the full story](https://github.com/garrettdimon/minitest-heat/wiki).\n\nOr for some additional insight about priorities and how it works, this [Twitter thread](https://twitter.com/garrettdimon/status/1432703746526560266) is a good read.\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'minitest-heat'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install minitest-heat\n\nAnd depending on your usage, you may need to require Minitest Heat in your test suite:\n\n```ruby\nrequire 'minitest/heat'\n```\n\n## Prioritizing Your Work\n\nMinitest Heat surfaces the most impactful problems first so you can fix what matters without scrolling through noise.\n\n### Issue Priority\n\nIssues are displayed in priority order—you'll always see the most critical problems first:\n\n| Priority | Type | Why First |\n|----------|------|-----------|\n| 1 | **Errors** | Exceptions in source code—your app is broken |\n| 2 | **Broken** | Exceptions in test files—fix your tests before trusting them |\n| 3 | **Failures** | Assertion failures—the core of what tests catch |\n| 4 | **Skipped** | Only shown when no errors/failures—a reminder, not urgent |\n| 5 | **Slow/Painful** | Only shown when everything passes—performance cleanup |\n\nYou never see skips or slow tests when there are real problems. This keeps you focused on what actually needs fixing.\n\n### The Heat Map\n\nAfter listing individual issues, the heat map shows where problems are concentrated across your codebase:\n\n- **Files sorted by severity**—most problematic files appear first\n- **Line numbers with issue counts**—`42×3` means 3 issues at line 42\n- **Quick hot spot identification**—if one file keeps appearing, that's where to focus\n\nThe heat map helps you spot patterns. A single file with many issues often points to a deeper problem worth investigating rather than fixing issues one by one.\n\n## Configuration\n\nMinitest Heat provides configurable thresholds for identifying slow tests. By default, tests over 1.0s are considered \"slow\" and tests over 3.0s are \"painfully slow.\"\n\nAdd a configuration block to your `test_helper.rb` after `require 'minitest/heat'`:\n\n```ruby\nMinitest::Heat.configure do |config|\n  config.slow_threshold = 1.0        # seconds\n  config.painfully_slow_threshold = 3.0\nend\n```\n\n### Example: Rails Application\n\nSystem tests and integration tests naturally run slower. You might use higher thresholds:\n\n```ruby\nMinitest::Heat.configure do |config|\n  config.slow_threshold = 3.0\n  config.painfully_slow_threshold = 10.0\nend\n```\n\n### Example: Gem Development\n\nFor a gem with fast unit tests, stricter thresholds catch performance regressions early:\n\n```ruby\nMinitest::Heat.configure do |config|\n  config.slow_threshold = 0.1\n  config.painfully_slow_threshold = 0.5\nend\n```\n\n## JSON Output\n\nFor CI integration, tooling, or programmatic consumption, Minitest Heat can output results as JSON:\n\n```bash\nbundle exec rake test TESTOPTS=\"--heat-json\"\n```\n\nThe JSON output includes:\n- **statistics** - counts by issue type (errors, failures, skipped, slow, etc.)\n- **timing** - total time, tests/second, assertions/second\n- **heat_map** - files with issues, sorted by severity weight\n- **issues** - detailed issue data with locations and messages\n\nExample usage:\n```bash\n# Capture JSON output (stderr has progress, stdout has JSON)\nbundle exec rake test TESTOPTS=\"--heat-json\" 2\u003e/dev/null \u003e results.json\n```\n\n## Development\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. For release instructions, see [RELEASING.md](RELEASING.md).\n\n### Running Tests\n\n```bash\n# Run full test suite\nbundle exec rake test\n\n# Run a single test file\nbundle exec rake test TEST=test/minitest/heat/issue_test.rb\n\n# Run a single test method\nbundle exec rake test TEST=test/minitest/heat/issue_test.rb TESTOPTS=\"-n /test_error_issue/\"\n```\n\n### Forcing Test Failures\nIn order to easily see how Minitest Heat handles different combinations of different types of failures, the following environment variables can be used to force failures.\n\n```bash\nIMPLODE=true           # Every possible type of failure, skip, and slow is generated\nFORCE_EXCEPTIONS=true  # Only exception-triggered failures\nFORCE_FAILURES=true    # Only standard assertion failures\nFORCE_SKIPS=true       # No errors, just the skipped tests\nFORCE_SLOWS=true       # No errors or skipped tests, just slow tests\n```\n\nSo to see the full context of a test suite, `IMPLODE=true bundle exec rake` will work its magic.\n\n## Contributing\nBug reports and pull requests are welcome on GitHub at https://github.com/garrettdimon/minitest-heat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/minitest-heat/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\nEveryone interacting in the Minitest::Heat project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/minitest-heat/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarrettdimon%2Fminitest-heat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarrettdimon%2Fminitest-heat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarrettdimon%2Fminitest-heat/lists"}