Skip to content

Commit d105709

Browse files
hsbtmatzbot
authored andcommitted
[ruby/rubygems] Add before(:context) hook to warn when spec files are not assigned to any Windows runner group
ruby/rubygems@3ddb740969
1 parent 412895a commit d105709

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

spec/bundler/spec_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,11 @@ def self.ruby=(ruby)
139139
metadata[tag] = true
140140
end
141141
end
142+
143+
config.before(:context) do |example|
144+
metadata = example.class.metadata
145+
if metadata[:type] != :aruba && metadata.keys.none? {|k| Spec::WindowsTagGroup::EXAMPLE_MAPPINGS.keys.include?(k) }
146+
warn "#{metadata[:file_path]} is not assigned to any Windows runner group. see spec/support/windows_tag_group.rb for details."
147+
end
148+
end
142149
end

spec/bundler/support/windows_tag_group.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# frozen_string_literal: true
22

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

0 commit comments

Comments
 (0)