Continuous Integration

cancel
Showing results for 
Search instead for 
Did you mean: 

Using TestStand and Jenkins

I wrote a guide here to help with setting up a build machine for use with TestStand. There are also some related examples linked at the bottom that will be helpful. A few other things worth noting:

  • If you plan on managing multiple TestStand versions on the same machine: 
    Since environment variables are inherited when a process starts, a bat file that runs version selector will return the same value for %TestStand% before and after running version selector, even though the value has changed. Because of this, it's a better idea to define your own variables for TestStand directories to use in your scripts.
  • You can get the active version from the registry:
    (64-bit TS:) Reg query HKEY_CLASSES_ROOT\CLSID\{B2794EF6-C0B6-11D0-939C-0020AF68E893}\InprocServer32
    (32-bit TS:) Reg query HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{B2794EF6-C0B6-11D0-939C-0020AF68E893}\InprocServer32
  • You may encounter CAR 650867 in versions before TestStand 2017. This causes BuildTSD to incorrectly return Error 2 in certain cases and report warning 19200 in the log file, even though the build was successful. To work around this, catch and ignore Error 2, and instead rely on the TSDU Detailed Status log for build status.

If you have any questions about the guide, feel free to post them here.

~Trent

 

https://www.linkedin.com/in/trentweaver
Message 1 of 8
(6,968 Views)

Hi WireWeaver, 

I really like your guide. I was looking for something similar for ages... 

I tried to implement it on my machine and I stack with transforming report (ATML) to jUnit format. I would like to add some more information to the report, like measured data, limits, comments, etc. but no luck... I'm new in XSL transformations and jUnit is not very well documented...

0 Kudos
Message 2 of 8
(6,276 Views)

Thanks!

Yeah... I already did most of the parts that were easy to implement. Here are the references i used:

W3Schools for all things XSLT: https://www.w3schools.com/xml/xsl_transformation.asp

This document was really helpful for JUnit: http://llg.cubic.org/docs/junit/

 

The issue with things like measured data & limits is that those concepts don't really exist in the JUnit format (at least that i'm aware of). You can put them somewhere like stdout, but then it's difficult to display in a nice way. I abandoned my effort to solve that problem when i heard about the development of this, which has less limitations than the stylesheet approach i was taking.

 

-Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 3 of 8
(6,265 Views)

Hi sir,

 

I have configured the Jenkins server on test machine,

All the user popup setting disabled from Teststand.

Polling SVN for changes in test framework.

He doing poll and doing checkout on any changes perfectly.

On changes I have called the batch file to invoke Teststand.

I used sequence editor as command line interface for Teststand.

when I run batch file manually teststand is getting open test start.

But when I call that bat file from Jenkins it is not getting open.

Could  you help me to take this ahead?

 

batch file matter is here:

 

"C:\Program Files (x86)\National Instruments\TestStand 2014\Bin\seqedit.exe" "C:\Program Files (x86)\Jenkins\workspace\Build for test framework/S7_PVED_CC_APP_.tsw" /runEntryPoint "Single Pass" "C:\Program Files (x86)\Jenkins\workspace\Build for test framework\S7_PVED_CC_APP_Testbench.seq"

 

 

 

 

0 Kudos
Message 4 of 8
(6,112 Views)

Hi Yeshwanth,

 

why do you need to call the .tsw file in the command?

I use this format of the command and it works:

 

"<Sequence editor path"  /runentrypoint "single Pass" "<sequence file path>"

 

Also I would recommend using a relative path for the sequence file rather than hardcoding it in the batch command. The workspace path in Jenkins can be obtained by the Jenkins environment variable "WORKSPACE". You can then build the path to your sequence file relative to the workspace directory.

Thanks and Regards,
Supreeth.K

Message 5 of 8
(6,086 Views)

Hi Supreeth,

 

Thank you for your valuable reply !

I am calling batch file and path is hard coded agreed,

could you please tell me how to call batch file by using relative path.

 

where shall i append "WORKSPACE" ?

 

0 Kudos
Message 6 of 8
(6,067 Views)

I have also tried with the jast open teststand instance by calling sequence editor.

But it is not getting open

Regards,

Yeshwant

0 Kudos
Message 7 of 8
(6,065 Views)

@WireWeaver wrote:

I wrote a guide here to help with setting up a build machine for use with TestStand. There are also some related examples linked at the bottom that will be helpful. A few other things worth noting:

  • If you plan on managing multiple TestStand versions on the same machine: 
    Since environment variables are inherited when a process starts, a bat file that runs version selector will return the same value for %TestStand% before and after running version selector, even though the value has changed. Because of this, it's a better idea to define your own variables for TestStand directories to use in your scripts.
  • You can get the active version from the registry:
    (64-bit TS:) Reg query HKEY_CLASSES_ROOT\CLSID\{B2794EF6-C0B6-11D0-939C-0020AF68E893}\InprocServer32
    (32-bit TS:) Reg query HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{B2794EF6-C0B6-11D0-939C-0020AF68E893}\InprocServer32
  • You may encounter CAR 650867 in versions before TestStand 2017. This causes BuildTSD to incorrectly return Error 2 in certain cases and report warning 19200 in the log file, even though the build was successful. To work around this, catch and ignore Error 2, and instead rely on the TSDU Detailed Status log for build status.

If you have any questions about the guide, feel free to post them here.

~Trent

 


Hi Trent.


Thanks for your guide.

It would be great if you could extend it a bit on how to interface with TestStand from the command line, or show how you configured the pipeline in the video running in the tutorial.

If you have time, I have a couple of questions here:

TestStand command line options

 

Thanks.

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 8 of 8
(5,157 Views)