File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def rest_vector_variants_matrix
4242 end
4343
4444 def exclusions
45- YAML [ "exclude" ]
45+ YAML [ "exclude" ] || [ ]
4646 end
4747
4848 end
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ def all
1616 main_variant : variants . find { |v | v . vector . main? } ,
1717 rest_variants : variants . reject { |v | v . vector . main? }
1818 )
19+ end . select do |context |
20+ Config . exclusions . none? do |exclusion |
21+ context . match_exclusion? ( exclusion )
22+ end
1923 end
2024 end
2125
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ def test_all
9191 @rails_6_variant
9292 ]
9393 ] )
94+ Matrixeval ::Ruby ::Config . stubs ( :exclusions ) . returns ( [ ] )
9495
9596 contexts = Matrixeval ::Ruby ::Context . all
9697
@@ -100,4 +101,19 @@ def test_all
100101 assert_equal [ @rails_6_variant , @sidekiq_5_variant ] , contexts [ 0 ] . rest_variants
101102 end
102103
104+ def test_all_with_exclusions
105+ Matrixeval ::Ruby ::Config . stubs ( :variant_combinations ) . returns ( [
106+ [
107+ @ruby_3_variant ,
108+ @sidekiq_5_variant ,
109+ @rails_6_variant
110+ ]
111+ ] )
112+ Matrixeval ::Ruby ::Config . stubs ( :exclusions ) . returns ( [ { "ruby" => "3.0" , "rails" => "6.1" } ] )
113+
114+ contexts = Matrixeval ::Ruby ::Context . all
115+
116+ assert_equal 0 , contexts . count
117+ end
118+
103119end
You can’t perform that action at this time.
0 commit comments