[ruby/rubygems] Add before(:context) hook to warn when spec files are not assigned to any Windows runner group

https://github.com/ruby/rubygems/commit/3ddb740969
This commit is contained in:
Hiroshi SHIBATA 2025-12-05 06:33:34 +09:00 committed by git
parent 412895ae84
commit d105709f2b
2 changed files with 12 additions and 0 deletions

View File

@ -139,4 +139,11 @@ RSpec.configure do |config|
metadata[tag] = true
end
end
config.before(:context) do |example|
metadata = example.class.metadata
if metadata[:type] != :aruba && metadata.keys.none? {|k| Spec::WindowsTagGroup::EXAMPLE_MAPPINGS.keys.include?(k) }
warn "#{metadata[:file_path]} is not assigned to any Windows runner group. see spec/support/windows_tag_group.rb for details."
end
end
end

View File

@ -1,5 +1,10 @@
# frozen_string_literal: true
# This group classifies test files into 4 groups by running `bin/rspec --profile 10000`
# to ensure balanced execution times. When adding new test files, it is recommended to
# re-aggregate and adjust the groups to keep them balanced.
# For now, please add new files to group 'windows_d'.
module Spec
module WindowsTagGroup
EXAMPLE_MAPPINGS = {