🔧 chore(locustfile.py): remove hardcoded flow ID and replace it with the value from the FLOW_ID environment variable for flexibility and security

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-21 13:46:35 -03:00
commit 15f6200477

View file

@ -2,6 +2,7 @@ from locust import FastHttpUser, task, between
import random import random
import time import time
from rich import print from rich import print
import os
class NameTest(FastHttpUser): class NameTest(FastHttpUser):
@ -28,9 +29,7 @@ class NameTest(FastHttpUser):
@task @task
def send_name_and_check(self): def send_name_and_check(self):
name = random.choice(self.names) name = random.choice(self.names)
flow_id = ( flow_id = os.getenv("FLOW_ID")
"e56cca5e-4bf3-4103-9a18-d55dcea135ec" # Replace with appropriate flow ID
)
session_id = f"{name}-{time.time()}" session_id = f"{name}-{time.time()}"
def process(flow_id, payload): def process(flow_id, payload):