Skip to content

Vulpix test framework cleaned-up #6340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2019

Conversation

anatoliykmetyuk
Copy link
Contributor

There are four types of tests in the Vulpix framework:
positive compilation, negative compilation, run and fuzzy.
They shared a deal of common logic on which a lot of hacks
was done over time. This lead to them doing essentially the same
thing in different ways and with minor semantic differences.
This commit makes the code in question more DRY and abstracts
away the common logic for the four test types.

Copy link
Contributor

@allanrenucci allanrenucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplification! 👍

}

private trait CompilationLogic { this: Test =>
val suppressErrors = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a def. It is effectively compiled to a virtual method anyway. Using a def saves you a field


final def checkFile(testSource: TestSource): Option[JFile] = (testSource match {
case ts: JointCompilationSource =>
ts.files.filter(f => !f.isDirectory).map { f => new JFile(f.getAbsolutePath.replaceFirst("\\.scala$", ".check")) }.headOption
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be:

ts.files.collectFirst {
  case f if !f.isDirectory =>
    new JFile(f.getAbsolutePath.replaceFirst("\\.scala$", ".check"))
}


case Failure(output) =>
case Success(_) if !checkFile.isDefined || !checkFile.get.exists =>
case Success(output) => checkFile.foreach(diffTest(testSource, _, output.linesIterator.toList))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two cases above could be merged into one:

case Success(output) =>
  checkFile match {
    case Some(file) if file.exists =>
      diffTest(testSource, file, output.linesIterator.toList)
    case _ =>
  }

It is sightly longer, but I would argue more readable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leads to spaghetti though, and 2 loc vs 3 (in the most optimised scenario).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should never optimise number of LOC at the expense of readability. I have a tendency to say that my proposed change is simpler but I don't feel strongly about it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do believe the less LOC the less space for a bug to crawl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another argument in favour of low LOC number is low inertia of the code. The lower the lines there is, the less is there to change if you want to change something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition in @allanrenucci is simpler to understand. The current condition also has an instance of boolean blindness with the get that we should avoid.

case testSource @ JointCompilationSource(name, files, flags, outDir, fromTasty, decompilation) =>
val reporter =
if (fromTasty) compileFromTasty( flags, suppressErrors, outDir)
else compile(testSource.sourceFiles, flags, suppressErrors, outDir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We almost never use column alignment in the Dotty codebase. You should remove the extra spaces.


case Failure(output) =>
case Success(_) if !checkFile.isDefined || !checkFile.get.exists =>
case Success(output) => checkFile.foreach(diffTest(testSource, _, output.linesIterator.toList))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition in @allanrenucci is simpler to understand. The current condition also has an instance of boolean blindness with the get that we should avoid.

val actualErrors = reporters.foldLeft(0)(_ + _.errorCount)
val hasMissingAnnotations = getMissingExpectedErrors(errorMap, reporters.iterator.flatMap(_.errors))

if (compilerCrashed ) Some(s"Compiler crashed when compiling: ${testSource.title}" )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not align the code on columns

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was particularly hard for me

val compilerCrashed = reporters.exists(_.compilerCrashed)
val (errorMap, expectedErrors) = getErrorMapAndExpectedCount(testSource.sourceFiles)
val actualErrors = reporters.foldLeft(0)(_ + _.errorCount)
val hasMissingAnnotations = getMissingExpectedErrors(errorMap, reporters.iterator.flatMap(_.errors))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a def, we only use it once

@anatoliykmetyuk
Copy link
Contributor Author

Thanks for looking into it @allanrenucci, @nicolasstucki. I've addressed your remarks, can you please have a look at the latest commit?

Copy link
Contributor

@allanrenucci allanrenucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @anatoliykmetyuk!

}

/** This callback is executed once the compilation of this test source finished */
final def onComplete(testSource: TestSource, reportersOrCrash: Try[Seq[TestReporter]], logger: LoggedRunnable): Unit =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be private?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, updated it

@anatoliykmetyuk
Copy link
Contributor Author

Rebased

@nicolasstucki
Copy link
Contributor

@anatoliykmetyuk you should rebase rather than merge master into this branch

@nicolasstucki
Copy link
Contributor

Fuzzy test do not work.

$ cp tests/pending/fuzzy/AE-0a77f624d121ddc673c9bd47a23c5b65bd35bc0b.scala tests/fuzzy/AE-0a77f624d121ddc673c9bd47a23c5b65bd35bc0b.scala
$ sbt "testCompilation tests/fuzzy/AE-0a77f624d121ddc673c9bd47a23c5b65bd35bc0b.scala"

succeeds with

Test output

...
[info] Test dotty.tools.dotc.CompilationTests.fuzzyAll started
java.lang.AssertionError: assertion failedcompleted (0/1, 0 failed, 1s)
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:15)
	at dotty.tools.dotc.core.TypeErasure$ErasedValueType$.apply(TypeErasure.scala:103)
	at dotty.tools.dotc.core.TypeErasure.eraseDerivedValueClassRef(TypeErasure.scala:516)
	at dotty.tools.dotc.core.TypeErasure.dotty$tools$dotc$core$TypeErasure$$sigName(TypeErasure.scala:560)
	at dotty.tools.dotc.core.TypeErasure.dotty$tools$dotc$core$TypeErasure$$sigName(TypeErasure.scala:572)
	at dotty.tools.dotc.core.TypeErasure$.sigName(TypeErasure.scala:152)
	at dotty.tools.dotc.core.Signature$.apply(Signature.scala:132)
	at dotty.tools.dotc.core.Types$MethodicType.resultSignature(Types.scala:2831)
	at dotty.tools.dotc.core.Types$MethodOrPoly.resultSignature(Types.scala:2970)
	at dotty.tools.dotc.core.Types$MethodType.computeSignature(Types.scala:3131)
	at dotty.tools.dotc.core.Types$SignatureCachingType.signature(Types.scala:2819)
	at dotty.tools.dotc.core.Types$MethodOrPoly.signature(Types.scala:2970)
	at dotty.tools.dotc.core.Types$MethodicType.resultSignature(Types.scala:2828)
	at dotty.tools.dotc.core.Types$MethodOrPoly.resultSignature(Types.scala:2970)
	at dotty.tools.dotc.core.Types$PolyType.computeSignature(Types.scala:3317)
	at dotty.tools.dotc.core.Types$SignatureCachingType.signature(Types.scala:2819)
	at dotty.tools.dotc.core.Types$MethodOrPoly.signature(Types.scala:2970)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.signature(Denotations.scala:727)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.matches(Denotations.scala:1089)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.filterDisjoint(Denotations.scala:1106)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.mapInherited(Denotations.scala:1101)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.mapInherited(Denotations.scala:1098)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1707)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1702)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1702)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1702)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.computeNPMembersNamed(SymDenotations.scala:1715)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.nonPrivateMembersNamed(SymDenotations.scala:1684)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.membersNamed(SymDenotations.scala:1671)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.findMember(SymDenotations.scala:1719)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:562)
	at dotty.tools.dotc.core.Types$Type.goThis$1(Types.scala:672)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:579)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:712)
	at dotty.tools.dotc.typer.NamerContextOps.denotNamed(Namer.scala:56)
	at dotty.tools.dotc.core.Contexts$Context.denotNamed(Contexts.scala:71)
	at dotty.tools.dotc.typer.Namer$$anon$2.applyOrElse(Namer.scala:1301)
	at dotty.tools.dotc.typer.Namer$$anon$2.applyOrElse(Namer.scala:1296)
	at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
	at dotty.tools.dotc.core.Names$DerivedName.collect(Names.scala:487)
	at dotty.tools.dotc.typer.Namer.rhsProto$2(Namer.scala:1313)
	at dotty.tools.dotc.typer.Namer.rhsType$1$$anonfun$1(Namer.scala:1340)
	at dotty.tools.dotc.core.Types$Type.orElse(Types.scala:140)
	at dotty.tools.dotc.typer.Namer.rhsType$2(Namer.scala:1340)
	at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1352)
	at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1353)
	at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1371)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1379)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1448)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:771)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:882)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:797)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:237)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:180)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:182)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:343)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2065)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2090)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2166)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2201)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2232)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2278)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1676)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2103)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2166)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2201)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2232)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2278)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1795)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2143)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2167)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2201)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2289)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:61)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:35)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:65)
	at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$2(FrontEnd.scala:89)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:392)
	at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:89)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:158)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198)
	at dotty.tools.dotc.Run.runPhases$5(Run.scala:170)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:178)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:102)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:185)
	at dotty.tools.dotc.Run.compileSources(Run.scala:120)
	at dotty.tools.dotc.Run.compile(Run.scala:104)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:34)
	at dotty.tools.dotc.Driver.process(Driver.scala:172)
	at dotty.tools.dotc.Driver.process(Driver.scala:141)
	at dotty.tools.vulpix.ParallelTesting$Test.compile(ParallelTesting.scala:474)
	at dotty.tools.vulpix.ParallelTesting$CompilationLogic.compileTestSource$$anonfun$1(ParallelTesting.scala:198)
	at scala.util.Try$.apply(Try.scala:213)
	at dotty.tools.vulpix.ParallelTesting$CompilationLogic.dotty$tools$vulpix$ParallelTesting$CompilationLogic$$compileTestSource(ParallelTesting.scala:203)
	at dotty.tools.vulpix.ParallelTesting$$anon$2.checkTestSource$$anonfun$1(ParallelTesting.scala:240)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.vulpix.ParallelTesting$Test.tryCompile(ParallelTesting.scala:412)
	at dotty.tools.vulpix.ParallelTesting$$anon$2.checkTestSource(ParallelTesting.scala:243)
	at dotty.tools.vulpix.ParallelTesting$Test$LoggedRunnable.run(ParallelTesting.scala:311)
	at dotty.tools.vulpix.ParallelTesting$$anon$2.run(ParallelTesting.scala:238)
	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
