theforeman / foreman-ansible-modules

Ansible modules for interacting with the Foreman API and various plugin APIs such as Katello
GNU General Public License v3.0
148 stars 165 forks source link

Create test playbooks #77

Closed mdellweg closed 5 years ago

mdellweg commented 6 years ago
claudiol commented 6 years ago

What kind of help do you need here? I'd be happy to look at this during our shutdown.

mdellweg commented 6 years ago

@claudiol thank you in advance. We are looking for playbooks in test\test_playbooks that are self contained. They should target the features of a specific module and be able to run against an actual foreman instance. The structure would usually be something like setup -> run tests -> clean up. For inspiration, take a look at product and organization.

mdellweg commented 6 years ago

Take a look at #76, too, if you like.

claudiol commented 6 years ago

Ok I have the realm playbook done. I will add a pull request for you guys to review.

akofink commented 6 years ago

76 is merged. #86 is ACK'd.

mdellweg commented 6 years ago

Since #76 is merged, the playbooks need a slightly different structure. There are now two hosts in the inventory:

mdellweg commented 5 years ago

Ping /me @sean797 @evgeni is this list up to date?

evgeni commented 5 years ago

(generated with:

import glob

# copied from test_crud, no idea why I can't import that directly
TESTED_MODULES = [
    'activation_key',
    'compute_profile',
    'content_credential',
    'content_view',
    'content_view_filter',
    'domain',
    'environment',
    'global_parameter',
    'installation_medium',
    'job_template',
    'lifecycle_environment',
    'location',
    'operating_system',
    'organization',
    'os_default_template',
    'product',
    'provisioning_template',
    'ptable',
    'redhat_manifest',
    'repository',
    'repository_set',
    'repository_sync',
    'search_facts',
    'setting',
    'subnet',
    'sync_plan',
    'upload',
]

modules = glob.glob('modules/*.py')
modules.sort()

for module in modules:
    module = module.replace('modules/', '')
    module = module.replace('.py', '')
    full_module = module
    module = module.replace('foreman_', '')
    module = module.replace('katello_', '')
    if module == '__init__':
        continue
    if module in TESTED_MODULES:
        x = 'x'
    else:
        x = ' '
    print("- [{}] {}".format(x, full_module))
sean797 commented 5 years ago

Awesome, we can ignore katello_content_view_publish & katello_content_view_version_promote since they are deprecated

mdellweg commented 5 years ago

setting_facts is tested together with setting and deprecated btw. I think, that leaves us with realm and manifest and compute_resource. For the last one, there is a promising PR https://github.com/theforeman/foreman-ansible-modules/pull/231

mdellweg commented 5 years ago

Getting there... Thanks @bagasse for the last addition!

Fobhep commented 5 years ago

@evgeni something is strange in the last overview: there is a test for compute_resource, your list shows none.

evgeni commented 5 years ago

@Fobhep my tardis was broken :)

evgeni commented 5 years ago

updated

evgeni commented 5 years ago

updated @mdellweg's post with the latest list

mdellweg commented 5 years ago

This is to be closed with #383, right?

evgeni commented 5 years ago

Yes!