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

Improvements for the Scala SBT build #49

Merged
merged 2 commits into from
Feb 9, 2016
Merged

Conversation

retronym
Copy link
Member

@retronym retronym commented Feb 6, 2016

Review by @szeiger or @SethTisue

Otherwise, we'll fall back to the non-existent scala-xml 1.0.4
when bootstrapping the modules with new releases of Scala 2.12.
Currently, only tests based in `test/files/...` can be tested
in partest through SBT.

This commit will honour `--srcpath scaladoc`, for example,
before defaulting to `files`.
@retronym
Copy link
Member Author

retronym commented Feb 6, 2016

The second commit intends to fix scala/scala-partest-interface#14

@retronym
Copy link
Member Author

retronym commented Feb 6, 2016

I've tested this out locally:

> show test/it:dependencyClasspath
[info] Packaging /Users/jason/code/scala2/build-sbt/pack/lib/scala-partest-javaagent.jar ...
[info] Done packaging.
[info] List(Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/test), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/compiler), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/library), Attributed(/Users/jason/code/scala2/build-sbt/libs/classes/forkjoin), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/reflect), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/interactive), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/actors), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/repl-jline-embedded), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/repl-jline), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/repl), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/scalap), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/partest-extras), Attributed(/Users/jason/code/scala2/build-sbt/pack/lib/scala-partest-javaagent.jar), Attributed(/Users/jason/code/scala2/build-sbt/quick/classes/scaladoc), Attributed(/Users/jason/code/scala2/test/files/lib/annotations.jar), Attributed(/Users/jason/code/scala2/test/files/lib/enums.jar), Attributed(/Users/jason/code/scala2/test/files/lib/genericNest.jar), Attributed(/Users/jason/code/scala2/test/files/lib/jsoup-1.3.1.jar), Attributed(/Users/jason/code/scala2/test/files/lib/macro210.jar), Attributed(/Users/jason/code/scala2/test/files/lib/methvsfield.jar), Attributed(/Users/jason/code/scala2/test/files/lib/nest.jar), Attributed(/Users/jason/code/scala2/test/lib), Attributed(/Users/jason/.ivy2/cache/org.apache.ant/ant/jars/ant-1.9.4.jar), Attributed(/Users/jason/.ivy2/cache/org.apache.ant/ant-launcher/jars/ant-launcher-1.9.4.jar), Attributed(/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-asm/bundles/scala-asm-5.0.4-scala-3.jar), Attributed(/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.4.jar), Attributed(/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar), Attributed(/Users/jason/.ivy2/cache/jline/jline/jars/jline-2.12.1.jar), Attributed(/Users/jason/.ivy2/local/org.scala-lang.modules/scala-partest_2.11/1.0.12-SNAPSHOT/jars/scala-partest_2.11.jar), Attributed(/Users/jason/.ivy2/cache/com.googlecode.java-diff-utils/diffutils/jars/diffutils-1.3.0.jar), Attributed(/Users/jason/.ivy2/cache/org.scala-sbt/test-interface/jars/test-interface-1.0.jar), Attributed(/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-partest-interface_2.11/jars/scala-partest-interface_2.11-0.7.0.jar), Attributed(/Users/jason/.ivy2/cache/org.scalacheck/scalacheck_2.11/jars/scalacheck_2.11-1.11.6.jar))
[success] Total time: 1 s, completed 06/02/2016 9:57:50 PM
> partest --srcpath pending --run
[info] Packaging /Users/jason/code/scala2/build-sbt/pack/lib/scala-partest-javaagent.jar ...
[info] Done packaging.
Partest version:
Compiler under test: $baseDir/compiler
Scala version is:    Scala compiler version 2.11.8-20160205-124626-b51fe3d -- Copyright 2002-2016, LAMP/EPFL
Scalac options are:
Compilation Path:    /Users/jason/code/scala2/target/test/it-classes:$baseDir/test:$baseDir/compiler:$baseDir/library:/Users/jason/code/scala2/build-sbt/libs/classes/forkjoin:$baseDir/reflect:$baseDir/interactive:$baseDir/actors:$baseDir/repl-jline-embedded:$baseDir/repl-jline:$baseDir/repl:$baseDir/scalap:$baseDir/partest-extras:/Users/jason/code/scala2/build-sbt/pack/lib/scala-partest-javaagent.jar:$baseDir/scaladoc:/Users/jason/code/scala2/test/files/lib/annotations.jar:/Users/jason/code/scala2/test/files/lib/enums.jar:/Users/jason/code/scala2/test/files/lib/genericNest.jar:/Users/jason/code/scala2/test/files/lib/jsoup-1.3.1.jar:/Users/jason/code/scala2/test/files/lib/macro210.jar:/Users/jason/code/scala2/test/files/lib/methvsfield.jar:/Users/jason/code/scala2/test/files/lib/nest.jar:/Users/jason/code/scala2/test/lib:/Users/jason/.ivy2/cache/org.apache.ant/ant/jars/ant-1.9.4.jar:/Users/jason/.ivy2/cache/org.apache.ant/ant-launcher/jars/ant-launcher-1.9.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-asm/bundles/scala-asm-5.0.4-scala-3.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/jline/jline/jars/jline-2.12.1.jar:/Users/jason/.ivy2/local/org.scala-lang.modules/scala-partest_2.11/1.0.12-SNAPSHOT/jars/scala-partest_2.11.jar:/Users/jason/.ivy2/cache/com.googlecode.java-diff-utils/diffutils/jars/diffutils-1.3.0.jar:/Users/jason/.ivy2/cache/org.scala-sbt/test-interface/jars/test-interface-1.0.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-partest-interface_2.11/jars/scala-partest-interface_2.11-0.7.0.jar:/Users/jason/.ivy2/cache/org.scalacheck/scalacheck_2.11/jars/scalacheck_2.11-1.11.6.jar:/Users/jason/.sbt/boot/scala-2.10.5/org.scala-sbt/sbt/0.13.9/test-agent-0.13.9.jar:/Users/jason/.sbt/boot/scala-2.10.5/org.scala-sbt/sbt/0.13.9/test-interface-1.0.jar
Java binaries in:    /Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home/jre/bin
Java runtime is:     Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)
Java options are:    -Xmx1024M -Xms64M -XX:MaxPermSize=128M
baseDir:             /Users/jason/code/scala2/build-sbt/quick/classes
sourceDir:           /Users/jason/code/scala2/test/pending