no sig for TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),class i2) because of ()
java.lang.AssertionError: assertion failed
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:15)
	at dotty.tools.dotc.core.TypeErasure$ErasedValueType$.apply(TypeErasure.scala:103)
	at dotty.tools.dotc.core.TypeErasure.eraseDerivedValueClassRef(TypeErasure.scala:516)
	at dotty.tools.dotc.core.TypeErasure.dotty$tools$dotc$core$TypeErasure$$sigName(TypeErasure.scala:560)
	at dotty.tools.dotc.core.TypeErasure.dotty$tools$dotc$core$TypeErasure$$sigName(TypeErasure.scala:572)
	at dotty.tools.dotc.core.TypeErasure$.sigName(TypeErasure.scala:152)
	at dotty.tools.dotc.core.Signature$.apply(Signature.scala:132)
	at dotty.tools.dotc.core.Types$MethodicType.resultSignature(Types.scala:2831)
	at dotty.tools.dotc.core.Types$MethodOrPoly.resultSignature(Types.scala:2970)
	at dotty.tools.dotc.core.Types$MethodType.computeSignature(Types.scala:3131)
	at dotty.tools.dotc.core.Types$SignatureCachingType.signature(Types.scala:2819)
	at dotty.tools.dotc.core.Types$MethodOrPoly.signature(Types.scala:2970)
	at dotty.tools.dotc.core.Types$MethodicType.resultSignature(Types.scala:2828)
	at dotty.tools.dotc.core.Types$MethodOrPoly.resultSignature(Types.scala:2970)
	at dotty.tools.dotc.core.Types$PolyType.computeSignature(Types.scala:3317)
	at dotty.tools.dotc.core.Types$SignatureCachingType.signature(Types.scala:2819)
	at dotty.tools.dotc.core.Types$MethodOrPoly.signature(Types.scala:2970)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.signature(Denotations.scala:727)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.matches(Denotations.scala:1089)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.filterDisjoint(Denotations.scala:1106)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.mapInherited(Denotations.scala:1101)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.mapInherited(Denotations.scala:1098)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1707)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1702)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1702)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1702)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.computeNPMembersNamed(SymDenotations.scala:1715)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.nonPrivateMembersNamed(SymDenotations.scala:1684)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.membersNamed(SymDenotations.scala:1671)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.findMember(SymDenotations.scala:1719)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:562)
	at dotty.tools.dotc.core.Types$Type.goThis$1(Types.scala:672)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:579)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:712)
	at dotty.tools.dotc.typer.NamerContextOps.denotNamed(Namer.scala:56)
	at dotty.tools.dotc.core.Contexts$Context.denotNamed(Contexts.scala:71)
	at dotty.tools.dotc.typer.Namer$$anon$2.applyOrElse(Namer.scala:1301)
	at dotty.tools.dotc.typer.Namer$$anon$2.applyOrElse(Namer.scala:1296)
	at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
	at dotty.tools.dotc.core.Names$DerivedName.collect(Names.scala:487)
	at dotty.tools.dotc.typer.Namer.rhsProto$2(Namer.scala:1313)
	at dotty.tools.dotc.typer.Namer.rhsType$1$$anonfun$1(Namer.scala:1340)
	at dotty.tools.dotc.core.Types$Type.orElse(Types.scala:140)
	at dotty.tools.dotc.typer.Namer.rhsType$2(Namer.scala:1340)
	at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1352)
	at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1353)
	at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1371)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1379)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1448)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:771)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:882)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:797)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:237)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:180)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:182)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:343)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2065)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2090)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2166)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2201)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2232)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2278)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1676)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2103)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2166)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2201)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2232)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2278)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1795)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2143)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2167)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2201)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2289)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:61)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:35)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:65)
	at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$2(FrontEnd.scala:89)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:392)
	at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:89)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:158)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198)
	at dotty.tools.dotc.Run.runPhases$5(Run.scala:170)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:178)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:102)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:185)
	at dotty.tools.dotc.Run.compileSources(Run.scala:120)
	at dotty.tools.dotc.Run.compile(Run.scala:104)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:34)
	at dotty.tools.dotc.Driver.process(Driver.scala:172)
	at dotty.tools.dotc.Driver.process(Driver.scala:141)
	at dotty.tools.vulpix.ParallelTesting$Test.compile(ParallelTesting.scala:474)
	at dotty.tools.vulpix.ParallelTesting$CompilationLogic.compileTestSource$$anonfun$1(ParallelTesting.scala:198)
	at scala.util.Try$.apply(Try.scala:213)
	at dotty.tools.vulpix.ParallelTesting$CompilationLogic.dotty$tools$vulpix$ParallelTesting$CompilationLogic$$compileTestSource(ParallelTesting.scala:203)
	at dotty.tools.vulpix.ParallelTesting$$anon$2.checkTestSource$$anonfun$1(ParallelTesting.scala:240)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.vulpix.ParallelTesting$Test.tryCompile(ParallelTesting.scala:412)
	at dotty.tools.vulpix.ParallelTesting$$anon$2.checkTestSource(ParallelTesting.scala:243)
	at dotty.tools.vulpix.ParallelTesting$Test$LoggedRunnable.run(ParallelTesting.scala:311)
	at dotty.tools.vulpix.ParallelTesting$$anon$2.run(ParallelTesting.scala:238)
	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
