Commit 6a7c2667 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

wip

parent ff5db8a0
......@@ -28,6 +28,7 @@
#
##############################################################################
from __future__ import print_function
import argparse
import os
import sys
......@@ -264,7 +265,7 @@ class PerformanceTester(object):
error_message = exit_msg_queue.get()
except KeyboardInterrupt, e:
print >>sys.stderr, "\nInterrupted by user, stopping gracefully..."
print("\nInterrupted by user, stopping gracefully...", file=sys.stderr)
exit_status = 2
# An IOError may be raised when receiving a SIGINT which interrupts the
......@@ -337,7 +338,7 @@ class PerformanceTester(object):
def main():
error_message_set, exit_status = PerformanceTester().run()
for error_message in error_message_set:
print >>sys.stderr, "ERROR: %s" % error_message
print("ERROR: %s" % error_message, file=sys.stderr)
sys.exit(exit_status)
......
......@@ -31,6 +31,7 @@
#
##############################################################################
from __future__ import print_function
import argparse
import re
......@@ -537,7 +538,7 @@ def generateReport():
for filename in filename_iter:
# There may be no results at all in case of errors
if not os.stat(filename).st_size:
print >>sys.stderr, "Ignoring empty file %s" % filename
print("Ignoring empty file %s" % filename, file=sys.stderr)
continue
report_dict = per_nb_users_report_dict.setdefault(
......@@ -546,8 +547,8 @@ def generateReport():
report_dict['filename'].append(filename)
if not per_nb_users_report_dict:
print >>sys.stderr, "ERROR: No result file found, perhaps "\
"``--filename-prefix'' should be specified?"
print("ERROR: No result file found, perhaps "\
"``--filename-prefix'' should be specified?", file=sys.stderr)
sys.exit(1)
......
......@@ -28,6 +28,7 @@
#
##############################################################################
from __future__ import print_function
from .result import CSVBenchmarkResult, NothingFlushedException
class CSVScalabilityBenchmarkResult(CSVBenchmarkResult):
......@@ -60,7 +61,7 @@ class ScalabilityTester(PerformanceTester):
urllib.urlencode({'error_message_set': '|'.join(error_message_set)})).close()
except:
print >>sys.stderr, "ERROR: %s" % Formatter().formatException(sys.exc_info())
print("ERROR: %s" % Formatter().formatException(sys.exc_info()), file=sys.stderr)
def getResultClass(self):
if not self._argument_namespace.erp5_publish_url:
......
......@@ -8,6 +8,7 @@
#
# TODO: There must be a better way than the code below to do that though...
from __future__ import print_function
import sys
from erp5.util.testbrowser.browser import Browser
......@@ -19,9 +20,9 @@ try:
user_nbr = int(user_nbr)
except ValueError:
print >>sys.stderr, "ERROR: Missing arguments: %s URL USERNAME " \
print("ERROR: Missing arguments: %s URL USERNAME " \
"PASSWORD NUMBER_OF_USERS NEW_USERNAME_PREFIX NEW_USERS_PASSWORD" % \
sys.argv[0]
sys.argv[0], file=sys.stderr)
sys.exit(1)
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from erp5.util.testbrowser.browser import Browser
ITERATION = 20
......@@ -89,4 +90,4 @@ if __name__ == '__main__':
counter += 1
for title, time_list in result_dict.iteritems():
print "%s: %.4fs" % (title, float(sum(time_list)) / ITERATION)
print("%s: %.4fs" % (title, float(sum(time_list)) / ITERATION))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment