healthcheck load tests (for testing)
This commit is contained in:
parent
3d47b109d6
commit
a12e57e564
@ -64,5 +64,10 @@ class BackendApi():
|
|||||||
def dummy_get(self, auth: Auth):
|
def dummy_get(self, auth: Auth):
|
||||||
headers = {"X-Auth": auth.token}
|
headers = {"X-Auth": auth.token}
|
||||||
response = self.http.client.get("/dummy", headers=headers)
|
response = self.http.client.get("/dummy", headers=headers)
|
||||||
|
if response.status_code != 200:
|
||||||
|
raise AssertionError('something wrong')
|
||||||
|
|
||||||
|
def health_get(self):
|
||||||
|
response = self.http.client.get("/health")
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
raise AssertionError('something wrong')
|
raise AssertionError('something wrong')
|
||||||
13
load_tests/tests/health.py
Normal file
13
load_tests/tests/health.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from locust import FastHttpUser, task
|
||||||
|
|
||||||
|
from api import BackendApi
|
||||||
|
|
||||||
|
class HealthGet(FastHttpUser):
|
||||||
|
api: BackendApi
|
||||||
|
|
||||||
|
@task
|
||||||
|
def user_create_test(self):
|
||||||
|
self.api.health_get()
|
||||||
|
|
||||||
|
def on_start(self):
|
||||||
|
self.api = BackendApi(self)
|
||||||
Loading…
x
Reference in New Issue
Block a user