NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand and GitLab for CI

How can I run TestStand when calling a powershell script from Gitlab? The powershell script works when running in Win10 as a standalone script but fails when running the same script from GitLab.

Here TestStand never terminates and it is running as background process in Win10.

 

Any ideas why??

 

Thanks

0 Kudos
Message 1 of 8
(2,384 Views)

Well, I have a little bit more experience. I am googling my way around all of this since a week now.

 

TestStand has been a pain... But, in general prompts are the cause.

 

To speed up the process try this:

In your gitlab runner installation folder (e.g. C:\GitLab-Runner), run powershell as admin:

 

gitlab-runner.exe stop

gitlab-runner.exe status

gitlab-runner.exe --debug run

 

The last line lets you see what's happening in real time on your screen (the runner screen). So retry the pipeline and see what's happening.

When you are done:

 

gitlab-runner.exe stop

gitlab-runner.exe status

gitlab-runner.exe start

gitlab-runner.exe status

 

0 Kudos
Message 2 of 8
(2,365 Views)

Hi

thanks for your reply... it's good to know there is a real time mode which gives more information about gitlab-runner. Now, when running it in the debug mode I see that TestStand opens in foreground and the sequence runs as expected and TestStand application terminates. Also I get an exitcode in GitLab....

 

So far so good.

 

Do you know what is the difference now between "normal" and "debugging" mode in terms of TestStand? Or how do I need to configure the gitlab-runner that the behavior is the same when not running in "deubg" mode?

 

Of course, I could leave it this way but I think it should run this way, correct?

0 Kudos
Message 3 of 8
(2,361 Views)

Well, without more information about what you are trying to do, it's going to be difficult to help.

 

Can you share what you are trying to run? Your command line instructions, a sample of the sequence file you are trying to run.

Also, have you had a look at:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x3IuCAI&l=en-ZA 

https://forums.ni.com/t5/Continuous-Integration/TestStand-command-line-options/td-p/3949195 

0 Kudos
Message 4 of 8
(2,357 Views)

so my call from a batch file is:

 

"C:\Program Files\National Instruments\TestStand 2020\UserInterfaces\Full-Featured\CVI\TestStand 2020 (64-bit) CVI UI - Operator.lnk" -operatorInterface -runEntryPoint "Single Pass" "C:\temp\test.seq" -outputToStdIO -quit

 

The sequence only shows a message to the user, that's all. If I run this batch file everything works as expected. But (!) when calling the SAME file with gitlab it does not. Now, TestStand runs as a background process and never terminates. When manually terminating the process than gitlab also terminates. 

It also works when starting gitlab-runner in the live-mode. Here I can see that TestStand runs in foreground and therefore it works.

0 Kudos
Message 5 of 8
(2,340 Views)

Sorry I don't have much experience with CVI. But a couple of questions:

 

- How do you handle the TestStand Login when the execution starts?

- In the links I sent previously there are a couple of settings you want to set if you are going to use TestStand headless ( https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x3IuCAI&l=en-ZA )

- What happens if you use the executable instead of the shortcut? ("C:\Program Files\National Instruments\TestStand 2020\UserInterfaces\Full-Featured\CVI\Source Code\x64\TestExec.exe" instead of "C:\Program Files\National Instruments\TestStand 2020\UserInterfaces\Full-Featured\CVI\TestStand 2020 (64-bit) CVI UI - Operator.lnk")

- When you run gitlab (with "gitlab-runner.exe run") does everything work as expected (without requiring any inputs/actions from you)?

- What does "When manually terminating the process than gitlab also terminates." mean? How do you manually terminate? Is that using the GitLAB web console?

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

it looks like I found the solution of the problem. The TestStand call looks like this:

 

& "C:\Program Files\National Instruments\TestStand 2020\UserInterfaces\Full-Featured\CVI\Source Code\x64\TestExec.exe" -operatorInterface -runEntryPoint "Single Pass" "C:\temp\test.seq" -outputToStdIO -quit

 

So don't use in the powershell script: "Start-Process" only "&" to call TestStand.

For a batch file don't use "Start "" /wait" only "&" to call TestStand

 

This will run TestStand and terminates it as expected after finishing the sequences. The output errorlevel is "passed" or "failed" in gitlab.

 

It does not matter if you use .exe or the shortcut

Message 7 of 8
(2,335 Views)

Reviving this. Your latest solution works when executing out of powershell but were you able to get it to work out of a gitlab-runner?

& "C:\Program Files\National Instruments\TestStand 2020\UserInterfaces\Full-Featured\CVI\Source Code\x64\TestExec.exe" -operatorInterface -runEntryPoint "Single Pass" "C:\temp\test.seq" -outputToStdIO -quit

 

0 Kudos
Message 8 of 8
(300 Views)