Can get Play 2.2 details when running JUnit testing with Play 2.3 - testing

I'm having issue with play framework and JUnit test with play 2.3
When running: "activator test" then it runs fine, but...
[info] Loading project definition from /.../test/toto/project
[info] Set current project to toto (in build file:/home/jenkins/.../)
[info] Compiling 6 Java sources to /home/jenkins/automated_tests/.../toto/target/scala-2.11/test-classes...
[warn] application - do execute tests in class utils.UtilsTest
[warn] application - do execute tests in class test_marketcity.BasicTest
[info] Passed: Total 14, Failed 0, Errors 0, Passed 14
[success] Total time: 29 s, completed Feb 12, 2015 9:48:51 AM
There's nothing about the test which have been run, only the full total of test (14 here). With play 2.2 I had a more detailled log containing also each test:
[info] x firstTest (x means here it failed)
[info] + secondTest (+ means here it succeeded)
Should I have to put a specific option here to get more details ?
Thx

It is a common issue with tests on activator. I usually run activator clean before tests to get the output. Sometimes running tests from sbt helps.

Related

Run PLay Framework 2.x in IntelliJ IDEA using SBT task auto stop server

I try to run Play project in IntelliJ IDEA. i follow this document.
this is my config. api is my sub project
But when I hit run icon, my service start successful and immediately AkkaHttpServer - Stopping server. then I type api/run in sbt shell, my service start successful and work normally. this issue only happen when I check User sbt shell in config
this is my log in sbt shell
"C:\Program Files\Java\jdk1.8.0_251\bin\java.exe" -server -Xmx1536M -Dsbt.supershell=false -Didea.managed=true -Dfile.encoding=UTF-8 -Dsbt.version=1.3.8 -Dsbt.log.noformat=true -jar C:\Users\LAP13556-local\AppData\Roaming\JetBrains\IntelliJIdea2020.1\plugins\Scala\launcher\sbt-launch.jar early(addPluginSbtFile=\"\"\"C:\Users\LAP13556-local\AppData\Local\Temp\idea979.sbt\"\"\") "; set ideaPort in Global := 51722 ; idea-shell"
[info] Loading global plugins from C:\Users\LAP13556-local\.sbt\1.0\plugins
[info] Loading settings for project crm-server-build from plugins.sbt,idea979.sbt ...
[info] Loading project definition from C:\Users\...\crm-server\project
[info] Loading settings for project crm-server from build.sbt ...
[info] Set current project to crm-server (in build file:/C:/Users/.../crm-server/)
[info] Defining Global / ideaPort
[info] The new value will be used by Compile / compile, Test / compile and 3 others.
[info] Run `last` for details.
[info] Reapplying settings...
[info] Set current project to crm-server (in build file:/C:/Users/.../crm-server/)
[IJ]sbt:crm-server> api/run
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Enter to stop and go back to the console...)
[info] p.c.s.AkkaHttpServer - Stopping server...
[success] Total time: 26 s, completed Jul 31, 2020 9:26:28 AM
[IJ]sbt:crm-server> api/run // I type this command
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Enter to stop and go back to the console...)
Can anyone tell me the reason. Thank you.

How to configure serenity report thread count?

By default Serenity report thread set to 80, during report generation it freezes the machine and I could not find anywhere to configure thread count , as can be seen from below written Test result report, Configured report threads:80, anyone knows how to change it?
Generating HTML Outcome Reports: false
[INFO] Generating test results for 70 tests
[INFO] 149 requirements loaded after 679 ms
[INFO] 149 related requirements found after 679 ms
[INFO] Generating test outcome reports: false
[INFO] Starting generating reports: 769 ms
[INFO] Configured report threads: 80
[INFO] Finished generating test results for 70 tests after 8886 ms
GENERATE CUSTOM REPORTS
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:32 min
[INFO] Finished at: 2017-05-13T00:24:30+01:00
[INFO] Final Memory: 52M/1305M
Regarding the default value you are seeing:
By default Serenity report thread set to 80 [...]
You are probably using a quad-core CPU with 8 virtual logical cores (SMT) because the default depends on the number of processors that are available to the Java virtual machine.
Serenity uses that number to initialize the size of the thread pool it uses during report generation.
Here is how to change it:
Create a serenity.properties file
Set the number of threads via the report.threads property
The serenity.properties file is looked up in multiple locations. I recommend that create one for each of your test modules.