Selected 98 tests drawn from 1 named test categories

# starting 98 tests in run
!!  1 - run/idempotency-partial-functions.scala   [compilation failed]
!!  2 - run/jar-version.scala                     [compilation failed]
!!  3 - run/macro-expand-default                  [compilation failed]
!!  4 - run/hk-lub-fail.scala                     [compilation failed]
!!  5 - run/macro-expand-implicit-macro-defeats-type-inference  [compilation failed]
!!  6 - run/instanceOfAndTypeMatching.scala       [compilation failed]
!!  7 - run/bug4704run.scala                      [compilation failed]
!!  8 - run/macro-expand-macro-has-context-bound  [compilation failed]
!!  9 - run/macro-expand-named                    [compilation failed]
!! 10 - run/macro-expand-tparams-prefix-e1        [compilation failed]
^C
[warn] Canceling execution...
Exception in thread "Thread-70" java.io.EOFException

To automate running the scaladoc tests, I think we'll need to create another config (alongside IntegrationTest) in our SBT build that adds the test framework option --srcpath scaladoc.

retronym added a commit to retronym/scala that referenced this pull request Feb 6, 2016
We can complete partest options (I've excluded some that
aren't relevant in SBT), as well as test file names.

If `--srcpath scaladoc` is included, completion of test
paths will be based on `test/scaladoc` rather than
the default `test/files`. Note that the `--srcpath` option
is currently broken via scala partest interface, this
change to scala-partest is needed to make it work:

   scala/scala-partest#49

I've also hijacked the `--grep` option with logic
in the SBT command itself, rather than passing this
to `partest`. Just like `./bin/partest-ack`, this looks
for either test file names or regex matches within
the contents of test, check, or flag files.

I tried for some time to make the tab completion of
thousands of filenames more user friendly, but wasn't
able to get something working. Ideally, it should
only suggest to `test/files/{pos, neg, ...}` on the
first <TAB>, and then offer files on another TAB.
Files should also be offered if a full directory
has been entered. Hopefully a SBT parser guru will
step in and add some polish here.
@szeiger
Copy link
Contributor

szeiger commented Feb 8, 2016

LGTM. Honoring --srcpath makes sense because we already allow arbitrary partest options to be passed from sbt.

For a proper integration of the scaladoc tests we should reconsider SBTRunner's srcDir parameter and either use that to pass the correct dir from partest-interface by default (users could still override it with --srcpath) or drop it and always use --srcpath.

We may want to change the project/config scoping for tests in the sbt build as well. Adding configs is a bit ugly, so I'd rather go for a separate project. Do we even need to use the it config for partest? It's not fundamentally different from the junit tests. We could have three subprojects for junit tests, standard partest tests and scaladoc partet tests, each scoped to the test configuration.

@retronym
Copy link
Member Author

retronym commented Feb 9, 2016

For a proper integration of the scaladoc tests we should reconsider SBTRunner's srcDir parameter and either use that to pass the correct dir from partest-interface by default (users could still override it with --srcpath) or drop it and always use --srcpath.

That would be the principled approach, but in the meantime we just need our CI to call partest --srcdir scaladoc in addition to the other test commands.

We could have three subprojects for junit tests, standard partest tests and scaladoc partet tests, each scoped to the test configuration.

That sounds like a good idea.

retronym added a commit that referenced this pull request Feb 9, 2016
Improvements for the Scala SBT build
@retronym retronym merged commit 24059d8 into scala:master Feb 9, 2016
janekdb pushed a commit to janekdb/scala that referenced this pull request Feb 11, 2016
We can complete partest options (I've excluded some that
aren't relevant in SBT), as well as test file names.

If `--srcpath scaladoc` is included, completion of test
paths will be based on `test/scaladoc` rather than
the default `test/files`. Note that the `--srcpath` option
is currently broken via scala partest interface, this
change to scala-partest is needed to make it work:

   scala/scala-partest#49

I've also hijacked the `--grep` option with logic
in the SBT command itself, rather than passing this
to `partest`. Just like `./bin/partest-ack`, this looks
for either test file names or regex matches within
the contents of test, check, or flag files.

I tried for some time to make the tab completion of
thousands of filenames more user friendly, but wasn't
able to get something working. Ideally, it should
only suggest to `test/files/{pos, neg, ...}` on the
first <TAB>, and then offer files on another TAB.
Files should also be offered if a full directory
has been entered. Hopefully a SBT parser guru will
step in and add some polish here.
lrytz pushed a commit to lrytz/scala-partest that referenced this pull request May 9, 2018
Improvements for the Scala SBT build
lrytz pushed a commit to lrytz/scala-partest that referenced this pull request May 9, 2018
Improvements for the Scala SBT build
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