你可以如何覆盖在 locust.conf 中定义的标志?

huangapple go评论52阅读模式
英文:

How can I override flags defined in locust.conf?

问题

默认情况下,我想在无头模式下运行我的Locust测试,我在我的locust.conf中定义了以下内容:

headless = true

然而,我想在CLI中覆盖这个设置。但是像这样的命令

locust --headless false

不起作用。

是否有办法在CLI中覆盖这样的标志?

英文:

Since by default I want to run my Locust tests in headless mode, I defined the following in my locust.conf :

headless = true

However, I would like to override this in the CLI. But something like

locust --headless false

doesn't work.

Is there any way to override such flags using the CLI?

答案1

得分: 1

对于大多数标志,该方法运行正常。但出于某种原因,configargparse 在命令行中将布尔值覆盖为false时存在问题。

在Locust中有一个特定(隐藏的)参数叫做--headful,用于解决这个特定的问题。它会覆盖任何其他无头设置。

英文:

For most flags that approach works fine. But for some reason configargparse has issues with overriding a boolean value to false on command line.

There is a specific (hidden) parameter in Locust called --headful to work around this particular issue. It overrides any other headless setting.

huangapple
  • 本文由 发表于 2023年6月15日 16:22:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76480494.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定