From 7a0e86551d21b5d48dec1702ec603433cc2429af Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 16 Nov 2018 16:38:47 -0800 Subject: [PATCH] Support skip of platforms by version in tests. (#48826) * Support skip of platforms by version in tests. Previously a remote platform could be skipped completely using the alias: `skip/{platform}` such as `skip/rhel` Now a specific platform version can be skipped using the alias: `skip/{platform}{version}` such as `skip/rhel7.6` This feature is available for platforms specified with the `--remote` option. * Add skip by version to the docs. (cherry picked from commit 8066acc90c13595039812bd8f9eb1fcaaca1a890) --- .../rst/dev_guide/testing/sanity/integration-aliases.rst | 5 +++++ test/runner/lib/executor.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst b/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst index 288042b8a84..4e143c3185f 100644 --- a/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst +++ b/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst @@ -44,6 +44,11 @@ Aliases can be used to skip platforms using one of the following: - ``skip/rhel`` - Skip tests on RHEL. - ``skip/docker`` - Skip tests when running on a Docker container +Platform versions, as specified using the ``--remote`` option with ``/`` removed, can also be skipped: + +- ``skip/freebsd11.1`` - Skip tests on FreeBSD 11.1. +- ``skip/rhel7.6`` - Skip tests on RHEL 7.6. + Aliases can be used to skip Python major versions using one of the following: - ``skip/python2`` - Skip tests on Python 2.x. diff --git a/test/runner/lib/executor.py b/test/runner/lib/executor.py index 7045d478c90..3d0757cb9b4 100644 --- a/test/runner/lib/executor.py +++ b/test/runner/lib/executor.py @@ -1628,6 +1628,13 @@ def get_integration_remote_filter(args, targets): display.warning('Excluding tests marked "%s" which are not supported on %s: %s' % (skip.rstrip('/'), platform, ', '.join(skipped))) + skip = 'skip/%s/' % args.remote.replace('/', '') + skipped = [target.name for target in targets if skip in target.aliases] + if skipped: + exclude.append(skip) + display.warning('Excluding tests marked "%s" which are not supported on %s: %s' + % (skip.rstrip('/'), platform, ', '.join(skipped))) + python_version = 2 # remotes are expected to default to python 2 skip = 'skip/python%d/' % python_version