0

I've got a JMeter test setup with the environment details (protocol, hostname and port number) set as properties. This is so I can repeat the same test on multiple environments through a pipeline.

When I set the properties (e.g. modules.jmeter.properties.protocol: https) in .bzt-rc or any other yaml file, then Taurus picks them up just fine. However, if I then run the test using bzt -o modules.jmeter.properties.protocol=TEST then the test runs just fine (I'd expect it to break as I'm overriding the property setting).

If I remove the setting of the property from the file (e.g. .bzt-rc) but keep the command line setting then the test does not work even though I am now setting the protocol correctly (-o modules.jmeter.properties.protocol=https).

I've looked at this link https://gettaurus.org/docs/CommandLine/ and can't see anything obvious but I'm sure there must be.

Any help much appreciated!

0
  1. if I then run the test using bzt -o modules.jmeter.properties.protocol=TEST then the test runs just fine

    that shouldn't happen as you will get MalformedURLException

    enter image description here

    overall status code of the bzt command execution will still be 0 (success) unless you have custom pass/fail criteria

  2. If I remove the setting of the property from the file (e.g. .bzt-rc) but keep the command line setting then the test does not work even though I am now setting the protocol correctly

    that shouldn't happen as well, you don't need to declare the property anywhere, you can just set its value via -o command-line argument (like -J command-line argument for JMeter), you can double-check it by inspecting effective.json or effective.yml file, you will see that any property(ies) you set via -o argument(s) will be added to the default set of JMeter properties overrides

Just in case make sure to have the latest version of Taurus installed as you might be suffering from a bug which has been fixed already and get familiarized with Navigating your First Steps Using Taurus article.

Further assistance is not possible without seeing your .yml file and the way you're referring the property either in YAML or in .JMX

1
  • Thanks for the above. I've done some more investigation today and think I've found the problem - see answer below.
    – Moorpheus
    Oct 27 '20 at 9:19
0

So, looking at this again, I had the properties for protocol, hostname and port set as: modules.jmeter.properties.environment.protocol and same for hostname. For port, I had modules.jmeter.properties.environment.port..

This naming convention worked fine when I set the properties in a text file as a single line. I.e...

modules.jmeter.properties.environment.protocol=https
modules.jmeter.properties.environment.hostname=<my-hostname>.com
modules.jmeter.properties.environment.port.<microservice-name>=<my-port-number>

However, when I passed them in via command line, the effective.yml file was treating each . separator as you can see below (copied out of the effective.yml):

  environment:
    hostname: <my-hostname>.com
    port:
      <microservice-name>: <my-port-number>
    protocol: https

I've found that when I change the properties to just be hostname, microservice-port and protocol (i.e. no nesting) then it works fine when I pass them in via command line.

E.g. -o modules.jmeter.properties.protocol=https

So, I've changed my JMeter property names to just be protocol, hostname and port-number and it's working fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.