So I solved it using a workaround (pretty much as you suggested). What I 
did was:

   - launch the TestNG using SCHTASK
   - Redirect all output to a file, console.log
   - Scan that log file for some text that signals the end of the test.

Below is the code I used in the Build Step. Maybe it will be of use for 
someone else.
echo @echo off > test.cmd
echo cd %CD% >> test.cmd
echo java -cp test.jar org.testng.TestNG testng.xml ^> console.log 2^>^&1 
>> test.cmd

schtasks /create /tn test /tr %CD%\test.cmd /sc once /st 00:00 /sd 
2022-01-01
schtasks /run /tn test

echo @echo off > check.cmd
echo :ret1 >> check.cmd
echo   ping 1.1.1.1 -n 1 -w 3000 ^> nul >> check.cmd
echo   findstr /r /c:"Total tests run: [0-9]*," console.log >> check.cmd
echo   goto ret%%ERRORLEVEL%% >> check.cmd
echo :ret0 >> check.cmd
echo   echo Done. >> check.cmd

check.cmd

/Kristian

Reply via email to