Azure-Samples / jmeter-aci-terraform

Scalable cloud load/stress testing pipeline solution with Apache JMeter and Terraform to dynamically provision and destroy the required infrastructure on Azure.
MIT License
119 stars 99 forks source link

Having trouble passing in additional cmdline properties such as Jprotocol #38

Open graydwarf opened 3 years ago

graydwarf commented 3 years ago

Here's my tf command and I'm passing in the following value to JMETER_SETTING_PROTOCOL: https

commands = [ "/bin/sh", "-c", "cd /jmeter; /entrypoint.sh -n -Jserver.rmi.ssl.disable=true -t ${var.JMETER_JMX_FILE} -l ${var.JMETER_RESULTS_FILE} -e -o ${var.JMETER_DASHBOARD_FOLDER} -R ${join(",", "${azurerm_container_group.jmeter_workers.*.ip_address}")} -Jprotocol=${var.JMETER_SETTING_PROTOCOL}" ]

Here's the output from the "RESULTS: Show JMeter Controller Logs" in the pipeline: jmeter args=-n -Jserver.rmi.ssl.disable=true -t BasicLoadStatic.jmx -l results.jtl -e -o dashboard -R 10.0.0.4 -Jprotocol=https

Here's the error showing up in my dashboard: Non HTTP response code: java.net.MalformedURLException/Non HTTP response message: unknown protocol: 1

Here's the variable I'm using in my jmx file: post: ${__P(protocol)}

I've tried a bunch of stuff and looked everywhere for solutions and haven't figured out why it isn't accepting this parameter. I can run the same cmdline arguments locally without problems so it's either the tf command line syntax or perhaps the handling in entrypoint.sh (which I'm off to look at now). I wasn't clear on how it handles the parameters but it looked like it supported additional params. Any ideas?

allantargino commented 3 years ago

From what you have described, you should work :(

Can you try to use Debug Sampler to see if the user property is being sent to the test definition?

Does it change anything if you use ${__property(...)} syntax?

allantargino commented 3 years ago

Hi @graydwarf,

PR #48 allows you to pass CLI arguments using an environment variable (TF_VAR_JMETER_EXTRA_CLI_ARGUMENTS). For instance, if you set it as: image

You should see: image

Once it is merged, please let me know if it helps you.

hepsi204 commented 3 years ago

Hi @graydwarf,

Not sure if its still an issue. You seem to have passed in the value to the JMeter controller. Did you also pass in the value via command line to JMeter workers ? I am referring to Line 115 in Main.tf. Might be worth a try.

Thanks

wenbya commented 2 years ago

same issue with me. help needed @allantargino . jmeter args can be passed-in (which show in logs as your snapshot) but not really works, which still not really passed as jmx xml item, pipeline still failed

wenbya commented 2 years ago

@hepsi204 have you resolved this issue ?

wenbya commented 2 years ago

image

image

if not use extra arguments just hardcode the host, it works well, but when pass the extra arguments, went wrong, need help. @allantargino @hepsi204

above snapshots show HOST value has already passed-in. but when I check results.jtl files , found that can't recognize "HOST" image