Class: Homebrew::TestBot::Formulae Private
- Inherits:
-
TestFormulae
- Object
- Test
- TestFormulae
- Homebrew::TestBot::Formulae
- Defined in:
- test_bot/formulae.rb
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Constant Summary
Constants included from Kernel
Kernel::IGNORE_INTERRUPTS_MUTEX
Instance Attribute Summary collapse
- #added_formulae ⇒ Object writeonly private
- #deleted_formulae ⇒ Object writeonly private
- #testing_formulae ⇒ Object writeonly private
Attributes inherited from TestFormulae
#artifact_cache, #skipped_or_failed_formulae
Attributes inherited from Test
Instance Method Summary collapse
-
#initialize(tap:, git:, dry_run:, fail_fast:, verbose:, output_paths:) ⇒ Formulae
constructor
private
A new instance of Formulae.
- #run!(args:) ⇒ Object private
Methods included from Kernel
#disk_usage_readable, #ensure_executable!, #exec_browser, #exec_editor, #ignore_interrupts, #interactive_shell, #number_readable, #quiet_system, #redact_secrets, #redirect_stdout, #safe_system, #tap_and_name_comparison, #truncate_text_to_approximate_size, #which, #which_editor, #with_custom_locale, #with_env, #with_homebrew_path
Methods inherited from Test
Methods included from Utils::Output::Mixin
#odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled
Constructor Details
#initialize(tap:, git:, dry_run:, fail_fast:, verbose:, output_paths:) ⇒ Formulae
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Returns a new instance of Formulae.
9 10 11 12 13 14 15 16 17 |
# File 'test_bot/formulae.rb', line 9 def initialize(tap:, git:, dry_run:, fail_fast:, verbose:, output_paths:) super(tap:, git:, dry_run:, fail_fast:, verbose:) @built_formulae = [] @bottle_checksums = {} @bottle_output_path = output_paths[:bottle] @linkage_output_path = output_paths[:linkage] @skipped_or_failed_formulae_output_path = output_paths[:skipped_or_failed_formulae] end |
Instance Attribute Details
#added_formulae=(value) ⇒ Object (writeonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
7 8 9 |
# File 'test_bot/formulae.rb', line 7 def added_formulae=(value) @added_formulae = value end |
#deleted_formulae=(value) ⇒ Object (writeonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
7 8 9 |
# File 'test_bot/formulae.rb', line 7 def deleted_formulae=(value) @deleted_formulae = value end |
#testing_formulae=(value) ⇒ Object (writeonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
7 8 9 |
# File 'test_bot/formulae.rb', line 7 def testing_formulae=(value) @testing_formulae = value end |
Instance Method Details
#run!(args:) ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'test_bot/formulae.rb', line 19 def run!(args:) test_header(:Formulae) verify_local_bottles with_env(HOMEBREW_DISABLE_LOAD_FORMULA: "1") do # TODO: move to extend/os # rubocop:todo Homebrew/MoveToExtendOS bottle_specifier = if OS.linux? "{linux,ubuntu}" else "{macos-#{MacOS.version},#{MacOS.version}-#{Hardware::CPU.arch}}" end # rubocop:enable Homebrew/MoveToExtendOS download_artifacts_from_previous_run!("bottles{,_#{bottle_specifier}*}", dry_run: args.dry_run?) end @bottle_checksums.merge!( bottle_glob("*", artifact_cache, ".{json,tar.gz}", bottle_tag: "*").to_h do |bottle_file| [bottle_file.realpath, bottle_file.sha256] end, ) # #run! modifies `@testing_formulae`, so we need to track this separately. @testing_formulae_count = @testing_formulae.count perform_bash_cleanup = @testing_formulae.include?("bash") @tested_formulae_count = 0 sorted_formulae.each do |f| formula!(f, args:) verify_local_bottles puts next if @testing_formulae_count < 3 progress_text = +"Test progress: " progress_text += "#{@tested_formulae_count} formula(e) tested, " progress_text += "#{@testing_formulae_count - @tested_formulae_count} remaining" info_header progress_text end @deleted_formulae.each do |f| deleted_formula!(f) verify_local_bottles puts end return unless ENV["GITHUB_ACTIONS"] # Remove `bash` after it is tested, since leaving a broken `bash` # installation in the environment can cause issues with subsequent # GitHub Actions steps. test "brew", "uninstall", "--formula", "--force", "bash" if perform_bash_cleanup File.open(ENV.fetch("GITHUB_OUTPUT"), "a") do |f| f.puts "skipped_or_failed_formulae=#{@skipped_or_failed_formulae.join(",")}" end @skipped_or_failed_formulae_output_path.write(@skipped_or_failed_formulae.join(",")) ensure verify_local_bottles FileUtils.rm_rf artifact_cache end |