08-14-2017 04:14 AM
I'm currently trying to set up continuous integration with LabVIEW using Gitlab's continuous integration services. Here's my setup:
Windows 10 Virtual Machine
LabVIEW 2015
LabVIEW-CLI for LabVIEW/Command Line integration
Windows Powershell
GitLab Runner Service running as my administrator account
I'm trying to launch a LabVIEW VI from the command line that runs all the unit tests in the LabVIEW project contained within git directory of my current project.
The Problem
I can run the following command from powershell sucessfully:
PS C:\Users\diagonalley\Desktop\DA622\builds\0\project-0> labview-cli --lv-ver 2015 --verbose --kill '.\common-tools\source\run UTF tests.vi'
LabVIEW opens, loads the VI, runs my unit tests, and all is dandy. Here's the output:
Running the exact same command using the gitlab-runner service yields the following output:
LabVIEW opens and tries to load "run UTF tests" but fails and reverts to the getting started window:
The LabVIEW-cli never opens and my command times out. This is incredibly frustrating because LabVIEW gives me no indication as to why it can't open my VI, it just goes directly to the getting started window. Attempting to open the vi manually from the same getting started window works. Does anyone have any idea how to figure out why LabVIEW can't load my VI? There aren't any crash logs because LabVIEW isn't crashing. Any help would be greatly appreciated.
Cheers,
08-29-2017 05:33 AM
I guessed someone forgot at the compilation of LabVIEW.exe to enable the checkmark "Pass al command line arguments to application" ![]()
08-29-2017 07:39 AM
I wish that were the case, but the command line argument works great when I run the script manually. The problem only occurs when I run the command line script through my gitlab-runner service.
Anyone have any ideas on how to increase the verbosity of LabVIEW? 😛
08-29-2017 08:39 AM
Are you sure you have those parameters right? Like, I never use those double hyphens, although the documentation indicates you need it.
08-29-2017 08:57 AM
I'm pretty confident I have the parameters correct. I know because LabVIEW launches fine when I run the command line script myself with powershell. When I run the exact same command through the gitlab runner service, LabVIEW fails to load the VI. I can see Loading "Run UTF tests.vi" in the splash window before the getting started window appears.
To be clear, the gitlab runner service is running under my user account and is using the exact same shell (powershell) as my test. The service parses my configuration file (.gitlab-ci.yaml) and passes the exact same commands as in my test (the images above are slgihtly different because I didn't pass the project path and utf output path to LabVIEW to save time. I have tried this however and the results are exactly the same).
I need to know why LabVIEW can't load the VI when being launched from the command line through my gitlab-runner service. Unfortunately LabVIEW doesn't give me any information. LabVIEW is already pretty jenky to use with source control, I'm not surprised the environment doesn't make continuous integration easy.
08-29-2017 09:06 AM
Are you using the forward and backward slashes correctly?
08-29-2017 09:12 AM
That was my first thought as well. The gitlab-runner's environment variables all use forward slashes even in a windows environment. Luckily powershell (and LabVIEW) don't seem to care. They can handle both slash directions. I've tried both forward and backward slashes with the same results; LabVIEW works fine when launch directly from powershell through the CLI, it doesn't work when launched through the gitlab-runner service.
08-29-2017 09:14 AM
In the pictures it seems it's waiting for some connection. Could it be the firewall is blocking that?
08-29-2017 09:17 AM
Yeah, the LabVIEW-CLI is basically a wrapper to allow communication between LabVIEW and the command line. The CLI exe opens a TCP listener and waits for the LabVIEW side to connect. There's no firewall issue, the code that opens the TCP connection from the LabVIEW side is in the VI I'm trying to launch. LabVIEW can't launch the VI, so the connection times out.
08-29-2017 09:34 AM
Perhaps you could enable an INI key to have more logging and find out why it won't open you VI.
See:
https://lavag.org/topic/18469-i-found-some-more-hidden-ini-keys/