new feature: ate-locust

This commit is contained in:
debugtalk
2017-08-18 17:23:47 +08:00
parent a871bcf837
commit 148b2b9e9c
10 changed files with 154 additions and 11 deletions

26
ate/locustfile_template Normal file
View File

@@ -0,0 +1,26 @@
#coding: utf-8
import zmq
import os
from locust import HttpLocust, TaskSet, task
from ate import utils, runner, exception
class WebPageTasks(TaskSet):
def on_start(self):
self.test_runner = runner.Runner(self.client)
self.testset = self.locust.testset
@task
def test_specified_scenario(self):
try:
self.test_runner.run_testset(self.testset)
except exception.ValidationError:
pass
class WebPageUser(HttpLocust):
host = "$HOST"
task_set = WebPageTasks
min_wait = 1000
max_wait = 5000
testsets = utils.load_testcases_by_path("$TESTCASE_FILE")
testset = testsets[0]