Skip to content

Filter brew tests spec files appropriately for each OS #20079

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

Merged
merged 3 commits into from
Jun 12, 2025

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Jun 11, 2025

Follow-up to #20061

Currently, running brew tests on macOS will skip all cask tests because brew tests filters out all os-specific _spec.rb files, even without --generic. This PR fixes this issue by adding the necessary extend/os function overrides.


Relevant lines in dev-cmd/tests.rb:

files = os_files(files)

sig { params(files: T::Array[String]).returns(T::Array[String]) }
def os_files(files)
# for generic tests, remove macOS or Linux specific files
non_linux_files(non_macos_files(files))
end
sig { params(files: T::Array[String]).returns(T::Array[String]) }
def non_macos_files(files)
files.grep_v(%r{^test/(os/mac|cask)(/.*|_spec\.rb)$})
end
sig { params(files: T::Array[String]).returns(T::Array[String]) }
def non_linux_files(files)
files.grep_v(%r{^test/os/linux(/.*|_spec\.rb)$})
end

@Rylan12 Rylan12 enabled auto-merge June 11, 2025 18:49
@Rylan12 Rylan12 disabled auto-merge June 11, 2025 18:59
@Rylan12 Rylan12 force-pushed the fix-tests-only-files branch from 2ea9d07 to ce72e34 Compare June 11, 2025 19:59
@Rylan12
Copy link
Member Author

Rylan12 commented Jun 12, 2025

Just pushed a few more changes: these are just fixing up CI failures that went unnoticed while cask tests weren't being run. Should be all good now

I'm going to merge to get tests running again, but feel free to still review or open follow-ups

@Rylan12 Rylan12 added this pull request to the merge queue Jun 12, 2025
Merged via the queue into master with commit 5831783 Jun 12, 2025
33 checks passed
@Rylan12 Rylan12 deleted the fix-tests-only-files branch June 12, 2025 00:27
@MikeMcQuaid
Copy link
Member

Thanks @Rylan12! Have opened a slightly simpler fix in #20089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants