Karma failing during Maven execution

1,184 views
Skip to first unread message

Ruben Fragoso

unread,
Sep 23, 2013, 11:23:35 AM9/23/13
to karma...@googlegroups.com
Hello everyone

i am having some problems trying to execute the karma tests using maven plugin

when i try to execute the i get this information

[INFO] --- maven-karma-plugin:1.3:start (default-cli) @ infor.motion.ims.imam_2.0 ---
cmd /C karma start E:\Work\projects\Motion\source\infor.motion.ims.imam_2.0\src\test\resources\karma.conf.js --single-run
WARN [reporter]: Can not load "junit", it is not registered!
  Perhaps you are missing some plugin?
WARN [karma]: Port 9876 in use
INFO [karma]: Karma v0.10.2 server started at http://localhost:9877/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.2 (Windows 7)]: Connected on socket 7mj_3NYr62_jyOOIXncT
PhantomJS 1.9.2 (Windows 7): Executed 0 of 0 ERROR (0.207 secs / 0 secs)
PhantomJS 1.9.2 (Windows 7): Executed 0 of 0 ERROR (0.207 secs / 0 secs)

but the build fails


[ERROR] Failed to execute goal com.kelveden:maven-karma-plugin:1.3:start (default-cli) on project infor.motion.ims.imam_2.0: There were Karma test failures. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.kelveden:maven-karma-plugin:1.3:start (default-cli) on project infor.motion.ims.imam_2.0: There were Karma test failures.

really no idea of why this happens. any ideas? Thank you in advance hope to hear from you.

Regards

Ruben Fragoso

unread,
Sep 23, 2013, 11:39:29 AM9/23/13
to karma...@googlegroups.com
btw reading the the Junit xml i get this

<testsuite name="PhantomJS 1.9.2 (Windows 7)" package="unit" timestamp="2013-09-23T15:38:49" id="0" hostname="WHITEMERO" tests="0" errors="1" failures="0" time="0">

still no clue

Vojta Jína

unread,
Sep 23, 2013, 4:18:06 PM9/23/13
to karma...@googlegroups.com
Ruben, can you try it with Chrome and go to the browser and check out the web inspector/console, is there any error ?

V.


--
You received this message because you are subscribed to the Google Groups "karma-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to karma-users...@googlegroups.com.
To post to this group, send email to karma...@googlegroups.com.
Visit this group at http://groups.google.com/group/karma-users.
For more options, visit https://groups.google.com/groups/opt_out.

Ruben Fragoso

unread,
Sep 24, 2013, 3:22:19 AM9/24/13
to karma...@googlegroups.com
the execution is too fast, the browser just opens ans closes, is there a way to keep the browser open after tests?

Ruben Fragoso

unread,
Sep 24, 2013, 4:58:58 AM9/24/13
to karma...@googlegroups.com
i started manually Karma and i get this error

WARN [web-server]: 404: /absoluteE:/Work/projects/myProject/src/main/webapp/resources/lib/jquery/jquery-1.10.2.min.map

after i add a line in the config this line

'../main/webapp/resources/lib/jquery/*.map',

i know have this error

Chrome 29.0.1547 (Windows 7) ERROR
        Uncaught SyntaxError: Unexpected token :
        at E:/Work/projects/myProject/src/main/webapp/resources/lib/jquery/jquery-1.10.2.min.map:1

this is a json file, and after i run the json validator, it reports that the json is valid. any idea how to fix this? Thank you in advance.

Regards

amolp1709

unread,
Sep 25, 2013, 5:39:59 AM9/25/13
to karma...@googlegroups.com

Vojta Jína

unread,
Sep 26, 2013, 4:17:59 AM9/26/13
to karma...@googlegroups.com
Ruben,

try to not include the "map":
files: [
  {pattern: '../main/webapp/resources/lib/jquery/*.map', included: false}
]

Your error is because by default Karma includes all the files as <script src="..."> and this is JSON file, you don't wanna include it. It only has to be served, so that the browser can fetch it on its own.

I guess we should make *.map files to not be included by default.

V.

Vojta Jína

unread,
Sep 26, 2013, 4:19:10 AM9/26/13
to karma...@googlegroups.com

Vojta Jína

unread,
Oct 4, 2013, 2:28:54 AM10/4/13
to Ruben Fragoso, karma...@googlegroups.com
Just noticed the path is incorrect (/absoluteE:/Work/projects/
myProject/src/main/webapp/resources/lib/jquery/jquery-1.10.2.min.map), which looks like a bug, incorrect absolute paths on windows:

Can you try to move this file under your basePath ?

V.


On Fri, Sep 27, 2013 at 1:33 PM, Ruben Fragoso <fragos...@gmail.com> wrote:

Thank you Vojta for you reply

the think is that if i dont include i get the message

WARN [web-server]: 404: /absoluteE:/Work/projects/
myProject/src/main/webapp/resources/lib/jquery/jquery-1.10.2.min.map

and the build fails, although not sure if this is the cause.


Hope to hear from you.

Regards
Reply all
Reply to author
Forward
0 new messages