no sig for AppliedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),class i2),List(TypeParamRef(i3))) because of ()
failure while taking result signature of (i4: i0[i3]): i2[i3]: i2[i3]
failure while taking result signature of [i3](i4: i0[i3]): i2[i3]: (i4: i0[i3]): i2[i3]
java.lang.AssertionError: assertion failed while compiling /Users/nicolasstucki/GitHub/dotty/tests/fuzzy/AE-0a77f624d121ddc673c9bd47a23c5b65bd35bc0b.scala
[=======================================] completed (1/1, 0 failed, 1s)
[info] Test dotty.tools.dotc.CompilationTests.genericJavaSignatures started
No files matched "tests/fuzzy/AE-0a77f624d121ddc673c9bd47a23c5b65bd35bc0b.scala" in test

================================================================================
Test Report
================================================================================

1 suites passed, 0 failed, 1 total

@anatoliykmetyuk anatoliykmetyuk force-pushed the partest-cleanup branch 3 times, most recently from cb38709 to 542b15c Compare May 2, 2019 12:17
There are four types of tests in the Vulpix framework:
positive compilation, negative compilation, run and fuzzy.
They shared a deal of common logic on which a lot of hacks
was done over time. This lead to them doing essentially the same
thing in different ways and with minor semantic differences.
This commit makes the code in question more DRY and abstracts
away the common logic for the four test types.
@anatoliykmetyuk
Copy link
Contributor Author

Fuzzy test do not work.

$ cp tests/pending/fuzzy/AE-0a77f624d121ddc673c9bd47a23c5b65bd35bc0b.scala tests/fuzzy/AE-0a77f624d121ddc673c9bd47a23c5b65bd35bc0b.scala
$ sbt "testCompilation tests/fuzzy/AE-0a77f624d121ddc673c9bd47a23c5b65bd35bc0b.scala"

succeeds with

Test output

Fixed

@nicolasstucki nicolasstucki merged commit dd2a312 into scala:master May 3, 2019
@nicolasstucki nicolasstucki deleted the partest-cleanup branch May 3, 2019 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants