Possible bug when extending IntegrationTest scope in AutoPlugin?

72 views
Skip to first unread message

Martin Studer

unread,
May 16, 2017, 4:30:50 PM5/16/17
to sbt-dev
Hi,

I'm trying to create an AutoPlugin which (amongst other things) extends the IntegrationTest configuration to the Test configuration such that classes in src/it have a classpath dependency on classes in src/test (according to http://stackoverflow.com/questions/20624574/how-to-make-test-classes-available-in-the-it-integration-test-configuratio)

I'm using a definition like the following:

import sbt._
import Keys._


object MyPlugin extends AutoPlugin {

 
override def trigger: PluginTrigger = allRequirements

 
override def projectSettings: Seq[Setting[_]] = Defaults.itSettings ++ Seq(...)
 
 
override def projectConfigurations: Seq[Configuration] = Seq(Configurations.IntegrationTest extend (Test))
 
}


What I find is that this "masks" other tasks such as the run and test tasks (run becomes it:run, test becomes it:test):

[myproject] $ inspect run
[info] Input task: Unit
[info] Description:
[info]  Runs a main class, passing along arguments provided on the command 
line.
[info] Provided by:
[info]  {file://myproject/}myproject/it:run
[info] Defined at:
[info]  (sbt.Defaults) Defaults.scala:307
...
or

[myproject] $ inspect test
[info] Task: Unit
[info] Description:
[info]  Executes all tests.
[info] Provided by:
[info]  {file://myproject/}root/it:test
[info] Defined at:
[info]  (sbt.Defaults) Defaults.scala:441


I further notice weird behavior when running test:test in a multi-module sbt project where running test:test on the root project fails some tests while running the same tests in the specific submodule works fine.

Is this a bug in sbt (I'm using version 0.13.15) or is this expected behavior?

Thanks & Best regards,
Martin

eugene yokota

unread,
May 16, 2017, 4:41:25 PM5/16/17
to sbt...@googlegroups.com
I didn't check the details but the fact that you don't have 

  def requires = sbt.plugins.JvmPlugin

is a suspect.

-eugene


--
You received this message because you are subscribed to the Google Groups "sbt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/9f7e4720-8895-4607-80f5-eb8662dd8602%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages