diff --git a/test/integration/targets/aws_ec2_inventory/aliases b/test/integration/targets/inventory_aws_ec2/aliases similarity index 100% rename from test/integration/targets/aws_ec2_inventory/aliases rename to test/integration/targets/inventory_aws_ec2/aliases diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/create_inventory_config.yml b/test/integration/targets/inventory_aws_ec2/playbooks/create_inventory_config.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/create_inventory_config.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/create_inventory_config.yml diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/empty_inventory_config.yml b/test/integration/targets/inventory_aws_ec2/playbooks/empty_inventory_config.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/empty_inventory_config.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/empty_inventory_config.yml diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/populate_cache.yml b/test/integration/targets/inventory_aws_ec2/playbooks/populate_cache.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/populate_cache.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/populate_cache.yml diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/setup.yml b/test/integration/targets/inventory_aws_ec2/playbooks/setup.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/setup.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/setup.yml diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/tear_down.yml b/test/integration/targets/inventory_aws_ec2/playbooks/tear_down.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/tear_down.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/tear_down.yml diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/test_invalid_aws_ec2_inventory_config.yml b/test/integration/targets/inventory_aws_ec2/playbooks/test_invalid_aws_ec2_inventory_config.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/test_invalid_aws_ec2_inventory_config.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/test_invalid_aws_ec2_inventory_config.yml diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/test_inventory_cache.yml b/test/integration/targets/inventory_aws_ec2/playbooks/test_inventory_cache.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/test_inventory_cache.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/test_inventory_cache.yml diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/test_populating_inventory.yml b/test/integration/targets/inventory_aws_ec2/playbooks/test_populating_inventory.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/test_populating_inventory.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/test_populating_inventory.yml diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/test_populating_inventory_with_constructed.yml b/test/integration/targets/inventory_aws_ec2/playbooks/test_populating_inventory_with_constructed.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/test_populating_inventory_with_constructed.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/test_populating_inventory_with_constructed.yml diff --git a/test/integration/targets/aws_ec2_inventory/playbooks/test_refresh_inventory.yml b/test/integration/targets/inventory_aws_ec2/playbooks/test_refresh_inventory.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/playbooks/test_refresh_inventory.yml rename to test/integration/targets/inventory_aws_ec2/playbooks/test_refresh_inventory.yml diff --git a/test/integration/targets/aws_ec2_inventory/runme.sh b/test/integration/targets/inventory_aws_ec2/runme.sh similarity index 100% rename from test/integration/targets/aws_ec2_inventory/runme.sh rename to test/integration/targets/inventory_aws_ec2/runme.sh diff --git a/test/integration/targets/aws_ec2_inventory/templates/inventory.yml b/test/integration/targets/inventory_aws_ec2/templates/inventory.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/templates/inventory.yml rename to test/integration/targets/inventory_aws_ec2/templates/inventory.yml diff --git a/test/integration/targets/aws_ec2_inventory/templates/inventory_with_cache.yml b/test/integration/targets/inventory_aws_ec2/templates/inventory_with_cache.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/templates/inventory_with_cache.yml rename to test/integration/targets/inventory_aws_ec2/templates/inventory_with_cache.yml diff --git a/test/integration/targets/aws_ec2_inventory/templates/inventory_with_constructed.yml b/test/integration/targets/inventory_aws_ec2/templates/inventory_with_constructed.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/templates/inventory_with_constructed.yml rename to test/integration/targets/inventory_aws_ec2/templates/inventory_with_constructed.yml diff --git a/test/integration/targets/aws_ec2_inventory/test.aws_ec2.yml b/test/integration/targets/inventory_aws_ec2/test.aws_ec2.yml similarity index 100% rename from test/integration/targets/aws_ec2_inventory/test.aws_ec2.yml rename to test/integration/targets/inventory_aws_ec2/test.aws_ec2.yml diff --git a/test/integration/targets/foreman_inventory/aliases b/test/integration/targets/inventory_foreman/aliases similarity index 100% rename from test/integration/targets/foreman_inventory/aliases rename to test/integration/targets/inventory_foreman/aliases diff --git a/test/integration/targets/foreman_inventory/ansible.cfg b/test/integration/targets/inventory_foreman/ansible.cfg similarity index 100% rename from test/integration/targets/foreman_inventory/ansible.cfg rename to test/integration/targets/inventory_foreman/ansible.cfg diff --git a/test/integration/targets/foreman_inventory/runme.sh b/test/integration/targets/inventory_foreman/runme.sh similarity index 100% rename from test/integration/targets/foreman_inventory/runme.sh rename to test/integration/targets/inventory_foreman/runme.sh diff --git a/test/integration/targets/foreman_inventory/test_foreman_inventory.yml b/test/integration/targets/inventory_foreman/test_foreman_inventory.yml similarity index 100% rename from test/integration/targets/foreman_inventory/test_foreman_inventory.yml rename to test/integration/targets/inventory_foreman/test_foreman_inventory.yml diff --git a/test/integration/targets/vmware_vm_inventory/aliases b/test/integration/targets/inventory_vmware_vm_inventory/aliases similarity index 100% rename from test/integration/targets/vmware_vm_inventory/aliases rename to test/integration/targets/inventory_vmware_vm_inventory/aliases diff --git a/test/integration/targets/vmware_vm_inventory/ansible.cfg b/test/integration/targets/inventory_vmware_vm_inventory/ansible.cfg similarity index 100% rename from test/integration/targets/vmware_vm_inventory/ansible.cfg rename to test/integration/targets/inventory_vmware_vm_inventory/ansible.cfg diff --git a/test/integration/targets/vmware_vm_inventory/runme.sh b/test/integration/targets/inventory_vmware_vm_inventory/runme.sh similarity index 100% rename from test/integration/targets/vmware_vm_inventory/runme.sh rename to test/integration/targets/inventory_vmware_vm_inventory/runme.sh diff --git a/test/integration/targets/vmware_vm_inventory/test_vmware_vm_inventory.yml b/test/integration/targets/inventory_vmware_vm_inventory/test_vmware_vm_inventory.yml similarity index 100% rename from test/integration/targets/vmware_vm_inventory/test_vmware_vm_inventory.yml rename to test/integration/targets/inventory_vmware_vm_inventory/test_vmware_vm_inventory.yml diff --git a/test/runner/lib/classification.py b/test/runner/lib/classification.py index 27bf054291..bbb3a66cdf 100644 --- a/test/runner/lib/classification.py +++ b/test/runner/lib/classification.py @@ -421,6 +421,39 @@ class PathMapper(object): 'units': units_path, } + if path.startswith('lib/ansible/plugins/inventory/'): + if name == '__init__': + return all_tests(self.args) # broad impact, run all tests + + # These inventory plugins are enabled by default (see INVENTORY_ENABLED). + # Without dedicated integration tests for these we must rely on the incidental coverage from other tests. + test_all = [ + 'host_list', + 'script', + 'yaml', + 'ini', + 'auto', + ] + + if name in test_all: + posix_integration_fallback = get_integration_all_target(self.args) + else: + posix_integration_fallback = None + + target = self.integration_targets_by_name.get('inventory_%s' % name) + units_path = 'test/units/plugins/inventory/test_%s.py' % name + + if units_path not in self.units_paths: + units_path = None + + return { + 'integration': target.name if target and 'posix/' in target.aliases else posix_integration_fallback, + 'windows-integration': target.name if target and 'windows/' in target.aliases else None, + 'network-integration': target.name if target and 'network/' in target.aliases else None, + 'units': units_path, + FOCUSED_TARGET: target is not None, + } + if (path.startswith('lib/ansible/plugins/terminal/') or path.startswith('lib/ansible/plugins/cliconf/') or path.startswith('lib/ansible/plugins/netconf/')):