Skip to content

Commit

Permalink
SPAR-2738: Support latest and stable version strings. Log version in …
Browse files Browse the repository at this point in the history
…info if changed or detected (Blazemeter#1865)
  • Loading branch information
henrychv authored Oct 7, 2024
1 parent cad45d3 commit 5fcb9b9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions bzt/modules/jmeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,31 @@ def prepare(self):

self.original_jmx = self.get_script_path()
self.log.debug("Getting Jmeter version.")
if os.getenv('TAURUS_JMETER_DISABLE_AUTO_DETECT', 'False') == 'True':
config_version = self.settings.get("version", JMeter.VERSION, force_set=True)
if config_version == "latest":
self.settings["version"] = JMeter.VERSION_LATEST
elif config_version == "stable":
self.settings["version"] = JMeter.VERSION
elif os.getenv('TAURUS_JMETER_DISABLE_AUTO_DETECT', 'False') == 'True':
self.log.debug("Autodetect version is disabled.")
# autodetection NOT active -> use STABLE if auto,
# xyz if STABLE|LATEST
# STABLE otherwise
config_version = self.settings.get("version", JMeter.VERSION, force_set=True)
if config_version in [JMeter.VERSION, JMeter.VERSION_LATEST]:
self.settings["version"] = config_version
else:
self.settings["version"] = JMeter.VERSION
else:
# autodetection IS active (original default behavior)
self.log.debug("Autodetect version is enabled")
if self.settings.get("version", JMeter.VERSION, force_set=True) == "auto":
if config_version == "auto":
self.settings["version"] = self._get_tool_version(self.original_jmx)
self.log.debug("JMeter version: %s", self.settings["version"])

if self.settings["version"] != config_version:
self.log.info("Using JMeter version: %s (configured version: %s)",
self.settings["version"], config_version)
else:
self.log.debug("JMeter version: %s", self.settings["version"])

if not self.original_jmx:
if self.get_scenario().get("requests"):
Expand Down

0 comments on commit 5fcb9b9

Please sign in to comment.