Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gatling guess version fix for Gatling 3.10+ #1839

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions bzt/modules/gatling.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import shutil
from collections import defaultdict
from packaging import version
from packaging.version import Version
from packaging.version import InvalidVersion

from bzt import TaurusConfigError, ToolError
Expand Down Expand Up @@ -832,16 +833,17 @@ def __rc_from_msg(self, msg):
return _tmp_rc if _tmp_rc.isdigit() else 'N/A'

def _guess_gatling_version(self, fields):
if fields and fields[-1].strip() < "3.4":
if Version(fields[-1].strip()) < Version("3.4"):
return "3.3.X"
elif fields[-1].strip() >= "3.4":
elif Version(fields[-1].strip()) >= Version("3.4"):
return "3.4+"
else:
return ""

def _extract_log_data(self, fields):
if self.guessed_gatling_version is None:
self.guessed_gatling_version = self._guess_gatling_version(fields)
if fields and fields[0] == 'RUN':
self.guessed_gatling_version = self._guess_gatling_version(fields)

return self._extract_log(fields) if self.guessed_gatling_version else None

Expand Down
1 change: 1 addition & 0 deletions site/dat/docs/changes/fix-gatling-guess-version.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed Gatling guess version method for Gatling 3.10+
Loading