简体   繁体   中英

Running JMeter test on VSTS via Release Definition

I am executing a JMeter script using a 'Cloud-based Apache JMeter Load Test' task in VSTS. I have a response assertion as a part of the JMeter test. I am able to trigger the tests through a release definition in VSTS. When the assertion fails, I want to fail the release. Currently the release succeeds with a warning like this:

2018-02-21T18:23:31.1885342Z ##[warning][Exception] 1 occurrences of ['Test','HTTP Request','WebException'] : Please download the test logs to see the response data for this url https://www.xyz

The warning is good but I want to fail the release if the JMeter test failed. Any idea how to do it? Or if there is a way to parse warning from execution of a release step, I could may be use that in Powershell Script and exit with error but I am not sure how to read warnings from VSTS release log/task.

If you want to stop thread on error you have such option in Thread Group Action to be taken after a Sampler error

determines what happens if a sampler error occurs, either because the sample itself failed or an assertion failed

Choose Stop Thread or Test

Stop Test – the entire test is stopped at the end of any current samples. It means the pending samplers are still run until done.

Regarding retrieve release task log during release:

  1. Call get a release REST API to get related task log of current release (tasks section)
  2. Call task log url (Step 1) to get the detail log
  3. Analysis the log (eg check whether there is ##[warning][Exception] in the log)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM