Skip to content

Commit

Permalink
Set HOMEBREW_DEBUG when running brew tests --debug
Browse files Browse the repository at this point in the history
- This will cause the "debug" gem to be required in `spec_helper.rb`, so we can do interactive debugging.
  • Loading branch information
issyl0 committed Apr 17, 2024
1 parent 9cf5334 commit 4c64193
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Library/Homebrew/dev-cmd/tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ def run
# Given we might be testing various commands, we probably want everything (except sorbet-static)
Homebrew.install_bundler_gems!(groups: Homebrew.valid_gem_groups - ["sorbet"])

require "debug" if args.debug?

HOMEBREW_LIBRARY_PATH.cd do
setup_environment!

Expand Down Expand Up @@ -137,6 +135,8 @@ def run

puts "Randomized with seed #{seed}"

ENV["HOMEBREW_DEBUG"] = "1" if args.debug? # Used in spec_helper.rb to require the "debug" gem.

# Submit test flakiness information using BuildPulse
# BUILDPULSE used in spec_helper.rb
if use_buildpulse?
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/test/migrator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
tab.source["tap"] = "homebrew/core"
tab.write

binding.b

expect do
described_class.new(new_formula, "oldname")
end.to raise_error(Migrator::MigratorDifferentTapsError)
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

require_relative "../global"

require "debug" if ENV["HOMEBREW_DEBUG"]

require "test/support/quiet_progress_formatter"
require "test/support/helper/cask"
require "test/support/helper/files"
Expand Down

0 comments on commit 4c64193

Please sign in to comment.