Ask a Question

Command line arguments in Jenkins plugin

Command line arguments in Jenkins plugin

We have just replaced our old home-grown Jenkins integration with the new 'official' SmartBear Jenkins-TestComplete integration. I find it very easy to work with and it has made our Jenkins integration more 'flashy' and easy to work with for people who are not working with the test system on a daily basis.

 

One feature of our old setup was not possible to reproduce in the new. We sometimes need to run the test on branches of the code (other than the master branch). In our SUT this can be specified in the URL and in the old integration we called TC/TE with a command line argument to specify the branch (if different from master). Unfortunately the new Jenkins integration does not allow for arguments. Adding a field in the UI where you can specify a command line parameter to TestComplete/TestExecute would be nice. This field of course has to allow for variables, so you can pass the information round.

 

This problem can of course be solved in other ways (e.g. dumping the information in a file or environment variable on the slave in Jenkins and read it in TC/TE), but we find our current implementation the most satisfactory. If someone has suggestions on how to implement an alternative, we will be glad to hear them.

 

Yours,

Søren Harder, QA engineer, Zmags

10 Comments
kixosvk
New Contributor

I am missing functionality to pass parameters from Jenkins to Testcomplete in command line.

MKozinets
Staff
Status changed to: New Idea
 
MKozinets
Staff
Status changed to: New Idea
 
MKozinets
Staff
Status changed to: New Idea
 
MKozinets
Staff
Status changed to: Accepted for Discussion
 
chrisb
Regular Contributor

 As a workaround you can create a parametrized build https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

 

sha
Contributor

'

Perhaps I should explain how we have worked around this issue in our current set-up.

In Jenkins we have a 'main' job that calls a row of other Jenkins jobs each of which are a wrapper for 1 TestExecute job. (This way we ensure that the jobs are distributed on the available servers). The main job is being run 1) as a SCM job, 2) timed and 3) through the Jenkins UI. And the subjobs may be run in the same ways.

 

Each of the subjobs use 'Inject environment variables to the build process' to set a EnvVar. (The value is set in the main job as a string parameter and passed down and is the same for all subjobs). Each of the TE tests include a call to a function that sets a variable in the program. This logic is so that it can either 1) be set 'manually' when starting TC/TE (as an extra parameter in the command line that starts TC/TE, specifically we have a bat-file that passes its argument on to its invokation of TC/TE) and 2) be read of an EnvVar set as described above, if the TE is started automatically.

 

The purpose of this parametrization is to run in different environments, which is being controlled in the URL of the SaaS.

 

This may sound complex, but it was relatively easy to set up (though I may not have claimed this just after implementing the solution), and has worked now without any problems whatsoever for over 1/2 year.

 

Søren Harder, QA/Test engineer, Zmags

georgereynolds
Occasional Contributor

I vote for this, please

ahmed_daniel
Occasional Contributor

I vote for this as well, it would be really helpful.

MKozinets
Staff
Status changed to: Implemented

We have implemented this feature in Jenkins plugin v1.5. Please check the new version and send us your comments:

 

https://wiki.jenkins-ci.org/display/JENKINS/TestComplete+Support+Plugin

Announcements
Welcome to the TestComplete Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Join us and watch the welcome video:
Announcements