Sunday, 15 September 2013

sbt - Why are no tests executed after migration from Play 2.2.2 to 2.3 with activator test? -



sbt - Why are no tests executed after migration from Play 2.2.2 to 2.3 with activator test? -

i upgraded application play 2.2.2 2.3. app running well.

sometimes activator test gives next output:

[info] loading project definition /users/myapp/project [info] set current project myapp (in build file:/users/myapp/) [info] compiling 23 scala sources , 180 java sources /users/myapp/target/scala-2.10/classes... [info] compiling 55 java sources /users/myapp/target/scala-2.10/test-classes... [success] total time: 112 s, completed 24 juin 2014 17:53:06

and that's it... no tests run. if seek run testonly, not found.

plus, if don't alter file, each time seek test app, source recompiled. not case play 2.2.

i don't have more logs show. when seek test activator ui have more logs no test run either.

if delete manually folders project/project, project/target , target, , run command activator test, next errors every test class:

[error] execution of test functional.actor.usereditinformationtest failed: java.lang.classnotfoundexception: functional.actor.usereditinformationtest [error] @ java.net.urlclassloader$1.run(urlclassloader.java:366) [error] @ java.net.urlclassloader$1.run(urlclassloader.java:355) [error] @ java.security.accesscontroller.doprivileged(native method) [error] @ java.net.urlclassloader.findclass(urlclassloader.java:354) [error] @ java.lang.classloader.loadclass(classloader.java:425) [error] @ sun.misc.launcher$appclassloader.loadclass(launcher.java:308) [error] @ java.lang.classloader.loadclass(classloader.java:358) [error] @ com.novocode.junit.junitrunner$1.execute(junitrunner.java:120) [error] @ sbt.forkmain$run$2.call(forkmain.java:294) [error] @ sbt.forkmain$run$2.call(forkmain.java:284) [error] @ java.util.concurrent.futuretask.run(futuretask.java:262) [error] @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) [error] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) [error] @ java.lang.thread.run(thread.java:744) [info] functional.actor.usereditinformationtest [info] ! functional.actor.usereditinformationtest [error] sbt.forkmain$forkerror: functional.actor.usereditinformationtest [error] @ java.net.urlclassloader$1.run(urlclassloader.java:366) [error] @ java.net.urlclassloader$1.run(urlclassloader.java:355) [error] @ java.security.accesscontroller.doprivileged(native method) [error] @ java.net.urlclassloader.findclass(urlclassloader.java:354) [error] @ java.lang.classloader.loadclass(classloader.java:425) [error] @ sun.misc.launcher$appclassloader.loadclass(launcher.java:308)

how can prepare issue?

edit build.sbt file :

name := "myapp" version := "1.0.0" scalaversion := "2.10.4" offline := true // play core dependencies librarydependencies ++= seq( javajdbc, javaebean, cache ) // specific dependencies librarydependencies ++= seq( ... ) lazy val root = (project in file(".")).enableplugins(playjava) jacoco.settings parallelexecution in jacoco.config := false fork in test := true javaoptions in test += "-dconfig.file=conf/application.test.conf" testoptions in jacoco.config += tests.setup( () => system.setproperty("config.file", "conf/application.test.conf") )

i experienced same problem upgrading application play 2.2.1 2.3.7. somehow seems eclipse interfering. personal solution quit eclipse, , quit activator console too. run

activator clean activator cleanfiles

then

activator test

or

activator testonly <package>.<testclass>

sometimes not work @ fist attempt. when activator finds (and runs) tests, works smoothly, , can 1 time again turn on activator console , eclipse.

i hope help...

update

every time write new test class, testonly not find it. need run first combination clean - cleanfiles create testonly find (no necessity turn off eclipse in case).

sbt playframework-2.3

No comments:

Post a Comment