More testing

This commit is contained in:
kolaente 2018-12-10 00:36:00 +01:00
parent 6d6c3b82fd
commit d4a7862a14
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
6 changed files with 2154 additions and 6 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
for f in {1..10};
for f in {1..100};
do
data="{\"username\":\"testuser${f}\",\"email\":\"testuser${f}@kolaente.de\",\"password\":\"1234\"}"
#echo $data

View File

@ -20,14 +20,14 @@ class VikunjaTaskSet(TaskSequence):
self.namespaces = {}
def get_authentication_keys(self):
response = self.client.post("/login", {"username":"testuser1", "password":"1234"})
response = self.client.post("/login", {"username":"testuser" + str(random.randint(1, 100)), "password":"1234"})
data = json.loads(response.text)
self.headers["Authorization"] = 'Bearer ' + data["token"]
@task
@seq_task(1)
def dashboard(self):
self.client.get("/tasks", headers=self.headers)
self.client.get("/tasks/all", headers=self.headers)
response = self.client.get("/namespaces", headers=self.headers)
self.namespaces = json.loads(response.text)
@ -40,16 +40,22 @@ class VikunjaTaskSet(TaskSequence):
data = json.loads(response.text)
self.listIDs.append(data["id"])
@seq_task
@task(1000)
@seq_task(3)
@task(500)
def add_task(self):
self.client.put("/lists/" + str(random.choice(self.listIDs)),
data=json.dumps({"text": "task created by locust"}),
headers=self.headers)
@seq_task(4)
@task(2000)
def get_list(self):
self.client.get("/lists/" + str(random.choice(self.listIDs)),
headers=self.headers)
class VikunjaLocust(HttpLocust):
task_set = VikunjaTaskSet
min_wait = 100
max_wait = 5000
max_wait = 1500

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff