Why is Teraterm not creating a logfile when launched via Jenkins batch-file in Windows?

347 Views Asked by At

I'm currently facing an issue on jenkins. In the Jenkins job, I launch a windows batch file which launch some tests. For these tests, I need to call Teraterm on the background which is basically a tool used to spy uart communications. After Teraterm call, I launch commands which generate uart communications on my setup.

cd /D "C:\Program Files (x86)\teraterm"
start TTERMPRO /C=3 /SPEED=921600 /L="Path\logs\uart.log"
Other commands to generate uart com

My probleme : Teraterm is launched but doesn't create the logfile. But if I launch the batch file on command prompt, the log file is created automatically a the exact same time the command is launched.

What I already tried :

  • start TTERMPRO /C=3 /SPEED=921600 > "Path\logs\uart.log" : Don't work even in command line : the file is created but remains empty. The previous command worked better on commandline as it printed logs in the log file
  • Launch the command directly in the jenkins job : same result
  • call teraterm via "start" and "call" commands : same result
  • call teraterm directly via no "start" or "call" : I cannot pass on the following batch commands so the job is blocked and never terminate

Has someone encountered the same issue ?

Thanks ! :)

1

There are 1 best solutions below

0
Solene On

I finally solved the issue. As Teraterm is a gui app, it cannot be launched by jenkins as a service. So, if you need to use Jenkins, it has to be permanently opened by a local agent : type java -jar jenkins.war on command prompt on your jenkins folder.

Be careful, this agent will be closed each time your PC reboot so if you're on a project requiring a permanent opened jenkins job, think about opening this agent after each PC reboot.