How to analyze low-level OSGi problems during tycho test execution?

When executing JUnit test with tycho-surefire-plugin, tycho forks an equinox runtime.
In rare cases it may happen that some bundles in the OSGi test runtime cannot be resolved/started (e.g. package uses conflicts).
If you read the debug log (maven CLI option -X), you will find something like
!ENTRY org.eclipse.osgi 2 0 2012-10-08 16:41:31.635
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-10-08 16:41:31.635
An error has occurred. See the log file
C:\mytestproject.tests\target\work\configuration\1349705136008.log.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:03.181s
[INFO] Finished at: Mon Oct 08 16:17:16 CEST 2012
[INFO] Final Memory: 20M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.15.0:test (default-test) on project mytestproject.tests: An unexpected error occured (return c
ode 13). See log for details. -> [Help 1]
The eclipse console log does not provide enough information in case of package uses conflicts.
How can I analyze the bundles in the OSGi test runtime forked by tycho?
start tests in remote debug mode (simply specify -DdebugPort=8000 on the CLI) and start the OSGi console on a local port, e.g. 1234:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<systemProperties>
<osgi.console>1234</osgi.console>
</systemProperties>
</configuration>
</plugin>
Set a breakpoint in one of your test classes or in org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter if tests are not even started. Then,
telnet localhost 1234
and you can use the usual OSGi console commands like ss, diag, bundle etc. to analyze the problem "in vivo".
Alternatively you can run with -consolelog or set the eclipse.consoleLog property to true property. If you're running with Tycho, you can use <argLine>-Declipse.consoleLog=true</argLine>.

Error While Test The Project On Maven

i am using maven i don't have more knowledge about maven when i am install my project then it will successfully build but when i am test my project with maven it will give me an error like
Unable to copy an artifact to the working directory
i gave all permission to my project directory detail error as below so how can i resolve my
problem and how to run my project
so please help me
E
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 24 seconds
[INFO] Finished at: Thu Jan 27 17:44:59 IST 2011
[INFO] Final Memory: 35M/84M
[INFO] ------------------------------------------------------------------------
[INFO] Unable to copy an artifact to
the working directory Embedded error:
/home/nayan/workspace/ONiT/mediaPlayer/target/classes
(Is a directory) [INFO]
This looks like some of the previous tests are still running at this point and blocking maven from writing in the target directory.
As this seems to be an reactor build, do the modules themself build correctly ? I.e. can you run mvn test in each module directory seperately ?

Sonar default, meet "container state was: CONSTRUCTED"

Environment: hudson/sonar/maven2 in ubuntu locally with default parameters
And I got the log from hudson below, I can't figure out where is the problem.
[INFO] Sonar host: http://localhost:9000
[INFO] Sonar version: 2.0.1
[INFO] [sonar-core:internal {execution: default-internal}]
[INFO] Database dialect class org.sonar.api.database.dialect.Derby
[INFO] ------------- Analyzing Game of Life business logic module
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: Can not analyze the project
Cannot stop. Current container state was: CONSTRUCTED
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
And I notice it also has problem when run it command line without hudson
mvn sonar:sonar
I got this problem with .Net plugins for Sonar.
They needed all projects to be analyzed with JDK 6 (even non-.Net projects).
This error was raised when I tried to analyze projects with JDK 5.
Here is the URL of the .Net plugins : http://docs.codehaus.org/display/SONAR/.Net+plugin
The solution I got was to fork the compiler to use a JDK5 compiler on my projects which needed to be analyzed in JDK5 and not JDK6.
See on the .Net plugins page :
Maven and Sonar dotnet plugins need Java6 (at compile time and runtime)
What the sentence does not say is that all projects in your Sonar instance must use Java6.
A JIRA has been created : http://jira.codehaus.org/browse/SONARPLUGINS-1086 .
Got the hints from http://old.nabble.com/Another-%22Current-container-state-was%3A-CONSTRUCTED%22-problem-td28172925.html#a28194257
It seems the problem is inconsistency in maven plugins in my nexus repository, when I change to mirrors.ibiblio.org and clean the .m2 directory, everything goes fine.
BUT I don't know which plugins causes this problem and the log information is so wired, will be nice if some people points which plugin cause this problem and explain the reason for this error information