@@ -367,8 +367,18 @@ executePlan' :: HasEnvConfig env
367
367
-> ExecuteEnv
368
368
-> RIO env ()
369
369
executePlan' installedMap0 targets plan ee = do
370
+ config <- view configL
370
371
let ! buildOpts = ee. buildOpts
371
372
! testOpts = buildOpts. testOpts
373
+ ! benchmarkOpts = buildOpts. benchmarkOpts
374
+ runTests = testOpts. runTests
375
+ runBenchmarks = benchmarkOpts. runBenchmarks
376
+ noNotifyIfNoRunTests = not config. notifyIfNoRunTests
377
+ noNotifyIfNoRunBenchmarks = not config. notifyIfNoRunBenchmarks
378
+ hasTests = not . Set. null . testComponents . taskComponents
379
+ hasBenches = not . Set. null . benchComponents . taskComponents
380
+ tests = Map. elems $ Map. filter hasTests plan. finals
381
+ benches = Map. elems $ Map. filter hasBenches plan. finals
372
382
when testOpts. coverage deleteHpcReports
373
383
cv <- view actualCompilerVersionL
374
384
whenJust (nonEmpty $ Map. toList plan. unregisterLocal) $ \ ids -> do
@@ -400,6 +410,24 @@ executePlan' installedMap0 targets plan ee = do
400
410
buildOpts. keepGoing
401
411
terminal <- view terminalL
402
412
terminalWidth <- view termWidthL
413
+ unless (noNotifyIfNoRunTests || runTests || null tests) $
414
+ prettyInfo $
415
+ fillSep
416
+ [ flow " All test running disabled by"
417
+ , style Shell " --no-run-tests"
418
+ , flow " flag. To mute this message in future, set"
419
+ , style Shell (flow " notify-if-no-run-tests: false" )
420
+ , flow " in Stack's configuration."
421
+ ]
422
+ unless (noNotifyIfNoRunBenchmarks || runBenchmarks || null benches) $
423
+ prettyInfo $
424
+ fillSep
425
+ [ flow " All benchmark running disabled by"
426
+ , style Shell " --no-run-benchmarks"
427
+ , flow " flag. To mute this message in future, set"
428
+ , style Shell (flow " notify-if-no-run-benchmarks: false" )
429
+ , flow " in Stack's configuration."
430
+ ]
403
431
errs <- liftIO $ runActions threads keepGoing actions $
404
432
\ doneVar actionsVar -> do
405
433
let total = length actions
@@ -564,8 +592,9 @@ toActions installedMap mtestLock runInBase ee (mbuild, mfinal) =
564
592
, concurrency = ConcurrencyAllowed
565
593
}
566
594
) $
567
- -- These are the "final" actions - running tests and benchmarks.
568
- ( if Set. null tests
595
+ -- These are the "final" actions - running test suites and benchmarks,
596
+ -- unless --no-run-tests or --no-run-benchmarks is enabled.
597
+ ( if Set. null tests || not runTests
569
598
then id
570
599
else (:) Action
571
600
{ actionId = ActionId pkgId ATRunTests
@@ -578,7 +607,7 @@ toActions installedMap mtestLock runInBase ee (mbuild, mfinal) =
578
607
, concurrency = ConcurrencyAllowed
579
608
}
580
609
) $
581
- ( if Set. null benches
610
+ ( if Set. null benches || not runBenchmarks
582
611
then id
583
612
else (:) Action
584
613
{ actionId = ActionId pkgId ATRunBenchmarks
@@ -615,6 +644,8 @@ toActions installedMap mtestLock runInBase ee (mbuild, mfinal) =
615
644
bopts = ee. buildOpts
616
645
topts = bopts. testOpts
617
646
beopts = bopts. benchmarkOpts
647
+ runTests = topts. runTests
648
+ runBenchmarks = beopts. runBenchmarks
618
649
619
650
taskComponents :: Task -> Set NamedComponent
620
651
taskComponents task =
0 commit comments