Skip to content
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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ branches:
os: linux

python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"

env:
global:
Expand Down Expand Up @@ -47,7 +48,6 @@ install:
fi
- gem install rspec
- $PIP_INSTALL --upgrade pip
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$TRAVIS_PYTHON_VERSION" = "3.9" ]; then $PIP_INSTALL Cython; fi
- $PIP_INSTALL -r requirements.txt -r tests/ci/requirements.txt

before_script:
Expand Down
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ platform:
- x64

install:
- "%PYTHON%\\python.exe -m pip install pip wheel Cython --upgrade"
- "%PYTHON%\\python.exe -m pip install pip wheel --upgrade"
- "%PYTHON%\\python.exe -m pip install -r requirements.txt -r tests/ci/requirements.txt"
- set PATH=C:\Ruby22\bin;%PYTHON%\Scripts\;%PATH%
- set SSL_CERT_FILE=C:\\ruby24-x64\\ssl\\cert.pem
Expand Down
6 changes: 3 additions & 3 deletions build-artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash -xe

PREV_DIR=`pwd`
PREV_DIR=$(pwd)
cd "$(dirname $0)"

echo "Cleaning environment"
python3 setup.py clean
rm -rf ./build

echo "Building chrome-loader.exe"
rm -f bzt/resources/chrome-loader.exe
x86_64-w64-mingw32-gcc -std=c99 -o bzt/resources/chrome-loader.exe bzt/resources/chrome-loader.c

echo "Creating distribution packages"
rm -rf ./dist
python3 ./setup.py sdist bdist_wheel
python3 -m build

cd "${PREV_DIR}"
2 changes: 1 addition & 1 deletion bzt/engine/dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def replace_infinities(value, key, container):
container[key] = str(container[key])

def _replace_tabs(self, lines, fname):
has_tab_indents = re.compile("^( *)(\t+)( *\S*)")
has_tab_indents = re.compile(r"^( *)(\t+)( *\S*)")
res = ""
for num, line in enumerate(lines):
replaced = has_tab_indents.sub(r"\1" + (" " * self.tab_replacement_spaces) + r"\3", line)
Expand Down
2 changes: 1 addition & 1 deletion bzt/jmx/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from lxml import etree


COUNT_CHECK_CONTENT = """
COUNT_CHECK_CONTENT = r"""
String resp_message = prev.getResponseMessage();
int target_count_min = %s
def match = (resp_message =~ /Received (\d+) of message./);
Expand Down
2 changes: 1 addition & 1 deletion bzt/jmx/rte.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _handle_input_notation(_input):
text = _input[key]

elif re.match(r'\(.+?\)', key):
label = re.findall("\((.+?)\)", key)[0]
label = re.findall(r"\((.+?)\)", key)[0]
text = _input[key]
return row, col, label, text, tabs

Expand Down
2 changes: 1 addition & 1 deletion bzt/modules/ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def __init__(self, config=None, **kwargs):
super(ApacheBenchmark, self).__init__(tool_path=tool_path, installable=False, **kwargs)

