开发者

Stress-testing using Cucumber

开发者 https://www.devze.com 2023-01-21 03:11 出处:网络
I\'m currently writing integration tests for a RoR REST API using cucumber. I\'d also like to stress-test the API and was wondering how I might be able to re-use my cucumber scenarios to do this.

I'm currently writing integration tests for a RoR REST API using cucumber.

I'd also like to stress-test the API and was wondering how I might be able to re-use my cucumber scenarios to do this.

I've used JMeter and httperf before for stress-tests, and of course with both tools had to write or record the tests that I wanted to include in the stress testing. Since I already have the scenarios in Cucumber that I want to test, I'm trying to avoid having to rewrite what would be largely the same scenarios in开发者_高级运维 the stress-testing tool's syntax.

Can anybody recommend a way that I could use my cuke tests for this? Ideally, I'd like to simulate hundreds of concurrent users hitting the API.


You very well may have to create your own load harness. Essentially, you'll need to start up a number of threads, each calling the process to start your scenarios. You will want to have a delay to stagger when each thread starts because there will be some overhead involved with loading the Ruby interpreter. You may also have to spread the load across more than one machine for the same reasons. It would probably be best to do this in separate processes. Perhaps this might be good for a new project?


Hmm, what about creating some steps that perform a system call to httpref ?

0

精彩评论

暂无评论...
验证码 换一张
取 消