I'm trying to run load tests with locust but I need to run some API calls before I start spawning workers. I already pass my user credentials as environment variables but I don't want to have to hard-code the host within the locustfile. I'm ideally looking to have something that looks like
@events.test_start.add_listener
def on_test_start(**kwargs):
init(host, username, password)
Where init
will take care of all of the initial API calls.