3
votes

I have a series of frontend tests written in CasperJS that I need to run in Jenkins. Here is command I run from the command line: casperjs test ./src/tests/**/ts_*.js --xunit=xunit.xml. This runs the tests and saves the xunit file. Ok. When I have Jenkins run the same command it gets through loading the first test page and spits out this error: "Process leaked file descriptors" and directs me to: https://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build

It provides an explanation and a few OS specific work arounds. The environment this will be run on will eventually be linux however my development environment is Windows and I don't understand the workaround they provide. What kind of file is that and how does it fit with Jenkins?

Does anyone have experience running CasperJS tests using Jenkins?

2
I run Casper JS tests locally on Windows and on Linux Jenkins. I might be able to help you, but I haven't seen the error you mention.Phil Mander
How do you envoke your casper tests in jenkins on Windows? I put casperjs test ./src/tests/**/ts_*.js --xunit=xunit.xml in to a bash file and had jenkins run that. That's when the test stops and outputs the error.Kylee
I'm currently using CasperJS 1.1 beta 2. Phantom is on my path, and I use Casper from a relative location, I have a batch file that looks like this: 'src/test/support/casperjs-1.1-beta2/batchbin/casperjs.bat test src/test/suites --xunit=target/reports/casper-results.xml' (its all in a Maven style directory structure)Phil Mander
I tried using the relative casperjs.bat rather than the global casperjs and getting same error. It partially runs the first test, loads the page, verifies the the page title then bails and gives me Process leaked file descriptors errorKylee
Sorry, no idea. Perhaps you can try some trial and error to see if there's something specific in your test that's falling or maybe try out different versions of Casper and PhantomPhil Mander

2 Answers

0
votes

I installed jenkins as a service and use default settings.

I solved same issue on windows.

if you are running as a service and default home directory ( c:/program files(x86)/jenkins/ ) you have to change path to other normal folder(ex.c:/jenkins/").

SET JENKINS_HOME=c:\jenkins\

0
votes

What I do with jenkins and casper:

I create a job with string parameter 'tests', which takes *.js or specified test and try to run casper tests via Build -> Execute shell

cd ~/test_directory
casperjs test ${tests}