From 7cce4dfbb0106d7e6a4d2375b6519e064d5cb292 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Fri, 21 Sep 2018 16:09:54 +1000 Subject: [PATCH] add skip/docker alias to skip tests when running on Docker (#45955) * add skip/docker alias to skip tests when running on Docker * changed warning message wording (cherry picked from commit 27c10fa502ca5ba95ffd80ac602ca49965a1936b) --- .../rst/dev_guide/testing/sanity/integration-aliases.rst | 1 + test/integration/targets/xattr/aliases | 1 + test/runner/lib/executor.py | 7 +++++++ 3 files changed, 9 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 aef5b93ebde..288042b8a84 100644 --- a/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst +++ b/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst @@ -42,6 +42,7 @@ Aliases can be used to skip platforms using one of the following: - ``skip/freebsd`` - Skip tests on FreeBSD. - ``skip/osx`` - Skip tests on macOS. - ``skip/rhel`` - Skip tests on RHEL. +- ``skip/docker`` - Skip tests when running on a Docker container Aliases can be used to skip Python major versions using one of the following: diff --git a/test/integration/targets/xattr/aliases b/test/integration/targets/xattr/aliases index 74008ce7c5b..4c94ddfd779 100644 --- a/test/integration/targets/xattr/aliases +++ b/test/integration/targets/xattr/aliases @@ -1,4 +1,5 @@ shippable/posix/group2 +skip/docker skip/freebsd skip/osx destructive diff --git a/test/runner/lib/executor.py b/test/runner/lib/executor.py index 7a01081316e..2911a141c5f 100644 --- a/test/runner/lib/executor.py +++ b/test/runner/lib/executor.py @@ -1429,6 +1429,13 @@ def get_integration_docker_filter(args, targets): common_integration_filter(args, targets, exclude) + skip = 'skip/docker/' + skipped = [target.name for target in targets if skip in target.aliases] + if skipped: + exclude.append(skip) + display.warning('Excluding tests marked "%s" which cannot run under docker: %s' + % (skip.rstrip('/'), ', '.join(skipped))) + if not args.docker_privileged: skip = 'needs/privileged/' skipped = [target.name for target in targets if skip in target.aliases]