You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing to pass along an issue I ran into yesterday. I've worked around it for my use case, but I'm betting someone else may discover it, and maybe in a different context.
I committed jasmine-maven-plugin and some spec files with a few tests in them to the main branch in a codebase I work on. This same branch has a Jenkins job that checks it out and runs it on new commits.
The Jenkins job failed due to Jasmine reporting ReferenceErrors on the tests. I scratched my head for a while as to why this could be. I tried going into the workspace directory and running mvn clean package to see if I could get the same error outside Jenkins. The errors didn't reproduce. I wondered why this could be.
I then copied the Maven command that Jenkins was using out of the Jenkins console output. This command had full paths in it. And the build failed. I celebrated because I'd reproduced the ReferenceErrors outside Jenkins, even if I hadn't solved them.
So I started changing a thing at a time until I got a success. And the change that made it work was me changing the pom file path from /var/lib/jenkins/[...]/pom.xml to /opt/jenkins/[...]/pom.xml I then noticed that on my system, /var/lib/jenkins was a symlink to opt/jenkins.
This to me says there is some code that doesn't cope well with symlinks in jasmine-maven-plugin, or PhantomJS, or the Maven plugin installing PhantomJS, or Maven itself, or a combination of these. I'm writing this in case someone wants to figure out where such code is.
To reproduce this, make a symlink to the Maven project directory where you're using jasmine-maven-plugin and then run mvn clean test -f SYMLINK_PATH/pom.xml where SYMLINK_PATH is the full non-relative path on your system to the symlinked project directory.
PS The ReferenceErrors looked like this and suggest the issue I was experiencing was due to something related to PhantomJS or Javascript or maybe even AngularJS, which it wasn't:
Hi there,
I'm writing to pass along an issue I ran into yesterday. I've worked around it for my use case, but I'm betting someone else may discover it, and maybe in a different context.
I committed jasmine-maven-plugin and some spec files with a few tests in them to the main branch in a codebase I work on. This same branch has a Jenkins job that checks it out and runs it on new commits.
The Jenkins job failed due to Jasmine reporting ReferenceErrors on the tests. I scratched my head for a while as to why this could be. I tried going into the workspace directory and running
mvn clean package
to see if I could get the same error outside Jenkins. The errors didn't reproduce. I wondered why this could be.I then copied the Maven command that Jenkins was using out of the Jenkins console output. This command had full paths in it. And the build failed. I celebrated because I'd reproduced the ReferenceErrors outside Jenkins, even if I hadn't solved them.
So I started changing a thing at a time until I got a success. And the change that made it work was me changing the pom file path from
/var/lib/jenkins/[...]/pom.xml
to/opt/jenkins/[...]/pom.xml
I then noticed that on my system,/var/lib/jenkins
was a symlink toopt/jenkins
.This to me says there is some code that doesn't cope well with symlinks in jasmine-maven-plugin, or PhantomJS, or the Maven plugin installing PhantomJS, or Maven itself, or a combination of these. I'm writing this in case someone wants to figure out where such code is.
To reproduce this, make a symlink to the Maven project directory where you're using jasmine-maven-plugin and then run
mvn clean test -f SYMLINK_PATH/pom.xml
where SYMLINK_PATH is the full non-relative path on your system to the symlinked project directory.PS The ReferenceErrors looked like this and suggest the issue I was experiencing was due to something related to PhantomJS or Javascript or maybe even AngularJS, which it wasn't:
The text was updated successfully, but these errors were encountered: