Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

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

Open
graydwarf opened this issue Aug 27, 2020 · 6 comments
Labels
question Further information is requested

Comments

@graydwarf
Copy link

graydwarf commented Aug 27, 2020

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
Copy link
Contributor

allantargino commented Sep 2, 2020

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link

wenbya commented Sep 10, 2021

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
Copy link

wenbya commented Sep 10, 2021

@hepsi204 have you resolved this issue ?

@wenbya
Copy link

wenbya commented Oct 12, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants