Skip to content

Commit e65c0ee

Browse files
vimayyatnunnerydl
andauthored
[ODS-2866] Update Performance Testing Framework's Python (#14)
* Modified install script to install python 3.6 * Modified install script to install python 3.6 * python 3.6 upgrade * Updated Performance Testing Framework's * markupsafe upgrade Co-authored-by: Thomas Nunnery <[email protected]>
1 parent 92a7c2d commit e65c0ee

File tree

11 files changed

+27
-27
lines changed

11 files changed

+27
-27
lines changed

Administration/install-test-runner-prerequisites.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
44
# See the LICENSE and NOTICES files in the project root for more information.
55

6-
# Run this script as an administrator to install Chocolatey, Python 2.7.15,
6+
# Run this script as an administrator to install Chocolatey, Python 3.6.7,
77
# and to set up the performance test runner's Python "virtual environment".
88
# This script should be run should be run once for environments that do not
99
# already have these prerequisites set up.
@@ -19,19 +19,19 @@ if (! (Get-Command choco.exe -ErrorAction SilentlyContinue )) {
1919
refreshenv
2020
}
2121

22-
# Install Python 2.7.15
23-
# Note: This places both c:\Python27 and c:\Python27\Scripts into the system PATH variable.
22+
# Install Python 3.6.7
23+
# Note: This places both c:\Python36 and c:\Python36\Scripts into the system PATH variable.
2424
$pyversion = cmd /c python --version '2>&1'
25-
if ($pyversion -ne "Python 2.7.15") {
26-
choco install python2 -y --version 2.7.15 --params '"/InstallDir:C:\Python27"'
25+
if ($pyversion -ne "Python 3.6.7") {
26+
choco install python3 -y --version 3.6.7 --params '"/InstallDir:C:\Python36"'
2727
refreshenv
2828
}
2929

3030
# Ensure pip is on the latest version
3131
python -m pip install --upgrade pip
3232

3333
# Install virtualenv
34-
pip install virtualenv
34+
pip3 install virtualenv
3535

3636
# "Prepare a Virtual Environment for Python Test Execution"
3737
$virtualdir="c:\virtualenv"

docs/user-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and sets up all prerequisites. **Run this script in an Administrator PowerShell
2222
prompt.** The script installs and sets up the following:
2323

2424
* Chocolately, the Windows package installer
25-
* Python 2.7.15
25+
* Python 3.6.7
2626
* Python's 'virtualenv' sandboxing tool
2727
* Creates an EDFI_PERFORMANCE virtual environment (which will contain all of the
2828
installed python dependencies for this project; located at `C:\virtualenv`)

edfi_performance/api/basic_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def is_not_expected_result(response, expected_responses):
9595
message = json.loads(response.text)['message']
9696
except Exception:
9797
pass
98-
print response.request.method + " " + str(response.status_code) + ' : ' + message
98+
print (response.request.method + " " + str(response.status_code) + ' : ' + message)
9999
return True
100100
return False
101101

edfi_performance/api/client/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(self, host, token=None):
9595
EdFiAPIClient.token = token
9696

9797
for subclient_class, options in self.dependencies.items():
98-
if isinstance(subclient_class, basestring):
98+
if isinstance(subclient_class, str):
9999
subclient_class = _import_from_dotted_path(subclient_class)
100100
subclient_name = options.get('client_name')
101101
if subclient_name is None:
@@ -343,7 +343,7 @@ def delete_with_dependencies(self, reference, **kwargs):
343343

344344
def _get_dependency_client(self):
345345
subclient_class, client_name = self.dependencies.items()[0]
346-
if isinstance(subclient_class, basestring):
346+
if isinstance(subclient_class, str):
347347
subclient_class = _import_from_dotted_path(subclient_class)
348348
subclient_name = client_name.get('client_name')
349349
if subclient_name is None:
@@ -371,7 +371,7 @@ def is_not_expected_result(response, expected_responses):
371371
message = json.loads(response.text)['message']
372372
except Exception:
373373
pass
374-
print response.request.method + " " + str(response.status_code) + ' : ' + message
374+
print (response.request.method + " " + str(response.status_code) + ' : ' + message)
375375
return True
376376
return False
377377

edfi_performance/factories/descriptors/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _build_descriptor_dicts(descriptor_type, values):
3838
descriptor_type = _normalize_descriptor_type(descriptor_type)
3939
key = _descriptor_type_to_dict_key(descriptor_type)
4040
for str_or_iterable in values:
41-
if isinstance(str_or_iterable, basestring):
41+
if isinstance(str_or_iterable, str):
4242
value = str_or_iterable
4343
defaults = {}
4444
else:

edfi_performance/factories/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class RandomSuffixAttribute(factory.LazyAttribute):
8888
docstring for `UniqueIdAttribute` above.)
8989
"""
9090
def __init__(self, func, *args, **kwargs):
91-
if isinstance(func, basestring):
91+
if isinstance(func, str):
9292
unformatted_string = str(func)
9393
func = lambda o: unformatted_string
9494
self._suffix_length = kwargs.pop('suffix_length', 4)

edfi_performance/tasks/change_query/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _iterate_through_resource_table(self):
5858

5959
while True:
6060
if offset > 0 and offset % 10000 == 0:
61-
print 'Offset has reached: {}'.format(offset)
61+
print ('Offset has reached: {}'.format(offset))
6262
query = "?offset={}&limit={}&minChangeVersion={}".format(offset, limit, min_change_version)
6363
start = timeit.default_timer()
6464
endpoint = self.endpoint
@@ -72,8 +72,8 @@ def _iterate_through_resource_table(self):
7272
break
7373
offset += limit
7474

75-
print '{} Sync: {} seconds'.format(endpoint, time)
76-
print '{} results returned for {}'.format(num_of_results, endpoint)
75+
print ('{} Sync: {} seconds'.format(endpoint, time))
76+
print ('{} results returned for {}'.format(num_of_results, endpoint))
7777

7878
def _touch_get_list_endpoint(self, endpoint, query):
7979
return self._client.get_list(endpoint, query)
@@ -120,7 +120,7 @@ def _update_newest_change_version(self):
120120
if available_change_versions is not None:
121121
newest_change_version = available_change_versions['NewestChangeVersion']
122122
set_change_version_value(newest_change_version)
123-
print 'Current value of NewestChangeVersion: {}'.format(newest_change_version)
123+
print ('Current value of NewestChangeVersion: {}'.format(newest_change_version))
124124

125125
@task
126126
def finish_change_query_test_run(self):

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
astroid==1.6.5
2-
atomicwrites==1.2.1
2+
atomicwrites==1.4.0
33
attrs==18.2.0
44
autopep8==1.4
55
backports.functools-lru-cache==1.5
@@ -14,32 +14,32 @@ factory-boy==2.11.1
1414
Faker==0.8.17
1515
Flask==1.0.2
1616
funcsigs==1.0.2
17-
futures==3.2.0
17+
futures==3.1.1
1818
gevent==1.3.5
1919
greenlet==0.4.14
2020
idna==2.7
2121
ipaddress==1.0.22
2222
isort==4.3.4
2323
itsdangerous==0.24
24-
Jinja2==2.10
24+
Jinja2==2.11.3
2525
lazy-object-proxy==1.3.1
2626
locustio==0.9.0
27-
MarkupSafe==1.0
27+
MarkupSafe==2.0.1
2828
mccabe==0.6.1
2929
more-itertools==4.3.0
3030
msgpack==0.5.6
3131
pathlib2==2.3.2
3232
pbr==5.1.1
3333
pluggy==0.8.0
34-
py==1.7.0
34+
py==1.10.0
3535
pycodestyle==2.4.0
3636
pycparser==2.18
3737
pylint==1.9.2
3838
pytest==3.9.1
3939
pytest-pylint==0.13.0
4040
python-dateutil==2.7.3
4141
pyzmq==17.1.0
42-
requests==2.19.1
42+
requests==2.20.0
4343
scandir==1.9.0
4444
singledispatch==3.4.0.3
4545
six==1.11.0

run-tests.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ call C:\virtualenv\EDFI_PERFORMANCE\Scripts\activate.bat
88
REM Install test suite dependencies.
99
SET PYTHONWARNINGS=ignore:DEPRECATION
1010
python -m pip install --upgrade pip
11-
pip install -r requirements.txt
11+
pip3 install -r requirements.txt
1212

1313
REM Launch the test run.
1414
powershell -NoProfile -ExecutionPolicy Bypass -Command ". .\TestRunner.ps1; Invoke-%1Tests"

utility/generate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ def main(argv):
3737
fileName = Generator.build_file_name(['tasks', 'volume'], resource)
3838
Generator.write_file(volume, fileName)
3939

40-
print 'Boilerplate files have been written. Don\'t forget to review them carefully:'
41-
print Generator.files_created(resource)
40+
print ('Boilerplate files have been written. Don\'t forget to review them carefully:')
41+
print (Generator.files_created(resource))
4242

4343

4444
def _display_help():
45-
print """
45+
"""
4646
Code generator for creating boilerplate files to execute performance tests on a
4747
new resource - including extensions. Version {version}.
4848

0 commit comments

Comments
 (0)