aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-11-13 08:38:37 -0500
committerJack Lloyd <[email protected]>2020-11-13 08:38:37 -0500
commit6d12cb77550bb3d437c343d87bbc44d46be999b2 (patch)
tree1e32407470a7301fbb7d72fd225c70d80e8168f7 /src
parent9b9e71c693cbc750ff45e0cfc24dde0d2f9d8916 (diff)
parent65810121508f1e5a64c44e19f7ba85bd6a7e12e8 (diff)
Merge GH #2494 Avoid running slow CLI tests in most CI builds
Diffstat (limited to 'src')
-rwxr-xr-xsrc/scripts/ci_build.py9
-rwxr-xr-xsrc/scripts/test_cli.py13
-rwxr-xr-xsrc/scripts/test_cli_crypt.py4
3 files changed, 18 insertions, 8 deletions
diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py
index 8bcee4850..8204fdae2 100755
--- a/src/scripts/ci_build.py
+++ b/src/scripts/ci_build.py
@@ -573,12 +573,13 @@ def main(args=None):
if target in ['shared', 'coverage'] and options.os != 'windows':
botan_exe = os.path.join(root_dir, 'botan-cli.exe' if options.os == 'windows' else 'botan')
+ args = ['--threads=%d' % (options.build_jobs)]
+ if target == 'coverage':
+ args.append('--run-slow-tests')
test_scripts = ['test_cli.py', 'test_cli_crypt.py']
for script in test_scripts:
- cmds.append([py_interp,
- os.path.join(root_dir, 'src/scripts', script),
- '--threads=%d' % (options.build_jobs),
- botan_exe])
+ cmds.append([py_interp, os.path.join(root_dir, 'src/scripts', script)] +
+ args + [botan_exe])
python_tests = os.path.join(root_dir, 'src/scripts/test_python.py')
diff --git a/src/scripts/test_cli.py b/src/scripts/test_cli.py
index 71abdc2e8..4f695b1ec 100755
--- a/src/scripts/test_cli.py
+++ b/src/scripts/test_cli.py
@@ -1313,6 +1313,7 @@ def main(args=None):
parser.add_option('--verbose', action='store_true', default=False)
parser.add_option('--quiet', action='store_true', default=False)
parser.add_option('--threads', action='store', type='int', default=0)
+ parser.add_option('--run-slow-tests', action='store_true', default=False)
(options, args) = parser.parse_args(args)
@@ -1341,8 +1342,7 @@ def main(args=None):
logging.error("Invalid regex: %s", str(e))
return 1
- # some of the slowest tests are grouped up front
- test_fns = [
+ slow_test_fns = [
cli_speed_tests,
cli_speed_pk_tests,
cli_speed_math_tests,
@@ -1350,7 +1350,9 @@ def main(args=None):
cli_speed_table_tests,
cli_speed_invalid_option_tests,
cli_xmss_sign_tests,
+ ]
+ fast_test_fns = [
cli_argon2_tests,
cli_asn1_tests,
cli_base32_tests,
@@ -1395,6 +1397,13 @@ def main(args=None):
cli_version_tests,
]
+ test_fns = []
+
+ if options.run_slow_tests:
+ test_fns = slow_test_fns + fast_test_fns
+ else:
+ test_fns = fast_test_fns
+
tests_to_run = []
for fn in test_fns:
fn_name = fn.__name__
diff --git a/src/scripts/test_cli_crypt.py b/src/scripts/test_cli_crypt.py
index 6160d0369..f54b90e71 100755
--- a/src/scripts/test_cli_crypt.py
+++ b/src/scripts/test_cli_crypt.py
@@ -165,16 +165,16 @@ def main(args=None):
parser = argparse.ArgumentParser(description="")
parser.add_argument('cli_binary', help='path to the botan cli binary')
- parser.add_argument('--max-tests', type=int, default=50, metavar="M")
parser.add_argument('--threads', type=int, default=0, metavar="T")
parser.add_argument('--verbose', action='store_true', default=False)
parser.add_argument('--quiet', action='store_true', default=False)
+ parser.add_argument('--run-slow-tests', action='store_true', default=False)
args = parser.parse_args()
setup_logging(args)
cli_binary = args.cli_binary
- max_tests = args.max_tests
+ max_tests = 0 if args.run_slow_tests else 50
threads = args.threads
if threads == 0: