Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing SystemCommand::Mixin to fix CI #16562

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions Library/Homebrew/dev-cmd/tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

require "cli/parser"
require "fileutils"
require "system_command"

module Homebrew
module_function
extend SystemCommand::Mixin

sig { returns(CLI::Parser) }
def tests_args
def self.tests_args
Homebrew::CLI::Parser.new do
description <<~EOS
Run Homebrew's unit and integration tests.
Expand Down Expand Up @@ -40,7 +41,7 @@ def tests_args
end
end

def use_buildpulse?
def self.use_buildpulse?
return @use_buildpulse if defined?(@use_buildpulse)

@use_buildpulse = ENV["HOMEBREW_BUILDPULSE_ACCESS_KEY_ID"].present? &&
Expand All @@ -49,7 +50,7 @@ def use_buildpulse?
ENV["HOMEBREW_BUILDPULSE_REPOSITORY_ID"].present?
end

def run_buildpulse
def self.run_buildpulse
require "formula"

with_env(HOMEBREW_NO_AUTO_UPDATE: "1", HOMEBREW_NO_BOOTSNAP: "1") do
Expand All @@ -70,7 +71,7 @@ def run_buildpulse
]
end

def changed_test_files
def self.changed_test_files
changed_files = Utils.popen_read("git", "diff", "--name-only", "master")

raise UsageError, "No files have been changed from the master branch!" if changed_files.blank?
Expand All @@ -87,7 +88,7 @@ def changed_test_files
end.compact.select(&:exist?)
end

def tests
def self.tests
args = tests_args.parse

# Given we might be testing various commands, we probably want everything (except sorbet-static)
Expand Down Expand Up @@ -206,7 +207,7 @@ def tests
end
end

def setup_environment!(args)
def self.setup_environment!(args)
# Cleanup any unwanted user configuration.
allowed_test_env = %w[
HOMEBREW_GITHUB_API_TOKEN
Expand Down