nikseras / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

IDEA-Plugin: Runing test files directly causes java.lang.RuntimeException an Mac OS X #255

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a simple JavaScript project with ./jsTestDriver.conf, 
./src/greeter.js, ./src-test/greeter_test.js.
2. Select greeter_test.js in project navigator and run it (context menu, Run 
"greeter_test.js"

What is the expected output? What do you see instead?
I would love to let the JsTestDriver Plugin run the tests in greeter_test.js, 
but a java.lang.RuntimeException is thrown. See StackTrace below.

What version of the product are you using? On what operating system?
Mac OS X 10.6.8, Java 1.6.0_26, IntelliJ IDEA 10.5.1, JsTestDriver Plugin 1.3.5

Please provide any additional information below.

StackTrace:

Testing started at 09:15 ...

java.lang.RuntimeException: Failed to read settings file 
/var/folders/wH/wHKOnUtsH9CY-RCU71mTK++++TI/-Tmp-/generated-greeter_test-js32522
42647405605603.jstd
    at com.google.jstestdriver.idea.TestRunner.resolveConfiguration(TestRunner.java:145)
    at com.google.jstestdriver.idea.TestRunner.makeActionBuilder(TestRunner.java:121)
    at com.google.jstestdriver.idea.TestRunner.execute(TestRunner.java:104)
    at com.google.jstestdriver.idea.TestRunner.execute(TestRunner.java:79)
    at com.google.jstestdriver.idea.TestRunner.main(TestRunner.java:192)
Caused by: java.lang.IllegalArgumentException: The patterns/paths 
/private/Users/ssc/Code/Sandkasten-JavaScript/jstd-helloworld/src 
(/private/Users/ssc/Code/Sandkasten-JavaScript/jstd-helloworld/src)  used in 
the configuration file didn't match any file, the files patterns/paths need to 
be relative /private/Users/ssc/Code/Sandkasten-JavaScript/jstd-helloworld
    at com.google.jstestdriver.PathResolver.expandGlob(PathResolver.java:144)
    at com.google.jstestdriver.PathResolver.resolve(PathResolver.java:101)
    at com.google.jstestdriver.config.ParsedConfiguration.resolvePaths(ParsedConfiguration.java:84)
    at com.google.jstestdriver.idea.TestRunner.resolveConfiguration(TestRunner.java:143)
    ... 4 more

Empty test suite.

Sample Project enclosed.

Original issue reported on code.google.com by stefan.s...@googlemail.com on 20 Jul 2011 at 7:30

Attachments:

GoogleCodeExporter commented 8 years ago
Here's the content of the generated jsTestDriver.conf:

# Generated by IDEA
basepath: ../../../../../Users/ssc/Code/Sandkasten-JavaScript/jstd-helloworld

load:
  - src/greeter.js
  - src-test/greeter_test.js

It's generated in /private/var/folders/wH/wHKOnUtsH9CY-RCU71mTK++++TI/-Tmp-, 
and going "up" five times ends up in "/private", not "/".

Original comment by stefan.s...@googlemail.com on 20 Jul 2011 at 7:49

GoogleCodeExporter commented 8 years ago
@stepan: thank you for the feedback!
Is /var directory a symlink to /private/var directory on your Mac?

When you run test javascript file (greeter_test.js from the above example) 
first time via context menu (or Ctrl+Shift+F10 shortcut), temporary Run 
Configuration is created and configured with default parameters.
One of such parameters is JsTestDriver configuration file location.
Current version of the plugin do not make attempt to find already existent 
suitable JsTestDriver configuration file (jsTestDriver.conf from the above 
example).  Temporary created Run Configuration is configured with automatically 
generated JsTestDriver configuration file, stored in a temporary dir.

To use 'jsTestDriver.conf' as a JsTestDriver Configuration file you can create 
New JsTestDriver Run Configuration and select 'jsTestDriver.conf' as a 
'Configuration file'.
Or you can edit already existent Run Configuration that is configured to use 
generated JsTestDriver Configuration file, change 'JsTestDriver Configuration 
File' from 'Generated' to 'Custom' and select jsTestDriver.conf as a 
'Configuration file'.

Original comment by Sergey.S...@gmail.com on 23 Jul 2011 at 8:44

GoogleCodeExporter commented 8 years ago
Hello Sergey,

yes, /var is a symlink to private/var:

$ cd /
$ dir var
lrwxr-xr-x@ 1 root  wheel  11 24 Jul 07:07 var -> private/var

I know that I can explicitly create a JsTestDriver run configuration.
It would just be great if one could simply do a ctrl+shift+R on an JS file, 
too...

Kind Regards
Stefan

Original comment by stefan.s...@googlemail.com on 26 Jul 2011 at 7:27

GoogleCodeExporter commented 8 years ago

Original comment by Sergey.S...@gmail.com on 20 Sep 2011 at 2:52

GoogleCodeExporter commented 8 years ago
Fixed version of the plugin is 1.3.6.

Original comment by Sergey.S...@gmail.com on 28 Sep 2011 at 4:39