@@ -165,14 +165,14 @@ defmodule ExUnit.Runner do
165
165
running
166
166
end
167
167
168
- defp spawn_modules ( config , [ { _group , [ _ | _ ] = modules } | groups ] , async? , running ) do
168
+ defp spawn_modules ( config , [ { group , [ _ | _ ] = modules } | groups ] , async? , running ) do
169
169
if max_failures_reached? ( config ) do
170
170
running
171
171
else
172
172
{ pid , ref } =
173
173
spawn_monitor ( fn ->
174
174
Enum . each ( modules , fn { module , params } ->
175
- run_module ( config , module , async? , params )
175
+ run_module ( config , module , async? , group , params )
176
176
end )
177
177
end )
178
178
@@ -231,12 +231,13 @@ defmodule ExUnit.Runner do
231
231
232
232
## Running modules
233
233
234
- defp run_module ( config , module , async? , params ) do
234
+ defp run_module ( config , module , async? , group , params ) do
235
235
test_module = % { module . __ex_unit__ ( ) | parameters: params }
236
236
EM . module_started ( config . manager , test_module )
237
237
238
238
# Prepare tests, selecting which ones should be run or skipped
239
- { to_run_tests , excluded_and_skipped_tests } = prepare_tests ( config , async? , test_module . tests )
239
+ { to_run_tests , excluded_and_skipped_tests } =
240
+ prepare_tests ( config , async? , group , test_module . tests )
240
241
241
242
for excluded_or_skipped_test <- excluded_and_skipped_tests do
242
243
EM . test_started ( config . manager , excluded_or_skipped_test )
@@ -271,7 +272,7 @@ defmodule ExUnit.Runner do
271
272
end
272
273
end
273
274
274
- defp prepare_tests ( config , async? , tests ) do
275
+ defp prepare_tests ( config , async? , group , tests ) do
275
276
tests = shuffle ( config , tests )
276
277
include = config . include
277
278
exclude = config . exclude
@@ -280,7 +281,13 @@ defmodule ExUnit.Runner do
280
281
{ to_run , to_skip } =
281
282
for test <- tests , include_test? ( test_ids , test ) , reduce: { [ ] , [ ] } do
282
283
{ to_run , to_skip } ->
283
- tags = Map . merge ( test . tags , % { test: test . name , module: test . module , async: async? } )
284
+ tags =
285
+ Map . merge ( test . tags , % {
286
+ test: test . name ,
287
+ module: test . module ,
288
+ async: async? ,
289
+ test_group: group
290
+ } )
284
291
285
292
case ExUnit.Filters . eval ( include , exclude , tags , tests ) do
286
293
:ok -> { [ % { test | tags: tags } | to_run ] , to_skip }
0 commit comments