Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

pytest collect-only against azure provider returns both azure-common and azure-msdn tests #9968

Open
jeffreyluo0428 opened this issue Mar 4, 2020 · 2 comments

Comments

@jeffreyluo0428
Copy link

Add the azure info in data.yaml as follows:

    azure:
      name: ms azure
      type: azure
      server_zone: default
      region: East US
      region_name: East US
      tenant_id: xxxxxxxx
      subscription_id: xxxxxxx
      endpoints:
          default:
              credentials: azure
      tags:
          - default

Run "pytest --collect-only --use-provider azure cfme/tests/cloud/test_providers.py". returns both common and msdn tests:

collected 49 items / 7 deselected / 42 selected                                                                 
<Package /root/repos/integration_tests/cfme/tests/cloud>
  <Module test_providers.py>
    <Function test_cloud_provider_crud[azure-common]>
    <Function test_cloud_provider_crud[azure-msdn]>
    <Function test_add_cancelled_validation_cloud>
    <Function test_cloud_provider_add_with_bad_credentials[azure-common]>
    <Function test_cloud_provider_add_with_bad_credentials[azure-msdn]>
    <Function test_type_required_validation_cloud>
    <Function test_name_required_validation_cloud>
    <Function test_region_required_validation>
    <Function test_host_name_required_validation_cloud>
    <Function test_api_port_blank_validation>
    <Function test_name_max_character_validation_cloud>
    <Function test_hostname_max_character_validation_cloud>
    <Function test_api_port_max_character_validation_cloud>
    <Function test_azure_subscription_required[azure-common]>
    <Function test_azure_subscription_required[azure-msdn]>
    <Function test_azure_multiple_subscription[azure-msdn-azure]>
    <Function test_refresh_with_empty_iot_hub_azure[azure]>
    <Function test_regions_gov_azure[azure]>
    <Function test_openstack_provider_has_api_version>
    <Function test_openstack_provider_has_dashboard>
    <Function test_azure_instance_password_requirements[azure-common]>
    <Function test_azure_instance_password_requirements[azure-msdn]>
    <Function test_cloud_names_grid_floating_ips>
    <Function test_display_network_topology>
    <Class TestProvidersRESTAPI>
        <Function test_cloud_networks_query[azure-common-from_detail]>
        <Function test_security_groups_query[azure-common]>
        <Function test_cloud_networks_query[azure-common-from_collection]>
        <Function test_security_groups_query[azure-msdn]>
        <Function test_cloud_networks_query[azure-msdn-from_detail]>
        <Function test_cloud_networks_query[azure-msdn-from_collection]>
    <Function test_tagvis_provision_fields[cloud]>
    <Function test_vpc_env_selection[azure]>
    <Function test_add_ec2_provider_with_sts_assume_role>

============================================= 7 deselected in 0.67s =============================================
collecting artifacts                                             

Expect to see only azure-common testcases collected

@tpapaioa
Copy link
Contributor

The string passed to --use-provider is used to match on either the provider key or on one of its tags. This behavior is due to the fact that there is also a provider tag named 'azure' in the yaml file, on both the azure and azure_msdn providers. A workaround/fix would be either to remove/change the name of the tag, or to change the provider key for 'azure' to something unique, e.g., 'azure-common'.

@mshriver
Copy link
Member

@jeffreyluo0428 Thanks for reporting your test collection issue!

Can you confirm that you only have one azure provider defined in your cfme_data.yaml when you run the test collection? I think @tpapaioa is assuming you have multiple providers that include the azure tag.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants