@@ -771,7 +771,8 @@ lazy val root: Project = (project in file("."))
771
771
testAll := {
772
772
val results = ScriptCommands .sequence[Result [Unit ]](List (
773
773
(Keys .test in Test in junit).result,
774
- (testOnly in IntegrationTest in testP).toTask(" -- run pos neg jvm" ).result,
774
+ (testOnly in IntegrationTest in testP).toTask(" -- run" ).result,
775
+ (testOnly in IntegrationTest in testP).toTask(" -- pos neg jvm" ).result,
775
776
(testOnly in IntegrationTest in testP).toTask(" -- res scalap specialized scalacheck" ).result,
776
777
(testOnly in IntegrationTest in testP).toTask(" -- instrumented presentation" ).result,
777
778
(testOnly in IntegrationTest in testP).toTask(" -- --srcpath scaladoc" ).result,
@@ -786,11 +787,52 @@ lazy val root: Project = (project in file("."))
786
787
doc in Compile in scalap
787
788
).result
788
789
)).value
789
- val failed = results.map(_.toEither).collect { case Left (i) => i }
790
+ // All attempts to define these together with the actual tasks due to the applicative rewriting of `.value`
791
+ val descriptions = Vector (
792
+ " junit/test" ,
793
+ " partest run" ,
794
+ " partest pos neg jvm" ,
795
+ " partest res scalap specialized scalacheck" ,
796
+ " partest instrumented presentation" ,
797
+ " partest --srcpath scaladoc" ,
798
+ " osgiTestFelix/test" ,
799
+ " osgiTestEclipse/test" ,
800
+ " library/mima" ,
801
+ " reflect/mima" ,
802
+ " doc"
803
+ )
804
+ val failed = results.map(_.toEither).zip(descriptions).collect { case (Left (i : Incomplete ), d) => (i, d) }
790
805
if (failed.nonEmpty) {
791
806
val log = streams.value.log
807
+ def showScopedKey (k : Def .ScopedKey [_]): String =
808
+ Vector (
809
+ k.scope.project.toOption.map {
810
+ case p : ProjectRef => p.project
811
+ case p => p
812
+ }.map(_ + " /" ),
813
+ k.scope.config.toOption.map(_.name + " :" ),
814
+ k.scope.task.toOption.map(_.label + " ::" )
815
+ ).flatten.mkString + k.key
816
+ def logIncomplete (i : Incomplete , prefix : String ): Unit = {
817
+ val sk = i.node match {
818
+ case Some (t : Task [_]) =>
819
+ t.info.attributes.entries.collect { case e if e.key == Keys .taskDefinitionKey => e.value.asInstanceOf [Def .ScopedKey [_]] }
820
+ .headOption.map(showScopedKey)
821
+ case _ => None
822
+ }
823
+ val childCount = (if (i.directCause.isDefined) 1 else 0 ) + i.causes.length
824
+ val skip = childCount <= 1 && sk.isEmpty
825
+ if (! skip) log.error(s " $prefix- ${sk.getOrElse(" ?" )}" )
826
+ i.directCause match {
827
+ case Some (e) => log.error(s " $prefix - $e" )
828
+ case None => i.causes.foreach(i => logIncomplete(i, prefix + (if (skip) " " else " " )))
829
+ }
830
+ }
792
831
log.error(s " ${failed.size} of ${results.length} test tasks failed: " )
793
- failed.foreach(i => log.error(s " - $i" ))
832
+ failed.foreach { case (i, d) =>
833
+ log.error(s " - $d" )
834
+ logIncomplete(i, " " )
835
+ }
794
836
throw new RuntimeException
795
837
}
796
838
},
0 commit comments