diff --git a/README.md b/README.md index f7d0ec24d9da1681318b7cd57eb34a81507dabf1..d249e0e11de6ce18ad1c55b4b1f028ebb1c8cbae 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,10 @@ Also feel free to monitor the system through grafana during all the following st If you followed step 1, you (as a manager) should also get an e-mail notification about new component being created. +*Note: It is possible to time-out our team's e-mail address if you make too many new notifications (for example during the second scenario - load test). +So if the Notifications module is not working, try to wait a few minutes, maybe another reviewer +was doing a load test at the same time. In real system we would not use a regular Gmail address for such job - there would be no timeouts.* + #### 4. Log in as an manager and create a visualization of a car - Log in using a manager scope (test_5), same way as before. - Now, you can perform all operations, except POST at /carComponent (only engineers can do that). diff --git a/scenario-locust/scenario.py b/scenario-locust/scenario.py index a3edd015adc64ed01e9e20c57af9f887e8eed97b..abbeff262096946c59db8351db6675065f728afc 100644 --- a/scenario-locust/scenario.py +++ b/scenario-locust/scenario.py @@ -1,30 +1,19 @@ from locust import HttpUser, task import random - class Admin(HttpUser): - id = 0 + fixed_count = 1 - def on_start(self): + @task + def update_random_application_status(self): response = self.client.get("/application") if len(response.json()) == 0: - self.client.post("/application", json={ - "name": "Jozko", - "surname": "Example", - "birthday": "2023-05-06", - "email": "jozko.example@example.com" - }) - - response = self.client.get("/application") + return - self.id = response.json()[0]['id'] - - @task - def update_application_status(self): - self.client.get("/application") + applicationNumber = random.choice([i for i in range(1, len(response.json()))]) status = random.choice(["accepted", "rejected"]) - self.client.put(f"/application/status?id={self.id}&applicationStatus={status}") + self.client.put(f"/application/status?id={applicationNumber}&applicationStatus={status}") @task def get_application(self): @@ -41,6 +30,6 @@ class User(HttpUser): self.client.post("/application", json={ "name": "Jozko", "surname": "Example", - "birthday": "2023-05-06", - "email": "jozko.example@example.com" + "birthday": "2000-05-06", + "email": "john@example.com" })