@@ -51,6 +51,11 @@ def run
5151 HOMEBREW_LIBRARY_PATH . cd do
5252 setup_environment!
5353
54+ # Needs required here, after `setup_environment!`, so that
55+ # `HOMEBREW_TEST_GENERIC_OS` is set and `OS.linux?` and `OS.mac?` both
56+ # `return false`.
57+ require "extend/os/dev-cmd/tests"
58+
5459 parallel = !args . no_parallel?
5560
5661 only = args . only
@@ -127,8 +132,8 @@ def run
127132 bundle_args << "--tag" << "~needs_network" unless args . online?
128133 bundle_args << "--tag" << "~needs_ci" unless ENV [ "CI" ]
129134
130- bundle_args = os_bundle_args ( bundle_args , generic : args . generic? )
131- files = os_files ( files , generic : args . generic? )
135+ bundle_args = os_bundle_args ( bundle_args )
136+ files = os_files ( files )
132137
133138 puts "Randomized with seed #{ seed } "
134139
@@ -156,12 +161,11 @@ def run
156161
157162 private
158163
159- sig { params ( bundle_args : T ::Array [ String ] , generic : T :: Boolean ) . returns ( T ::Array [ String ] ) }
160- def os_bundle_args ( bundle_args , generic : )
164+ sig { params ( bundle_args : T ::Array [ String ] ) . returns ( T ::Array [ String ] ) }
165+ def os_bundle_args ( bundle_args )
161166 # for generic tests, remove macOS or Linux specific tests
162167 non_linux_bundle_args ( non_macos_bundle_args ( bundle_args ) )
163168 end
164- alias generic_os_bundle_args os_bundle_args
165169
166170 sig { params ( bundle_args : T ::Array [ String ] ) . returns ( T ::Array [ String ] ) }
167171 def non_macos_bundle_args ( bundle_args )
@@ -176,12 +180,11 @@ def non_linux_bundle_args(bundle_args)
176180 bundle_args << "--tag" << "~needs_linux" << "--tag" << "~needs_systemd"
177181 end
178182
179- sig { params ( files : T ::Array [ String ] , generic : T :: Boolean ) . returns ( T ::Array [ String ] ) }
180- def os_files ( files , generic : )
183+ sig { params ( files : T ::Array [ String ] ) . returns ( T ::Array [ String ] ) }
184+ def os_files ( files )
181185 # for generic tests, remove macOS or Linux specific files
182186 non_linux_files ( non_macos_files ( files ) )
183187 end
184- alias generic_os_files os_files
185188
186189 sig { params ( files : T ::Array [ String ] ) . returns ( T ::Array [ String ] ) }
187190 def non_macos_files ( files )
@@ -269,5 +272,3 @@ def setup_environment!
269272 end
270273 end
271274end
272-
273- require "extend/os/dev-cmd/tests"
0 commit comments