Skip to content

Running tagged tests works in 0.12.4 but not with 0.13.0-RC1 #813

oscarvarto opened this Issue Jul 12, 2013 · 2 comments

2 participants


Steps to reproduce the problem:
1. $ git clone
2. $ cd scalatest-tag
3. $ sbt
> xtests:test

sbt says
[info] No tests to run for xtests:test
(See --> 0.13.0-RC1 does not run tests tagged XTest)

(I am using the sbt launcher for 0.13.0-RC1 to be able to do this with 0.12 and 0.13 versions of sbt)

Now comment and uncomment so that sbt.version=0.12.4, and try again. The expected behavior is that of sbt 0.12 (being able to run only those tests tagged XTest, with xtests:test):
$ sbt
[info] Loading project definition from /Users/oscarvarto/programacion/scala2013/scalatest-tag/project
[info] Set current project to scalatest-tag (in build file:/Users/oscarvarto/programacion/scala2013/scalatest-tag/)
> test
[info] Updating {file:/Users/oscarvarto/programacion/scala2013/scalatest-tag/}scalatest-tag...
[info] Resolving org.scalatest#scalatest_2.10;2.0.M6-SNAP26 ...
[info] Done updating.
[info] DummyTest:
[info] - This test is tagged XTest (pending)
[info] - This is a normal test
[info] Passed: : Total 2, Failed 0, Errors 0, Passed 1, Skipped 1
[success] Total time: 1 s, completed Jul 11, 2013 8:57:55 PM
> xtests:test
[info] DummyTest:
[info] - This test is tagged XTest (pending)
[info] Passed: : Total 1, Failed 0, Errors 0, Passed 0, Skipped 1
[success] Total time: 0 s, completed Jul 11, 2013 8:57:59 PM

mharrah on #sbt irc channel said:
[7:52pm] mharrah: oscarvarto: ok, the first problem is that the tests aren't detected due to a fixed bug. However, you definitely followed the docs, so I'll have to see if this can be improved.
[7:52pm] mharrah: in particular, xtests doesn't contain any sources, so xtests:test doesn't think it has anything to run
[7:52pm] mharrah: in 0.12, xtests: was incorrectly configured to do the same thing as test:, so it worked
[7:53pm] mharrah: by do the same thing, I meant run the tests in src/test/scala even if there were tests in src/xtest/scala
[7:54pm] mharrah: this was #539 and similar issues

mharrah: ok. the immediate fix is to tell xtest: to use the same tests as from test:, which can be done with
[7:58pm] mharrah: definedTests in XTests <<= definedTests in Test
[7:58pm] mharrah: that at least runs something with xtest:test
[7:58pm] mharrah: however, it looks like something is wrong with passing arguments to the test framework, so it runs all tests
[8:15pm] mharrah: I'm still looking into the second problem. I'm currently wondering if ScalaTest is ignoring the arguments.

@harrah harrah was assigned Jul 12, 2013
sbt member
harrah commented Jul 12, 2013

The argument passing part was a bug in ScalaTest, which @cheeseng fixed in SNAP28.

sbt member
harrah commented Jul 12, 2013

Ah, sorry. I was wrong about it being the same as the docs. Shared sources use just Defaults.testTasks and not testSettings. With the argument handling fixed in ScalaTest and the new test in sbt, this is fixed.

@harrah harrah closed this Jul 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.