GithubHelp home page GithubHelp logo

sivel / ansible-testing Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 11.0 130 KB

Python module to help test or validate Ansible, specifically ansible modules

License: GNU General Public License v3.0

Python 100.00%

ansible-testing's Introduction

WARNING: This repository is no longer active, the code has been merged into the main Ansible repository.

ansible-testing

Python module to help test or validate Ansible, specifically ansible modules

Installation

This module must be installed alongside the current development release of Ansible to appropriately test the current development state of modules.

Usage

pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible
pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing
ansible-validate-modules /path/to/ansible-modules-extras

Help

usage: ansible-validate-modules [-h] [-w] [--exclude EXCLUDE] modules

positional arguments:
  modules            Path to module or module directory

optional arguments:
  -h, --help         show this help message and exit
  -w, --warnings     Show warnings
  --exclude EXCLUDE  RegEx exclusion pattern

Current Validations

Modules

Errors

  1. Interpreter line is not #!/usr/bin/python
  2. main() not at the bottom of the file
  3. Module does not import ansible.module_utils.basic
  4. Missing DOCUMENTATION
  5. Documentation is invalid YAML
  6. Invalid schema for DOCUMENTATION
  7. Missing EXAMPLES
  8. Invalid Python Syntax
  9. Tabbed indentation
  10. Use of sys.exit() instead of exit_json or fail_json
  11. Missing GPLv3 license header in module
  12. Powershell module missing WANT_JSON
  13. Powershell module missing POWERSHELL_COMMON
  14. New modules have the correct version_added
  15. New arguments have the correct version_added
  16. Modules should not import requests, instead use ansible.module_utils.urls
  17. Missing RETURN for new modules

Warnings

  1. Try/Except HAS_ expression missing
  2. Missing RETURN for existing modules
  3. import json found
  4. Module contains duplicate globals from basic.py

Module Directories (Python Packages)

  1. Missing __init__.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.