aboutsummaryrefslogtreecommitdiffstats
path: root/testing/command.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/command.py')
-rw-r--r--testing/command.py78
1 files changed, 27 insertions, 51 deletions
diff --git a/testing/command.py b/testing/command.py
index 307a59761..31a48f87c 100644
--- a/testing/command.py
+++ b/testing/command.py
@@ -1,41 +1,5 @@
-#############################################################################
-##
-## Copyright (C) 2017 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:LGPL$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU Lesser General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU Lesser
-## General Public License version 3 as published by the Free Software
-## Foundation and appearing in the file LICENSE.LGPL3 included in the
-## packaging of this file. Please review the following information to
-## ensure the GNU Lesser General Public License version 3 requirements
-## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 2.0 or (at your option) the GNU General
-## Public license version 3 or any later version approved by the KDE Free
-## Qt Foundation. The licenses are as published by the Free Software
-## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-2.0.html and
-## https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
"""
testrunner
@@ -70,23 +34,24 @@ The full mode can be tested locally by setting
export COIN_RERUN_FAILED_ONLY=0
"""
+import argparse
import os
import sys
-import argparse
-from textwrap import dedent
from collections import OrderedDict
+from textwrap import dedent
from timeit import default_timer as timer
-from .helper import script_dir, decorate
-from .buildlog import builds
from .blacklist import BlackList
-from .runner import TestRunner
+from .buildlog import builds
+from .helper import decorate, script_dir
from .parser import TestParser
+from .runner import TestRunner
# Should we repeat only failed tests?
COIN_RERUN_FAILED_ONLY = True
COIN_THRESHOLD = 3 # report error if >=
COIN_TESTING = 5 # number of runs
+TIMEOUT = 20 * 60
if os.environ.get("COIN_RERUN_FAILED_ONLY", "1").lower() in "0 f false n no".split():
COIN_RERUN_FAILED_ONLY = False
@@ -95,6 +60,14 @@ if os.environ.get("COIN_RERUN_FAILED_ONLY", "1").lower() in "0 f false n no".spl
def test_project(project, args, blacklist, runs):
ret = []
+ if "pypy" in builds.classifiers:
+ # As long as PyPy has so many bugs, we use 1 test only...
+ global COIN_TESTING
+ COIN_TESTING = runs = 1
+ # ...and extend the timeout.
+ global TIMEOUT
+ TIMEOUT = 100 * 60
+
# remove files from a former run
for idx in range(runs):
index = idx + 1
@@ -106,6 +79,8 @@ def test_project(project, args, blacklist, runs):
for idx in range(runs):
index = idx + 1
runner = TestRunner(builds.selected, project, index)
+ # For the full Python version we need to ask the TestRunner.
+ builds.set_python_version(runner.get_python_version())
print()
print(f"********* Start testing of {project} *********")
print("Config: Using", " ".join(builds.classifiers))
@@ -120,7 +95,7 @@ def test_project(project, args, blacklist, runs):
break
else:
rerun = None
- runner.run(f"RUN {idx + 1}:", rerun, 10 * 60)
+ runner.run(f"RUN {idx + 1}:", rerun, TIMEOUT)
results = TestParser(runner.logfile)
r = 5 * [0]
rerun_list = []
@@ -154,7 +129,7 @@ def test_project(project, args, blacklist, runs):
print("FATAL ERROR:", fatal)
print("Repetitions cancelled!")
break
- return ret, fatal
+ return ret, fatal, runs
def main():
@@ -261,14 +236,15 @@ def main():
key, value = things
os.environ[key] = value
+ version = sys.version.replace("\n", " ")
print(
dedent(
- """\
+ f"""\
System:
- Platform={sys.__dict__["platform"]}
- Executable={sys.__dict__["executable"]}
- Version={sys.version.replace("\n", " ")}
- API version={sys.__dict__["api_version"]}
+ Platform={sys.platform}
+ Executable={sys.executable}
+ Version={version}
+ API version={sys.api_version}
Environment:"""
)
@@ -284,7 +260,7 @@ def main():
# now loop over the projects and accumulate
fatal = False
for project in args.projects:
- res, fatal = test_project(project, args, bl, runs)
+ res, fatal, runs = test_project(project, args, bl, runs)
if fatal:
runs = 1
for idx, r in enumerate(res):