cancel
Showing results for 
Search instead for 
Did you mean: 

Running Report Generator on a Jenkins slave

SOLVED
Contributor

Running Report Generator on a Jenkins slave

I am trying to launch SmartBear Report Generator to be able to generate a report when TestExecute hangs on any of our Jenkins slaves, which happens intermittently. I have been told by support to run the command line below before the test starts.

 

"C:\Program Files (x86)\SmartBear\TestExecute 14\Bin\ReportGenerator.exe" --desktop SE.SBO.WorkStation --generate-report C:\temp\DebugTrace --storage-directory C:\temp\DebugTrace

 

I have added an "Execute Windows batch command" build step before the "TestComplete Test" build step in one of our Jenkins jobs but my build hangs when trying to execute that new build step and the Report Generator process does not start. It seems to be some kind of permission issue. If I login to the slave via Remote Desktop Connection it is possible to launch the Report Generator using the same command.

 

Any ideas how to solve this?    

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Contributor

Re: Running Report Generator on a Jenkins slave

The support engineer reproduced the problem with launching Report Generator using an "Execute Windows batch command" build step. The problem is that is creates a "headless session". When the TestComplete plugin creates a session for the test, it is another session, i.e. the Report Generator and TestComplete are launched in different sessions. 

We successfully used a different approach to make the Report Generator and TestComplete run in the same session. We added script to our TestComplete project (see below) to execute Report Generator as the very first step. 

 

We added the following to our Python scripts: 

 

cmd = '\"C:\\Program Files (x86)\\SmartBear\\TestExecute 14\\x64\\Bin\\ReportGenerator.exe\" --desktop SE.SBO.WorkStation.exe --generate-report C:\\dev --storage-directory C:\\dev'
shell = Sys.OleObject['WScript.Shell']
shell.Run(cmd, 1, False)

This works well for us.

View solution in original post

8 REPLIES 8
Highlighted
Community Hero

Re: Running Report Generator on a Jenkins slave

Hi,

 

Just a wild guess - do you have an active user desktop session on the Jenkins slave when Jenkins tries to start Report Generator?

 

P.S. Why not to continue to work with Support and ask they as well?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Highlighted
Contributor

Re: Running Report Generator on a Jenkins slave

The result is the same whether I am logged-in to the slave via Remote Desktop Connection or not during the build.

 

I am still working on this with support but it is taking a lot of time. Usually I can get quicker response here. 

Highlighted
Community Hero

Re: Running Report Generator on a Jenkins slave

Hi,

 

Sorry, but no other good ideas at the moment... Smiley Sad

Another reincarnation of my question, just to be on the safe side:

Is Jenkins slave that starts Report Generator runs as an application but not as a service (which is the default)?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Highlighted
Contributor

Re: Running Report Generator on a Jenkins slave

Not sure what you mean. We have a Jenkins service and a TestComplete service running but I suppose the TestComplete service is not involved until the TestComplete Test build step starts.

 

If I replace the suggested command line with "C:\Windows\notepad.exe", Notepad will launch. That makes me think this is some kind of permission issue.

Highlighted
Community Hero

Re: Running Report Generator on a Jenkins slave

@malj :

Hi,

 

Not sure what you mean.

Ah, I probably used wrong names.

When Jenkins server sends commands to the slave, it (server) communicates with the Jenkins Agent running on this slave. Agent can be started either as a Windows service (which is the default) or as a regular Windows application. The latter option is required in order for TestComplete to be started in the active user session.

I thought that it may be required to have Report Generator to run in the active user session as well.

However, considering the fact that Notepad starts fine and starts in the user session, your setup for the Jenkins slave seems to be correct...

 

P.S. One more idea :

> command line [...]

> [...] an "Execute Windows batch command" build step

I guess that this build step starts command-line processor (cmd.exe) and passes parameter (command line) to it.

If this is the case, then, for complex command lines that contain not only the name of the executable to launch but also a set of parameters, the whole command line must be included in doubled quotes in order to be passed as a whole to command-line processor.

Something like this:

"""C:\Program Files (x86)\SmartBear\TestExecute 14\Bin\ReportGenerator.exe" --desktop SE.SBO.WorkStation --generate-report C:\temp\DebugTrace --storage-directory C:\temp\DebugTrace""

Does this help?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Highlighted
Contributor

Re: Running Report Generator on a Jenkins slave

That gives the same result. The console shows the full command line and hangs there without any errors reported. I tried also other variants of double-quoting (around it all and around the executable path) and in those cases I do get error messages. So, I guess Jenkins finds the Report Generator executable but for some reason it hangs trying to execute it.

 

I have now simplified things by omitting the parameters (exe path only, with three leading and trailing ") and it hangs as well wih no errors reported (as expected).    

Highlighted
Contributor

Re: Running Report Generator on a Jenkins slave

The support engineer reproduced the problem with launching Report Generator using an "Execute Windows batch command" build step. The problem is that is creates a "headless session". When the TestComplete plugin creates a session for the test, it is another session, i.e. the Report Generator and TestComplete are launched in different sessions. 

We successfully used a different approach to make the Report Generator and TestComplete run in the same session. We added script to our TestComplete project (see below) to execute Report Generator as the very first step. 

 

We added the following to our Python scripts: 

 

cmd = '\"C:\\Program Files (x86)\\SmartBear\\TestExecute 14\\x64\\Bin\\ReportGenerator.exe\" --desktop SE.SBO.WorkStation.exe --generate-report C:\\dev --storage-directory C:\\dev'
shell = Sys.OleObject['WScript.Shell']
shell.Run(cmd, 1, False)

This works well for us.

View solution in original post

Highlighted
Community Manager

Re: Running Report Generator on a Jenkins slave

Great news! Thank you for sharingSmiley Happy



Sonya Mihaljova
Community and Education Specialist

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!