ak_nz Posted March 10, 2014 Report Posted March 10, 2014 Hello all, I am trying to integrate our LabVIEW build workflow into our CI Server. Currently we have several builds in LabVIEW projects that we can programmatically call in order to perform the build, conduct unit testing etc. using the IDE. I'm looking to integrate this into our build server using TeamCity. Every time we check in changes to one of the projects a build is triggered. Since building requires the IDE running, I am attempting to use the Command-line Runner in TeamCity to execute a batch file that launches the IDE with the builder VI as an argument. The build VI performs the builds, testing and then shuts-down LabVIEW. Running the batch file manually (as me) works a treat - LabVIEW starts up, the builds occur, unit test results are captured and then the IDE shuts-down. However I have run into a problem getting the batch file automatically called by TeamCity. The build agent runs as a windows service and it appears as if windows services do not have permissions ordinarily to start up GUI applications. I have tried several options such as configuring the log-on account for the service to run etc. Every time the build occurs, the log shows that the batch file has been run but LabVIEW does not start up. Unfortunately there is no command-line version of LabVIEW (pity) so it appears as if there is no obvious way to get this to work. Has any-one attempted this before? I know guys at JKI pull this off (using a different CI server) and I'm wondering whether this issue is familiar to anyone. Thanks for any and all help. Quote
Omar Mussa Posted March 11, 2014 Report Posted March 11, 2014 I presented on this topic and it was posted here: http://blog.jki.net/news/niweek-2012-fire-and-forget-bulletproof-builds-using-continuous-integration-with-labview-video-slides-now-available/ You can debug a windows service by making the UI visible and seeing what is blocking the app from running this way: administrative tools -> services -> right click -> goto properties -> under Log On tab check allow to interact with desktop That should help. Quote
ak_nz Posted March 11, 2014 Author Report Posted March 11, 2014 Hi Omar. Thanks for your response - yes I read your presentation thoroughly! I have tried previously adjusting the service's rights to interact with the desktop but it was still no go. I can only think that some other policy is blocking my ability to do this. Given we have a VLA and are checking out development licenses from the server rather than a local license I had wondered whether it was this activity that was being blocked in this scenario. I have ended up running the TeamCity agent as an application rather than a service; things work fine this way. It's not ideal but would welcome any other ideas. PS. Any idea when VI Tester will be updated to LV2012++? Nudge, nudge! Quote
Omar Mussa Posted March 11, 2014 Report Posted March 11, 2014 Hi Omar. Thanks for your response - yes I read your presentation thoroughly! I have tried previously adjusting the service's rights to interact with the desktop but it was still no go. I can only think that some other policy is blocking my ability to do this. Given we have a VLA and are checking out development licenses from the server rather than a local license I had wondered whether it was this activity that was being blocked in this scenario. I didn't use the VLA with my CI Servers so that could be the issue. If any dialog was blocking the execution, then you're basically stuck if LabVIEW is running as a service with no UI. I have ended up running the TeamCity agent as an application rather than a service; things work fine this way. It's not ideal but would welcome any other ideas. PS. Any idea when VI Tester will be updated to LV2012++? Nudge, nudge! Re: VI Tester, check out the LabVIEW Tools Network - you might find a nice surprise Quote
ak_nz Posted March 11, 2014 Author Report Posted March 11, 2014 Thanks Omar. Further investigation seems to indicate that pulling network licenses is what is causing the issue. Oh well, running the agent as an application will work for now. I didn't use the VLA with my CI Servers so that could be the issue. If any dialog was blocking the execution, then you're basically stuck if LabVIEW is running as a service with no UI. Re: VI Tester, check out the LabVIEW Tools Network - you might find a nice surprise I see a fix there for template instantiation, nice! I'll check it out. I confess I had actually lost a little faith and ended up building my own unit test framework with some similarities to VI Tester (ie based on xUnit) solely so that we could run on 2012+ and get the benefits of a leaner framework for CI rather than NI's UTF. But I would always rather use a tried and tested tool. Just an FYI this is the sort of tool we would happily pay money for! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.