I have a build which calls the following:
PsExec.exe \192.168.1.200 -u 192.168.1.200\Administrator -p AdminPassword12345 -d "c:/Program Files/Eaglet Eye/Eye Surface Analyzer/EagletESA.exe"
PsExec with the '-d' option will return as its exit code the PID of the process it started. You can see an example of this below.
C:\Users\Eaglet-Autotest\quickbuild-4.0.61\workspace\root\Eye Service Profiler>PsExec.exe \192.168.1.200 -u 192.168.1.200\Administrator -p AdminPassword12345 -d "c:/Program Files/Eaglet Eye/Eye Surface Analyzer/EagletESA.exe"
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
c:/Program Files/Eaglet Eye/Eye Surface Analyzer/EagletESA.exe started on 192.168.1.200 with process ID 184.
C:\Users\Eaglet-Autotest\quickbuild-4.0.61\workspace\root\Eye Service Profiler>echo %ERRORLEVEL%
184
Of course this fails the build step, but I would like it to succeed unless certain patterns appear in the build output so I checked 'Detect Errors' and added the following lines under 'Begin Patterns' as these strings are common in the kind of actual failures that I'm looking for: (Please also note that 'Wait For Finish' under 'Advanced' is also checked)
.*PsExec could not start.*
.*Couldn't access.*
Unfortunately the build still fails even though those lines do not appear as you can see in the build log below:
21:27:27,970 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO - PsExec v1.98 - Execute processes remotely
21:27:27,970 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO - Copyright (C) 2001-2010 Mark Russinovich
21:27:27,970 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO - Sysinternals - www.sysinternals.com
21:27:27,970 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO -
21:28:13,544 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO - Connecting to 192.168.1.200...
21:28:13,544 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO - Starting PsExec service on 192.168.1.200...
21:28:13,544 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO - Connecting with PsExec service on 192.168.1.200...
21:28:13,544 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO - Starting c:/Program Files/Eaglet Eye/Eye Surface Analyzer/EagletESA.exe on 192.168.1.200...
21:28:13,544 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO - c:/Program Files/Eaglet Eye/Eye Surface Analyzer/EagletESA.exe started on 192.168.1.200 with process ID 788.
21:28:13,556 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] INFO - Executing post-execute action...
21:28:13,556 [master>Build Pipeline>Start Eaglet Eye@Eaglet-Autotest:8810] ERROR - Step 'master>Build Pipeline>Start Eaglet Eye' is failed.
com.pmease.quickbuild.QuickbuildException: Failed to run command: PsExec.exe \192.168.1.200 -u 192.168.1.200\Administrator -p AdminPassword12345 -d "c:/Program Files/Eaglet Eye/Eye Surface Analyzer/EagletESA.exe"
Command return code: 788
at com.pmease.quickbuild.execution.Commandline$ExecuteResult.buildException(Commandline.java:376)
at com.pmease.quickbuild.plugin.basis.CommandBuildStep.run(CommandBuildStep.java:255)
at com.pmease.quickbuild.plugin.basis.CommandBuildStep$$EnhancerByCGLIB$$d9dfab96.CGLIB$run$0(<generated>)
at com.pmease.quickbuild.plugin.basis.CommandBuildStep$$EnhancerByCGLIB$$d9dfab96$$FastClassByCGLIB$$a4842298.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:270)
at com.pmease.quickbuild.plugin.basis.CommandBuildStep$$EnhancerByCGLIB$$d9dfab96.run(<generated>)
at com.pmease.quickbuild.stepsupport.Step.execute(Step.java:478)
at com.pmease.quickbuild.stepsupport.StepExecutionJob.executeStepAwareJob(StepExecutionJob.java:29)
at com.pmease.quickbuild.stepsupport.StepAwareJob.executeBuildAwareJob(StepAwareJob.java:47)
at com.pmease.quickbuild.BuildAwareJob.execute(BuildAwareJob.java:61)
at com.pmease.quickbuild.grid.GridJob.run(GridJob.java:78)
at java.lang.Thread.run(Unknown Source)
What am I doing wrong?