Can I publish result in PostPlanRun

In my test sequence, I have to wait until all tests are executed before I can publish the results. So I tried publishing results during PostPlanRun, Is this possible?

When I try I am encountering this error :

12:38:34.980  ResultProxy  Caught exception in result handling task.
12:38:34.996  ResultProxy  Exception: OnResultPublished called without associated step run.
12:38:35.013  ResultProxy      at Keysight.OpenTap.Plugins.Csv.CsvResultListener.OnResultPublished(Guid stepRunId, ResultTable result)
12:38:35.013  ResultProxy      at OpenTap.ResultSource.Propagate(IResultListener rt, ResultTable result)
12:38:35.013  ResultProxy  Exception caught at:
12:38:35.075  ResultProxy      at Void Process()
12:38:35.075  ResultProxy      at Void processQueue()
12:38:35.075  ResultProxy      at Void RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
12:38:35.075  ResultProxy      at Void Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
12:38:35.075  ResultProxy      at Void Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
12:38:35.075  ResultProxy      at Void ThreadStart()
12:38:35.075  TestPlan     Removing faulty ResultListener 'CSV'

2 Likes

@darwin this is not possible currently. There are two possible approaches:

  1. Make the results from each Step a property rather then publishing, and use the [Output] attribute. Then have a second “Collector” step that accepts all these Outputs and does the Publish

  2. Create a Parent “Collector” step. Similar to above. Rather than each step “Publishing” results just set a property, and have the Parent step call Results.Publish.

1 Like

Thanks @brennen_direnzo

1 Like

@brennen_direnzo I do option 2, the parent collector step. It’s a vital underpinning of our test plan design.

Maybe a third option would be for the result listener itself to do the collecting, then write all the results from within its OnTestPlanRunCompleted method. Probably not as clean or generic of a solution.

2 Likes