NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading files from Source Control via the API

Is it possible to read VI's and other files out of a source control database automatically when loading a sequence?

We'd like to keep the VIs in a source code database centrally located on the network. When an operator loads the sequence file, the latest VIs will be retrieved from the database and copied to the local machine where the tests are to be run. I know the TestStand API include sourcecontrol comands, but I'm under the impression this will only work with the use of Workspace files. Would this mean the operators would have to open a workspace file, then the correct sequence for this to work?
0 Kudos
Message 1 of 5
(3,605 Views)
Hi,

Could you use a shadow folder of the source control software?

Yannick
0 Kudos
Message 2 of 5
(3,605 Views)
re: Could you use a shadow folder of the source control software?

Not sure what you mean by a shadow folder, as I have not use source control at this point. If you mean copy the files from the source control to a temporary folder so the operator can run the test, yes, that is my intention. My question is can this process be automated when the operator loads the test?
0 Kudos
Message 3 of 5
(3,605 Views)
A shadow folder is a copy of the latest versions of what is on the source control database. You must define this folder on the source control software, usualy a folder on a network drive where the operators can access. We are using this system to be sure that the latest limits and configurations files are used on all stations. I have never try to do that with the sequence files...
0 Kudos
Message 4 of 5
(3,605 Views)
Cabman -
As with most source code providers, you could just invoke a simple command line string or API like command to get all files under a specific project or a folder under the project. Depending on how your source files are stored, why not just issue a root level command and get the latest for everything? If there are no new files to get, it should be a quick command. Just a thought.

You are correct in that the source code control API within the TestStand API is exposed from the workspace or more specifically workspace objects. In TestStand the root workspace object, the workspace file, specifies the provider name to connect to and controls whether TestStand is even connected to a provider at any specific instance.

If you think that maintaining a
workspace image that mimics your sequences and the underlying VIs another files that it calls, you could do this manually.

The API does allow you to "discover" the code modules that a sequence file calls using the Workspace.InsertCodeModule method. Your OI could create the details in the workspace dynamically using this method. You might have to "discover" any new sequence files (code modules) that that sequence file calls.

You could create a utility DLL that communicates to your source code control system possibly using a direct API or using Microsoft's common source code control API. The utility could attempt to discover the code module recursively and it could validate that you have the latest source files. Your OI could do this or even a sequence file load callback could. This might be a lot of work though.

Scott Richardson
Scott Richardson
https://testeract.com
0 Kudos
Message 5 of 5
(3,605 Views)