Fix ansible-test vcenter test filtering.

The default behavior of the ansible-test vcenter plugin is to use the govcsim container to run tests.

However, unless the govcsim mode was specified using the VMWARE_TEST_PLATFORM environment variable, the filter code would skip the tests unless the tests ran on Shippable or the user had an ansible-core-ci key.

Now the filter correctly recognizes that govcsim is the default.
This commit is contained in:
Matt Clay 2019-09-12 01:48:06 -07:00
parent cdc4926340
commit cd4882e229
2 changed files with 5 additions and 3 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ansible-test now properly activates the vcenter plugin for vcenter tests when docker is available

View file

@ -61,7 +61,7 @@ class VcenterProvider(CloudProvider):
:type targets: tuple[TestTarget] :type targets: tuple[TestTarget]
:type exclude: list[str] :type exclude: list[str]
""" """
if self.vmware_test_platform == 'govcsim': if self.vmware_test_platform == 'govcsim' or (self.vmware_test_platform == '' and not os.path.isfile(self.config_static_path)):
docker = find_executable('docker', required=False) docker = find_executable('docker', required=False)
if docker: if docker:
@ -72,8 +72,8 @@ class VcenterProvider(CloudProvider):
if skipped: if skipped:
exclude.append(skip) exclude.append(skip)
display.warning('Excluding tests marked "%s" which require the "docker" command: %s' display.warning('Excluding tests marked "%s" which require the "docker" command or config (see "%s"): %s'
% (skip.rstrip('/'), ', '.join(skipped))) % (skip.rstrip('/'), self.config_template_path, ', '.join(skipped)))
else: else:
if os.path.isfile(self.config_static_path): if os.path.isfile(self.config_static_path):
return return