add skip/docker alias to skip tests when running on Docker (#45955) (#45959)

* add skip/docker alias to skip tests when running on Docker

* changed warning message wording

(cherry picked from commit 27c10fa502)
pull/46131/head
Jordan Borean 6 years ago committed by Matt Davis
parent 65fa6c17a7
commit c484a6efdd

@ -42,6 +42,7 @@ Aliases can be used to skip platforms using one of the following:
- ``skip/freebsd`` - Skip tests on FreeBSD. - ``skip/freebsd`` - Skip tests on FreeBSD.
- ``skip/osx`` - Skip tests on macOS / OS X. - ``skip/osx`` - Skip tests on macOS / OS X.
- ``skip/rhel`` - Skip tests on RHEL. - ``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: Aliases can be used to skip Python major versions using one of the following:

@ -1,4 +1,5 @@
shippable/posix/group2 shippable/posix/group2
skip/docker
skip/freebsd skip/freebsd
skip/osx skip/osx
destructive destructive

@ -1429,6 +1429,13 @@ def get_integration_docker_filter(args, targets):
common_integration_filter(args, targets, exclude) 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: if not args.docker_privileged:
skip = 'needs/privileged/' skip = 'needs/privileged/'
skipped = [target.name for target in targets if skip in target.aliases] skipped = [target.name for target in targets if skip in target.aliases]

Loading…
Cancel
Save