Tips to update from 1.2.2 to latest?

106 views
Skip to first unread message

Ivo

unread,
Apr 2, 2011, 1:01:26 PM4/2/11
to JsTestDriver
I am using a setup that uses JsTestDriver 1.2.2 and it has been
working well. I have not upgraded to the latest since runnning the
tests fails with errors related to the configuration.

I think it has to do with using relative paths. I was able to get past
some of the files not getting found by using the 'basepath'
configuration but I still get errors about undefined objects as if
some of the files were not getting loaded. Not sure what to do about
this. If I remove the basepath, prepend it to the file paths and use
1.2.2 everything works as expected.

I want to update to take advantage of the latest fixes but cannot tell
what do I have to change in the config. Is there something I am
missing?

Cory Smith

unread,
Apr 2, 2011, 1:05:46 PM4/2/11
to js-test...@googlegroups.com, Ivo
Update to 1.3.3. The error messaging for unreadable files has improved
drastically.

If you still have trouble, please include information about file
placement, directory structure, and configuration file. It's really
hard to make suggestions without those. Other than: keep at it, some
day your tests will run.

-c

> --
> You received this message because you are subscribed to the Google Groups "JsTestDriver" group.
> To post to this group, send email to js-test...@googlegroups.com.
> To unsubscribe from this group, send email to js-test-drive...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/js-test-driver?hl=en.
>
>

Ivo

unread,
Apr 2, 2011, 2:08:24 PM4/2/11
to JsTestDriver
Hi Cory,

Thanks for the reply. Want to say how incredibly useful JsTestDriver
is and your work supporting it is appreciated. Let me know how I can
contribute (time or donation). It has saved me countless hours of
designing/debugging and helps me turn out great products.

I am on OSX 10.6. The working project (1.2.2) has the following layout
& config:

//application sources
src/application/app/lib/*.js
src/application/app/model/*.js

//testing related files
src/application/jsTestDriver/JasmineAdapter.js
src/application/jsTestDriver/jsTestDriver.yml
src/application/jsTestDriver/EnvMocks.js
src/application/plugins/jasmine.js

//test sources
src/application/spec/lib/*-spec.js
src/application/spec/model/*-spec.js

--- content of jsTestDriver.yml
server: http://localhost:4224
load:
- "../plugins/jasmine.js"
- "JasmineAdapter.js"
- "EnvMocks.js"

# libraries
- "../app/lib/*"
- "../app/models/*"

# tests
- "../spec/app/lib/*"
- "../spec/app/models/*"

-- run with the following commands works and all tests pass:

java -jar $JSTESTDRIVER_HOME/JsTestDriver-1.2.2.jar --port 4224
java -jar $JSTESTDRIVER_HOME/JsTestDriver-1.2.2.jar --config
jsTestDriver.yml --tests all --reset



=== Update to 1.3.2

A direct update by running
java -jar $JSTESTDRIVER_HOME/JsTestDriver-1.3.2.jar --port 4224
java -jar $JSTESTDRIVER_HOME/JsTestDriver-1.3.2.jar --config
jsTestDriver.yml --tests all --reset

Total 0 tests (Passed: 0; Fails: 0; Errors: 0) (0.00 ms)
Firefox 3.6.16 Mac OS: Run 20 tests (Passed: 0; Fails: 0; Errors 20)
(0.00 ms)
error loading file: /test/../plugins/jasmine.js:1: Error loading
script
error loading file: /test/JasmineAdapter.js:1: Error loading
script
error loading file: /test/EnvMocks.js:93: jasmine is not defined
error loading file: /test/../app/lib/library1.js:1: Error loading
script
error loading file: /test/../app/lib/library2.js:1: Error loading
script
error loading file: /test/../app/models/model1.js:1: Error loading
script
error loading file: /test/../spec/app/lib/library1-spec.js:1:
Error loading script
error loading file: /test/../spec/app/lib/library2-spec.js:1:
Error loading script
error loading file: /test/../spec/app/models/model1-spec.js:1:
Error loading script
Tests failed: Tests failed. See log for details.

== Modified the config to use basepath=".." and fixed up paths

Firefox: Runner reset.

Total 0 tests (Passed: 0; Fails: 0; Errors: 0) (0.00 ms)
Firefox 3.6.16 Mac OS: Run 3 tests (Passed: 0; Fails: 0; Errors 3)
(0.00 ms)
error loading file: /test/spec/app/lib/library1-spec.js:7:
EnvStatus is not defined
error loading file: /test/spec/app/lib/library2-spec.js:7:
EnvStatus is not defined
error loading file: /test/spec/app/models/model1-spec.js:1856:
jasmine.Suite() required
Tests failed: Tests failed. See log for details.

== Note: the EnvStatus object is defined in the EnvMocks.js file

Thanks,

- Ivo

Cory Smith

unread,
Apr 3, 2011, 2:37:47 PM4/3/11
to js-test...@googlegroups.com, Ivo
Crap. Could you file the issue and drop back to 1.3.1?
The bug is that '..' used as a basepath isn't resolved into an actual directory.

What it really means is that I used getAbsolutePath instead of
getCanonicalPath. Bugger. 1.3.3 will be out shortly, with a fix.

-c

Cory Smith

unread,
Apr 3, 2011, 5:04:57 PM4/3/11
to js-test...@googlegroups.com
Huh. Seems I was wrong on my first thought (the fix I'm thinking of
will solve the first migration issue w/out basepath).

The second confuses me though. What does the path for EnvMocks.js with
the basepath as ".." look like?

On Sat, Apr 2, 2011 at 2:08 PM, Ivo <iplet...@gmail.com> wrote:

Ivo

unread,
Apr 4, 2011, 11:00:14 AM4/4/11
to JsTestDriver
I am now using 1.3.1, updated the config to use basepath and the tests
are working as expected again. I'll file an issue with the details of
this thread.

The EnvMocks.js is sitting alongside the jsTestDriver.yml config file,
so full path is

/work/data/project-repo/trunk/src/application/jsTestDriver/EnvMocks.js

when using basepath set to '..' the config is

load:
- "plugins/jasmine.js"
- "jsTestDriver/JasmineAdapter.js"
- "jsTestDriver/EnvMocks.js"

# libraries
- "app/lib/*"
- "app/models/*"

# tests
- "spec/app/lib/*"
- "spec/app/models/*"

One thing I don't get is why the 'test' path segment is pre-pended to
the paths. I dont have that anywhere in the config or the filesystem.

Thomas Meyer

unread,
Apr 4, 2011, 12:55:59 PM4/4/11
to js-test...@googlegroups.com
I'm experiencing the same problem and filed it as issue 223 (including a reduced sample to reproduce).
I also see the "test" path prepended in the error-message as soon as I use relative paths. Hope that helps to find it..
Thanks a lot, Thomas.

Cory Smith

unread,
Apr 4, 2011, 1:38:27 PM4/4/11
to js-test...@googlegroups.com, Thomas Meyer
You will always see /test/ prepending, no matter what error message.
All resources associated with the test run are served off /test. All
static runner resources are served off /static

-c

Thomas Meyer

unread,
Apr 5, 2011, 8:50:39 AM4/5/11
to js-test...@googlegroups.com, Thomas Meyer
I see, now I understand better why relative paths might be an issue as you need to serve everything from some kind of root folder.
I tried setting the basepath attribute, but that didn't seem to work either. Thanks for your help and your work, Thomas.
Reply all
Reply to author
Forward
0 new messages