searls / jasmine-maven-plugin

Maven plugin to execute Jasmine Specs. Creates your HTML runners for you, runs headlessly, outputs JUnit XML
http://searls.github.io/jasmine-maven-plugin
Other
290 stars 163 forks source link

Spec paths are not generated correctly when JavaScript test source is in C:\Program Files (x86) #170

Closed sieverssj closed 11 years ago

sieverssj commented 11 years ago

I have a Jenkins server on a Windows 7 64-bit machine that is building the OpenSocial Explorer project using maven. The Jenkins installer for Windows placed JENKINS_HOME at C:\Program Files (x86)\Jenkins, which in turn means that the OpenSocial Explorer's workspace is at C:\Program Files (x86)\Jenkins\jobs\OpenSocial Explorer\workspace. This is causing issues with the generation of specs. They are being generated with absolute URLs instead of relative URLs.

For instance, if I run "mvn jasmine:bdd" and go to the resulting page, I see this in the page source:

var specs = ['file:/c:/Program%20Files%20(x86)/Jenkins/jobs/OpenSocial%20Explorer/workspace/opensocial-explorer-webcontent/src/test/javascript/DropDownMenuTest.js', 'file:/c:/Program%20Files%20(x86)/Jenkins/jobs/OpenSocial%20Explorer/workspace/opensocial-explorer-webcontent/src/test/javascript/LoadingTest.js', 'file:/c:/Program%20Files%20(x86)/Jenkins/jobs/OpenSocial%20Explorer/workspace/opensocial-explorer-webcontent/src/test/javascript/ModalDialogTest.js', 'file:/c:/Program%20Files%20(x86)/Jenkins/jobs/OpenSocial%20Explorer/workspace/opensocial-explorer-webcontent/src/test/javascript/editorarea/EditorAreaTest.js', 'file:/c:/Program%20Files%20(x86)/Jenkins/jobs/OpenSocial%20Explorer/workspace/opensocial-explorer-webcontent/src/test/javascript/gadgetarea/GadgetAreaTest.js'];

What I expect to see (and what I see on a working system) are relative paths like this:

var specs = ['spec/javascript/DropDownMenuTest.js', 'spec/javascript/LoadingTest.js', 'spec/javascript/ModalDialogTest.js', 'spec/javascript/editorarea/EditorAreaTest.js', 'spec/javascript/editorarea/EditorToolbarTest.js', 'spec/javascript/gadgetarea/GadgetAreaTest.js'];

On the system that is encountering the error, I can reproduce the error by running maven from the command line in the Jenkins workspace folder. I can also move the workspace folder for the Jenkins job to the "C:\" directory and running "mvn jasmine:bdd" works. Therefore, there seems to be an issue with the path. If I set a custom workspace path in Jenkins such that the build workspace is at "C:.jenkins\jobs\OpenSocial Explorer\workspace", the builds will complete normally.

klieber commented 11 years ago

Which version of the plugin are you using?

sieverssj commented 11 years ago

We're using 1.3.1.0, which I believe is the latest.

klieber commented 11 years ago

OK, thanks. I'll look into it.