def _get_version(self, output):
version = re.findall("Version\s(\S+)\s", output)
version = re.findall(r"Version\s(\S+)\s", output)
if not version:
self.log.warning("%s tool version parsing error: %s", self.tool_name, output)
else:
Expand Down
2 changes: 1 addition & 1 deletion bzt/modules/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ExternalResultsLoader(ScenarioExecutor, AggregatorListener):
:type reader: bzt.modules.aggregator.ResultsReader
"""
AB_HEADER = "starttime\tseconds\tctime\tdtime\tttime\twait"
PBENCH_FORMAT = re.compile("^[0-9]+\.[0-9]{3}\t[^\t]*\t([0-9]+\t){9}[0-9]+$")
PBENCH_FORMAT = re.compile(r"^[0-9]+\.[0-9]{3}\t[^\t]*\t([0-9]+\t){9}[0-9]+$")

def __init__(self):
super(ExternalResultsLoader, self).__init__()
Expand Down
2 changes: 1 addition & 1 deletion bzt/modules/gatling.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _normalizeContent(self,dynamicExtractor,subject):
@staticmethod
def _safeEscape(subject):
subject = re.escape(subject)
subject = subject.replace("\^","^").replace("\(","(").replace("\)",")").replace("\+","+").replace("\*","*").replace("\.",".").replace("\?","?").replace('"','\\"')
subject = subject.replace(r"\^","^").replace(r"\(","(").replace(r"\)",")").replace(r"\+","+").replace(r"\*","*").replace(r"\.",".").replace(r"\?","?").replace('"','\\"')
return subject

def _get_regex_extractor(self,varname, regexp, match_no,defaults=None):
Expand Down
2 changes: 1 addition & 1 deletion bzt/modules/java/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, **kwargs):
super(JavaC, self).__init__(tool_path="javac", installable=False, **kwargs)

def _get_version(self, output):
versions = re.findall("javac\ ([\d\._]*)", output)
versions = re.findall(r"javac\ ([\d\._]*)", output)
version = parse_java_version(versions)

if not version:
Expand Down
2 changes: 1 addition & 1 deletion bzt/requests_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from bzt import TaurusConfigError, TaurusInternalException
from bzt.utils import ensure_is_dict, dehumanize_time, BetterDict, parse_think_time

VARIABLE_PATTERN = re.compile("\${.+\}")
VARIABLE_PATTERN = re.compile(r"\${.+\}")


def has_variable_pattern(val):
Expand Down
8 changes: 4 additions & 4 deletions bzt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ def parse_java_version(versions):
version = versions[0]

if LooseVersion(version) > LooseVersion("6"): # start of openjdk naming
major = re.findall("^([\d]*)", version)
major = re.findall(r"^([\d]*)", version)
else:
major = re.findall("\.([\d]*)", version)
major = re.findall(r"\.([\d]*)", version)

if major:
return major[0]
Expand Down Expand Up @@ -1550,7 +1550,7 @@ def __init__(self, **kwargs):
super(JavaVM, self).__init__(installable=False, tool_path="java", **kwargs)

def _get_version(self, output):
versions = re.findall("version\ \"([_\d\.]*)", output)
versions = re.findall(r"version\ \"([_\d\.]*)", output)
version = parse_java_version(versions)

if not version:
Expand Down Expand Up @@ -2014,7 +2014,7 @@ def get_assembled_value(configs, key, protect=False):

def parse_think_time(think_time, full=False):
distributions = ["uniform", "gaussian", "poisson"]
format_str = "^(%s)\(([\wd.]+)[,\s]+([\wd.]+)\)$"
format_str = r"^(%s)\(([\wd.]+)[,\s]+([\wd.]+)\)$"
expr = re.compile(format_str % '|'.join(distributions), re.IGNORECASE)
res = expr.match(str(think_time))

Expand Down
47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[project]
name = "bzt"
description = "Taurus Tool for Continuous Testing"
readme = "README.md"
authors = [{ name = "Andrey Pokhilko", email = "andrey@blazemeter.com" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Testing :: Traffic Generation",
"License :: OSI Approved :: Apache Software License",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.9"
license = { text = "Apache 2.0" }
dynamic = ["dependencies", "version"]

[project.urls]
Homepage = "http://gettaurus.org/"
Downloads = "http://gettaurus.org/docs/DeveloperGuide/#Python-Egg-Snapshots"

[project.scripts]
bzt = "bzt.cli:main"
jmx2yaml = "bzt.jmx2yaml:main"
soapui2yaml = "bzt.soapui2yaml:main"
swagger2yaml = "bzt.swagger2yaml:main"

[tool.setuptools.dynamic]
version = { attr = "bzt.resources.version.VERSION" }
dependencies = { file = "requirements.txt" }

[tool.setuptools.packages.find]
include = ["bzt*"]

[tool.setuptools.package-data]
"bzt" = ["*.json", "resources/**", "resources/**/.*"]

[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ astunparse>=1.6.3
colorama; sys_platform == 'win32'
colorlog
cssselect
Cython; python_version >= '3.9'
fuzzyset2
hdrpy>=0.3.3
lxml>=6.0.0
Expand All @@ -19,4 +18,3 @@ python-socketio>=5.13.0
h11>=0.16.0
websocket-client>=1.8.0
urllib3==2.5.0
setuptools==79.0.1
3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

70 changes: 0 additions & 70 deletions setup.py

This file was deleted.

13 changes: 4 additions & 9 deletions site/dat/docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Before Taurus and after Python installation, check if you have the following modules installed:
```
pip install --upgrade wheel setuptools Cython
pip install --upgrade wheel setuptools
```

The simplest Taurus installation uses the `pip` package manager:
Expand Down Expand Up @@ -30,7 +30,7 @@ At the moment, this feature can't be installed from PyPi and is available from t

## Linux

First verify that you have installed Python 3.7+ and Java.
First verify that you have installed Python 3.9+ and Java.

To install Taurus on Linux, follow these steps:

Expand Down Expand Up @@ -76,12 +76,7 @@ If your brew auto update is switched off, manage it manually.
NOTE: There is an issue with brew installation connected with numpy.
In order to avoid this problem, we suggest installing Taurus using the `pip` tool.

To install Taurus with `pip`, you need the command line developers tools and Python 3.7+ installed.
Then install `Cython`, if it is not yet installed, using the following command:
```
pip3 install Cython
```

To install Taurus with `pip`, you need the command line developers tools and Python 3.9+ installed.
Then just install bzt:
```
pip3 install bzt
Expand All @@ -97,7 +92,7 @@ pip3 install --upgrade bzt

Preparation steps:

1. Get Python 3.7+ from [https://www.python.org/downloads](https://www.python.org/downloads) and install it. Enable the "Add python.exe to Path" checkbox.
1. Get Python 3.9+ from [https://www.python.org/downloads](https://www.python.org/downloads) and install it. Enable the "Add python.exe to Path" checkbox.
2. Get the latest Java from [https://www.java.com/download/](https://www.java.com/download/) and install it.
3. Get the latest [Microsoft Visual C++](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&channel=Release) and install it. Verify that the 'Desktop Development with C++' box is checked during installation.

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/jmeter/test_JMX.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def test_TST_low_val(self):

def _get_tst_schedule(self):
records = []
shaper_elements = self.jmx.get("kg\.apc\.jmeter\.timers\.VariableThroughputTimer")
shaper_elements = self.jmx.get(r"kg\.apc\.jmeter\.timers\.VariableThroughputTimer")
self.assertEqual(1, len(shaper_elements))

shaper_collection = shaper_elements[0].find(".//collectionProp[@name='load_profile']")
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/modules/jmeter/test_JMeterExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_zero_concurrency(self):
self.obj.prepare()
jmx = JMX(self.obj.modified_jmx)
selector = 'jmeterTestPlan>hashTree>hashTree>ThreadGroup'
selector += '>stringProp[name=ThreadGroup\.num_threads]'
selector += r'>stringProp[name=ThreadGroup\.num_threads]'
thr = jmx.get(selector)
self.assertEqual(4, len(thr)) # tg with concurrency=0 must be disabled
self.assertEqual('20', thr[0].text) # 2 -> 20
Expand All @@ -197,7 +197,7 @@ def test_jmx_2tg(self):
self.obj.prepare()
jmx = JMX(self.obj.modified_jmx)
selector = 'jmeterTestPlan>hashTree>hashTree>ThreadGroup'
selector += '>stringProp[name=ThreadGroup\.num_threads]'
selector += r'>stringProp[name=ThreadGroup\.num_threads]'
thr = jmx.get(selector)
self.assertEquals('420', thr[0].text)
self.assertEquals('631', thr[1].text)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/modules/test_cloudProvisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -2094,10 +2094,10 @@ def get_kpis(self, min_ts):
return self._extract("GET https://a.blazemeter.com/api/v4/data/kpis")

def get_aggregate_report(self):
return self._extract("GET https://a.blazemeter.com/api/v4/masters/\d+/reports/aggregatereport/data")
return self._extract(r"GET https://a.blazemeter.com/api/v4/masters/\d+/reports/aggregatereport/data")

def get_errors(self):
tpl = "GET https://a.blazemeter.com/api/v4/masters/\d+/reports/errorsreport/data?noDataError=false"
tpl = r"GET https://a.blazemeter.com/api/v4/masters/\d+/reports/errorsreport/data?noDataError=false"
return self._extract(tpl)


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_locustIOExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def test_build_script(self):
"body": {'var1': 'val1'},
"assert": [{
'subject': 'body',
'contains': '\w+l1e'}]}]}}})
'contains': r'\w+l1e'}]}]}}})
self.obj_prepare()
self.assertFilesEqual(RESOURCES_DIR + "locust/generated_from_requests.py", self.obj.script)
self.obj.post_process()
Expand Down