CosetteN - 10 months ago 114
Java Question

# Jenkins Windows Node returning CreateProcess error=193

I'm attempting to set up a Windows node for Jenkins (master is running on Mac/ElCapitan) to run Codeception acceptance tests.

The jenkins jnlp file seems to be running appropriately, Jenkins has created its directories on the Windows node. I'm asking it to run a test via an ant build in Firefox only. This is a successful test running on the master/Apple machine.

I can type "codecept" into the command prompt on the Windows Node in any directory and get the default help message.

I can run the test by going into the Jenkins created folders on the Windows Node machine via the command prompt with codecept run tests/acceptance/all/test.

When trying to do this through Jenkins from the master machine I get the following error:

C:\jenkins\workspace\nodeTest\browser\firefox\label\Windows10\build.xml:147: Execute failed: java.io.IOException: Cannot run program "C:\jenkins\workspace\nodeTest\browser\firefox\label\Windows10\vendor\bin\codecept" (in directory "C:\jenkins\workspace\nodeTest\browser\firefox\label\Windows10"): CreateProcess error=193, %1 is not a valid Win32 application


The ant file:

<property environment="env"/>

<property name="codecept" value="${basedir}/vendor/bin/codecept"/> <target name="InvalidLogin" depends="CleanPics, InvalidLoginRun" /> <target name="CleanPics" description="clean out directories from previous run."> <delete dir="${basedir}/tests/_output" />
<mkdir dir="${basedir}/tests/_output" /> <mkdir dir="${basedir}/tests/_output/debug" />


<target name="InvalidLoginRun" description="confirm invalid credentials don't allow login">
<exec executable="${codecept}" failonerror="true"> <arg value="run" /> <arg value="--debug" /> <arg value="tests/acceptance/all/00loginsInvalidCest.php" /> <arg value="--xml" /> <arg value="--env" /> <arg value="${browser}" />
</exec>


Googling has led me to answers that I should be using a ShellExecute instead of a CreateProcess command but I can't figure out how to configure the Ant file to do this. Any ideas?

vendor/bin/codecept file is for Linux and other kinds of unix-like operating systems.
Use vendor/bin/codecept.bat on Windows.