Post Load Test Actions
-
11. července 2012 15:18
My intention is to copy some SQL data from a testing tier (which at points is overwritten so I lose some useful application-specific load test data) and save it in the same server as the loadtest results. The copy methodology works fine, as intended.
My issue is with the Load Test Plug-in and how it can be used. I've currently made a plug-in which uses the LoadTestFinished event to take the LoadTestRunId and write that to my destination tables along with some other data which I wish to store. The problem is I'm using a custom assembly which only exists on my machine so only my agent has visibility to it so when it comes to the other agents using the plug-in class they fall over hard and the test aborts. From the title 'LoadTestFinished' event I had assumed this event fires when the load test has completed. However checking this link:
It actually reads as if it will fire when the test finishes on each agent which is really no good at all for me as the agents will naturally finish at different times to one another. Also I only wish the code to run once, not once per agent.
My goal is simple - how can I have an event fire some code after the whole load test has finished, ideally getting the load test run id, start time and end time from the load test which has just ran?
Nick Sandel (Software Tester) New to C# since November 2011
Všechny reakce
-
13. července 2012 3:31Moderátor
Hi Nick,
I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
25. července 2012 22:32
Hi Nick,
I apologize for this late response. I just got this reply from one of our engineers.
Eight events are associated with a load test that can be handled in the load test plug-in to run custom code with the load test. The following is a list of the events that provide access to different periods of the load test run:
LoadTestStarting
LoadTestFinished
LoadTestWarmupComplete
TestStarting
TestFinished
ThresholdExceeded
Heartbeat
LoadTestAborted
You can use the "Setup and Cleanup Scripts" dialog box to specify script to run after tests are run.
Chris Cooper MSFT
-
26. července 2012 7:56
Hi Chris,
Thanks for the response.
From trying a few things I still haven't found a way to achieve what I'm after. What I require is a script to run once (and only once) after the whole load test runs. I tried the cleanup script but unfortunately that was run once per test agent as the load test plug-in gets run. In the LoadTestFinished event I was able to extract the agent name but I can't guarantee which agent will be last to finish running the test so I can't use that as a marker to fire my code.
Any ideas on how I can automatically trigger some code/batch file to run after the whole load test has completed?
Nick Sandel (Software Tester) New to C# since November 2011
-
2. srpna 2012 21:36
Hi Nick,
Let me see what I can find out about this...
Chris Cooper MSFT
-
6. srpna 2012 16:22VlastníkUnfortunately the Load Test API does not provide this functionality out of the box. Please see the following sample if that helps you resolve the problem. Email Reporter: VSTS 2008 Load Test Plug-in
http://archive.msdn.microsoft.com/erepTrevor Hancock (Microsoft)
Please remember to "Mark As Answer" the replies that help.