how to pass custom parameters to a locust test class?

前端 未结 2 1516
深忆病人
深忆病人 2021-02-18 14:53

I\'m currently passing custom parameters to my load test using environment variables. For example, my test class looks like this:

from locust import HttpLocust,         


        
2条回答
  •  离开以前
    2021-02-18 15:11

    You could use like env = locust and use inside the locust script to use its value

    E.g., env IP_ADDRESS=100.0.1.1 locust -f locust-file.py --no-web --clients=5 --hatch-rate=1 --num-request=500 and use IP_ADDRESS inside the locust script to access its value which is 100.0.1.1 in this case.

提交回复
热议问题