SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

uploading reports from TestStand

Trying to get SystemLink clients working correctly, and I'm stuck.

I've got a client connected to the server, and information is getting there, but not all of my reports.  I have several custom results processors that are generating results reports, and those custom results reports are not getting logged to SystemLink.  They are showing up in the UI and can be chosen by selecting under "active report", but I'm missing getting them into some list somewhere so that SystemLink knows to get them uploaded.

Where is that magic list?

0 Kudos
Message 1 of 6
(2,976 Views)

Unfortunately, we don't support custom report generators in 18.5. There isn't a consistent way of storing information about report files in custom generators, so we aren't necessarily able to parse the report file's location from the plugin instance. Also, there are timing issues involved if a generator is writing asynchronously - the generator may not be done writing the actual report file to disk by the time the plugin stops running. There is an Upload File step that we provide, but it uses the test socket index of the calling thread to determine the Test Monitor result ID needed for attachment. Report generators usually aren't running in a socket thread, so this typically won't work.

 

That being said, we are planning on adding explicit support for this in 19.0, which is expected to be released in May. The current plan is to expose an API for which result IDs may be obtained, plus a way of uploading files which is not bound to a socket thread. With this in place, a custom report generator should be able to obtain the result ID and perform the file upload/attach calls itself. Does this sound like it would fit your use case?

0 Kudos
Message 2 of 6
(2,960 Views)

Grumble Grumble Grumble.

As far as asynchronous stuff goes, I'm all over the dependencies across multiple results processors and making sure things are done in the right orders, etc....  I understand that is a general problem, but very manageable.  Much more manageable than editing and changing everything else....

 

I really am dreading the idea of each custom results processor having to do its own SystemLink upload.  That just puts way too much interdependence between results processors.  Now my custom report generation results processor plugin needs to go find the configuration of the systemlink plugin and read the 'enable report file upload' setting to decide what to do.  Not impossible, but the UI already knows what reports I generated and want to see and lets the user choose between them.  Not even being able to handle multiple instances of out of the box "Report" plugin results files is REALLY problematic for me and taking us back to TestStand 4x where we were limited to ONE report. 

0 Kudos
Message 3 of 6
(2,952 Views)

OK, so I'm trying to work my way around this problem and get it solved for me, and am running into a few more hurdles that hopefully you can point me towards/around.

 

Overall, it is generally frustrating how closed down the teststand systemlink integration is.  the custom results processor pretty much just launches off to a .net assembly that we can't modify.  Which means we're stuck with whatever problems and limitations NI is imposing on us.  Things like being limited to a single instance of the built in html/atml/txt report generator are arbitrary decisions that could have so easily been worked around by NI to support multiple instances, but I can't find the source for the .net assemblies to fix this one for me.  If you can point me in the right direction here, I'll take it and run with it and see how far I can get.

 

Second side ... I'm really close to patching my problem around other ways, but I'm failing at getting Skyline.TestMonitorClient.Reporter.AttachFile to work.  I know the file exists on disk that I am trying to load, but the Server shows I tired to get the file attached/uploaded but it isn't there and shows as file unavailable.  I think I'm using the .AttachFile process wrong, but am struggling to find any documentation on how to use it correctly.  Any suggestions here?

0 Kudos
Message 4 of 6
(2,924 Views)

After some investigation, it looks like you should be able to use TestMonitorClient.CustomFileUploadSingleton.Instance.UploadAndAttach. It's expecting the index of the socket thread which is running the test that you want to attach the file to, and you can pass in your filepath as well. The third argument can be left as None.

 

Alternatively that class also has a plain upload call, Instance.Upload(string), which will upload your file to the SystemLink file service, and return a file ID. You can then pass the ID to the AttachFile call that you mentioned to attach the uploaded file to your test result.

 

There's a custom step type which wraps all of this this (SystemLink -> Upload File), but it expects to be called from the socket thread which is executing your sequence.

0 Kudos
Message 5 of 6
(2,915 Views)

Thanks.

I managed to get the upload() then AttachFile() process working. 

0 Kudos
Message 6 of 6
(2,893 Views)