Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Integrate scala-partest-interface into scala-partest #50

Merged
merged 2 commits into from
Feb 12, 2016

Conversation

szeiger
Copy link
Contributor

@szeiger szeiger commented Feb 11, 2016

The original assumptions about classpaths and classloaders, which prompted the separation into two projects, do not hold in Scala's sbt build. scala-partest-interface always used reflective access to scala-partet but did so through it's own ClassLoader, which makes sense considering that both end up as libraryDependencies on the same classpath. There doesn't seem to be any reason to keep the two parts separate.

Review by @adriaanm

It’s only a few lines of code, it ends up on the same ClassLoader in
the Scala build, and we already have a dependency on sbt’s
test-interface here anyway.

The test framework class name changes from
`scala.tools.partest.Framework` to `scala.tools.partest.sbt.Framework`.
@szeiger
Copy link
Contributor Author

szeiger commented Feb 11, 2016

Note: I got the following error at the end of a complete partest run when trying this locally:

Exception in thread "Thread-42" java.lang.NullPointerException
    at sbt.TestEvent$$anonfun$overallResult$1.apply(TestReportListener.scala:72)
    at sbt.TestEvent$$anonfun$overallResult$1.apply(TestReportListener.scala:71)
    at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:51)
    at scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:60)
    at scala.collection.mutable.WrappedArray.foldLeft(WrappedArray.scala:34)
    at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:138)
    at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:105)
    at sbt.TestEvent$.overallResult(TestReportListener.scala:71)
    at sbt.TestEvent$$anon$1.<init>(TestReportListener.scala:66)
    at sbt.TestEvent$.apply(TestReportListener.scala:65)
    at sbt.React.react(ForkTests.scala:129)
    at sbt.ForkTests$$anonfun$mainTestTask$1$Acceptor$2$.run(ForkTests.scala:74)
    at java.lang.Thread.run(Thread.java:745)

I doubt that it was caused by these changes. I was unable to reproduce it and I don't have an explanation for it. The error points to an Event being null but scala-partest emits sbt test events only in a single location where they are guaranteed to be nun-null.

@szeiger
Copy link
Contributor Author

szeiger commented Feb 11, 2016

I did two more runs of the whole test suite with this version and couldn't reproduce the problem.

@retronym
Copy link
Member

LGTM. I'm going to tag a release so I can use this on the 2.12 branch, and save having to bring sbt-partest-interface into the bootstrap script.

retronym added a commit that referenced this pull request Feb 12, 2016
Integrate scala-partest-interface into scala-partest
@retronym retronym merged commit 87efa33 into scala:master Feb 12, 2016
lrytz pushed a commit to lrytz/scala-partest that referenced this pull request May 9, 2018
Integrate scala-partest-interface into scala-partest
lrytz pushed a commit to lrytz/scala-partest that referenced this pull request May 9, 2018
Integrate scala-partest-interface into scala-partest
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants