summaryrefslogtreecommitdiff
path: root/docs/docsite/rst/dev_guide/testing_validate-modules.rst
Commit message (Collapse)AuthorAgeFilesLines
* ansible-test validate-module - support sidecar docs (#78904) (#78933)Jordan Borean2022-09-291-1/+0
| | | (cherry picked from commit be4807b712d83370561942aa7c3c7f2141759077)
* Validate some markup in documentation in validate-modules (#76262)Felix Fontein2021-11-111-0/+1
| | | | | | | | | | | * Validate some markup in documentation. * Add changelog fragment. * Use urlparse instead of URL regex. * Document new error code. Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* ansible-test - Move code from _data to _util. (#75495)Matt Clay2021-08-121-1/+1
| | | | | | | | | | | | | | | * Update paths to match relocated files. * Update ansible-test symlink paths. * Update path classification. * Update MANIFEST.in * Update sanity test context paths. * Update sanity ignores. * Update shebang sanity test. * Update configure-remoting-ps1 sanity test. * Update BOTMETA.yml to reflect new paths. * Update paths in collection loader comments. * Update Makefile for ansible-test. * Update docs. * Add changelog fragment.
* Remove deprecated `common.removed` module_util.Matt Clay2021-04-291-3/+2
| | | | Tests have been updated to reflect its removal as well.
* validate-modules: make sure that options that potentially contain secret ↵Felix Fontein2021-03-111-0/+1
| | | | | | | | data have no_log set (#73508) * Catch more potential errors (and increase false-positive rate). * Flag some false-positives in lib/ansible/modules/ with no_log=False. Co-authored-by: John Barker <john@johnrbarker.com>
* ansible-test: improve version number validation, validate some semantic ↵Felix Fontein2020-09-291-3/+3
| | | | | | | | | | | | versioning properties (#71679) * Validate removal versions. * Validate that removal collection versions and version_added collection versions conform to semver spec. * Validate removal version numbers in meta/runtime.yml. * Stricter validation for isodates (f.ex. YYYY-M-D is not allowed). * Improve error reporting. * Validate removal collection versions. Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Docsite: replace Latin phrases to English (#71588)Andrew Klychkov2020-09-031-1/+1
| | | | | | | | | | | | | | | | Replace Latin phrases like "e.g." and "i.e." and "etc." with English phrases. * Update docs/docsite/rst/community/committer_guidelines.rst * Update docs/docsite/rst/dev_guide/developing_modules_documenting.rst * Update docs/docsite/rst/dev_guide/developing_program_flow_modules.rst * Update docs/docsite/rst/dev_guide/module_lifecycle.rst * Update docs/docsite/rst/user_guide/intro_inventory.rst * Update docs/docsite/rst/user_guide/playbooks_loops.rst * Update docs/docsite/rst/user_guide/playbooks_reuse.rst * Update docs/docsite/rst/dev_guide/platforms/aws_guidelines.rst * Update docs/docsite/rst/dev_guide/testing.rst * Update docs/docsite/rst/dev_guide/testing_integration.rst * Update docs/docsite/rst/porting_guides/porting_guide_2.5.rst * Update docs/docsite/rst/reference_appendices/faq.rst
* validate-modules: fix version_added validation for top-level, fix error ↵Felix Fontein2020-07-281-1/+2
| | | | | | | | | | | | | | | | | codes (#70869) * Also validate top-level version_added. * Fix error code. * Produce same version_added validation error in schema than in code (and stop returning it twice). * Return correct error codes for invalid version_added for options and return values. * Add changelog. * Fix forgotten closing braket. * Accept 'historical' for some top-level version_added.
* starting metadata sunset (#69454)Brian Coca2020-06-041-8/+3
| | | | | | | | | | | | | * starting metadata sunset - purged metadata from any requirements - fix indent in generic handler for yaml content (whey metadata display was off) - make more resilient against bad formed docs - removed all metadata from docs template - remove metadata from schemas - removed mdata tests and from unrelated tests Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Rick Elrod <rick@elrod.me>
* Version source tagging (automatic and manual) for version_added and ↵Felix Fontein2020-05-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deprecation versions (#69680) * Track collection for version_added. Validate *all* version numbers in validate-modules. For tagged version numbers (i.e. version_added), consider source collection to chose validation. * Make tagging/untagging functions more flexible. * Tag all versions in doc fragments. * Tag all deprecation versions issued by code. * Make Display.deprecated() understand tagged versions. * Extend validation to enforce tagged version numbers. * Tag versions in tests. * Lint and fix test. * Mention collection name in collection loader's deprecation/removal messages. * Fix error IDs. * Handle tagged dates in Display.deprecated(). * Also require that removed_at_date and deprecated_aliases.date are tagged. * Also automatically tag/untag removed_at_date; fix sanity module removal version check. * Improve error message when invalid version number is used (like '2.14' in collections).
* Allow to deprecate options and aliases by date (#68177)Felix Fontein2020-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow to deprecate options and aliases by date instead of only by version. * Update display.deprecate(). * Adjust behavior to conform to tested behavior, extend tests, and improve C# style. * Parse date and fail on invalid date. This is mainly to make sure that people start using invalid dates, and we eventually have a mess to clean up. * C# code: improve validation and update/extend tests. * Make sure that deprecate() is not called with both date and version. * Forgot to remove no longer necessary formatting. * Adjust order of warnings in C# code. * Adjust unrelated test. * Fix grammar (and make that test pass). * Don't parse date, and adjust message to be same as in #67684. * Sanity tests: disable date in past test. * Validate-modules: validate ISO 8601 date format. * Validate-modules: switch schema declaration for deprecated_aliases to improve error messages for invalid dates. * Use DateTime instead of string for date deprecation. * Validate that date in deprecated_aliases is actually a DateTime. * Fix tests. * Fix rebasing error. * Adjust error codes for pylint, and add removed_at_date and deprecated_aliases.date checks to validate-modules. * Make deprecation date in the past error codes optional. * Make sure not both version and date are specified for AnsibleModule.deprecate() calls. * Stop using Python 3.7+ API. * Make sure errors are actually reported. Re-add 'ansible-' prefix. * Avoid crashing when 'name' isn't there. * Linting. * Update lib/ansible/module_utils/csharp/Ansible.Basic.cs Co-authored-by: Jordan Borean <jborean93@gmail.com> * Adjust test to latest change. * Prefer date over version if both end up in Display.deprecated(). Co-authored-by: Jordan Borean <jborean93@gmail.com>
* Add deprecated removed_in_version and deprecated_aliases version tests (#66920)Felix Fontein2020-05-131-0/+4
|
* Module validation: sanity check mutually_exclusive, required_if, ↵Felix Fontein2020-02-191-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | required_xxx ... (#66961) * required_if checks should have three or four parts. * Validate mutually_exclusive, required_together, required_one_of, required_if and required_by. * Simplify code. * Improve messages. * Add changelog. * Sanity check. * Update docs. * Update ignore.txt. * Don't continue with tests when terms are not strings. * Remove ignore.txt entry. * Make sure validate-modules doesn't choke on things already flagged by schema test. * Check required_if requirements list for strings.
* Replace 'message' in module parameters (#60051)Abhijeet Kasurde2020-02-181-0/+1
| | | | | | | | | | | * 'message' parameter is replaced by 'commit_message' in grafana_dashboard * 'message' parameter is replaced by 'notification_message' in datadog_monitor This change is required since 'message' as parameter name is used internally by Ansible core engine. Fixes: #39295 #45362 #47132 #59617 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* ansible-test - Add 'get' to the list of bad choices for state (#66921)Mark Chappell2020-01-301-1/+1
| | | | | | * ansible-test - Add 'get' to the list of bad choices for state * Changelog fragment
* Forbid `state=(list|info)` in modules via ansible-test sanity checkMark Chappell2020-01-291-0/+1
| | | | | | | | | | | PR #66898 This change introduces a new sanity check with code `parameter-state-invalid-choice` in the `ansible-test sanity` validator. It enforces modules not to support `list` or `info` as their `state`. Co-Authored-By: Sviatoslav Sydorenko <webknjaz@redhat.com> Co-Authored-By: Felix Fontein <felix@fontein.de>
* Add tests to make sure that the documented 'elements' matches that defined ↵Mark Chappell2020-01-281-0/+2
| | | | | | | | in argument_spec (#66385) * Add tests to make sure that the documented 'elements' matches that defined in argument_spec * Mass-add test/sanity/ignore.txt
* Add sanity test to require elements entry when argument type=list (#66386)Mark Chappell2020-01-281-0/+1
| | | | | | * Require elements entry for lists * Bulk add initial test/sanity/ignore.txt
* Sanity checks: make sure that `required` in argument spec coincides with ↵Felix Fontein2019-12-031-0/+1
| | | | | | documentation (#65437) * Add sanity test for required parameters, update ignore.txt, and add changelog.
* module sanity checks: improve alias handling (#59060)Felix Fontein2019-11-211-0/+3
| | | | | | | * add_file_common_args is only of interest on top-level. * Handle undocumented arguments in one place. * Update ignore.txt * Add changelog
* Fixes for validate-modules import handling. (#63932)Matt Clay2019-10-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * Fix validate-modules support for collections. - Relative imports now work correctly. - The collection loader is now used. - Modules are invoked as `__main__`. * Remove obsolete validate-modules code ignores. * Handle sys.exit in validate-modules. * Add check for AnsibleModule initialization. * Remove `missing-module-utils-import` check. This check does not support relative imports or collections. Instead of trying to overhaul the test, we can rely on the `ansible-module-not-initialized` test instead. * Fix badly named error codes with `c#` in the name. The `#` conflicts with comments in the sanity test ignore files. * Add changelog entries.
* typo: missing-subption-docs → missing-suboption-docs (#62180)Evgeni Golov2019-09-121-1/+1
| | | updates the name of the test and all ignore.txt entries
* validate-modules - Use error codes instead of numbers (#60711)Sam Doran2019-08-281-112/+75
|
* Relocate validate-modules for easier testing. (#60214)Matt Clay2019-08-071-1/+1
| | | | | | | | * Relocate module validator code and tests. * Fix validate-modules entry point and imports. * Fix paths and test entry points. * Fix up unit tests. * Fix shebang and execute bit.
* Relocate ansible-test code. (#60147)Matt Clay2019-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial move of `test/runner/` content. `test/runner/lib/` -> `test/lib/ansible_test/_internal/` `test/runner/` -> `test/lib/ansible_test/_internal/data/` * Initial move of `test/sanity/` content. `test/sanity/` -> `test/lib/ansible_test/_internal/data/sanity/` (except `test/sanity/ignore.txt`) * Initial move of `test/units/pytest/` content. `test/units/pytest/` -> `test/lib/ansible_test/_internal/data/pytest/` * Follow-up move of `test/runner/unit/` content. `test/lib/ansible_test/_internal/data/unit/` -> `test/lib/ansible_test/tests/unit/` * Initial move of `ansible.cfg` content. `test/units/ansible.cfg` -> `test/lib/ansible_test/_internal/data/units/ansible.cfg` `test/env/ansible.cfg` -> `test/lib/ansible_test/_internal/data/env/ansible.cfg` * Follow-up move of `data` directory. `test/lib/ansible_test/_internal/data/` -> `test/lib/ansible_test/_data/` * Update import statements. * Add missing __init__.py for unit tests. * Fix path references and miscellaneous issues.
* Render elements in module doc and sanity test for sub-options (#59244)Ganesh Nalawade2019-07-301-0/+2
| | | | | | | | | | | | | | | | | | | | * Render elements in module doc and sanity test for suboptions * Add support to render module elements value in ansible-doc output module html * Add validate-module sanity test of sunoptions. * Add current validate module failures to ignore list * Fix CI failure * fix rebase conflict * Fix CI issues * Fix review comments * Add validate-modules failure in ignore list
* removes last :doc: links in the dev guide (#58417)Alicia Cozine2019-06-261-1/+3
|
* validate-modules: new module: fail if 'type' isn't documentedPierre-Louis Bonicoli2019-06-141-0/+2
| | | | | Don't require 'type' when: - parameter name starts with an underscore
* Add a new check to ensure that module arguments are valid python identifiers ↵Matt Martz2019-03-051-1/+1
| | | | | | | | | | | | (#53278) * Add a new check to ensure that module arguments are valid python identifiers * Move the check up higher, out of the if docs block * Skip validate-modules on py2 * Remove errant alias
* validate-modules: Documentation bool (#50085)Abhijeet Kasurde2019-02-151-1/+2
| | | | | | | | | | | | | | | | | | * validate-modules: Documentation bool This check allows to catch cases where type of argument is different than documentation does. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> * Wrong comparison for 'str' Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> * Add ignore.txt Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> * Fix logic and clean up ignore.txt
* Prevent metadata changes in a stable branch (#48994)Matt Martz2018-11-261-0/+1
|
* Remove more docs build errors (#45364)Alicia Cozine2018-09-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * orphans testing pages to avoid not-in-toctree errors * orphans various pages pending reorg * adds module_utils and special_vars to main TOC * uses a glob for scenario_guide TOC * normalize and Sentence-case headings on community pages, typos * re-orgs community TOC, adds all pages to toctree * removes scenario guides index page * adds style guide to community index * basic update to style guide * fix typo that created a new error * removes not-in-toctree from ignore errors list * leave removing files for future cleanup task
* Change validate-modules for removed modulesToshio Kuratomi2018-08-241-1/+5
| | | | | Removed modules now don't have documentation. Need to account for that when checking them in validte-modules
* Add AnsibleModule signature schema, and fix associated issues (#43512)Matt Martz2018-07-311-0/+1
|
* Add shell out checks (#41545)Andrea Tartaglia2018-06-211-0/+2
| | | | | | | | | | | | | | | | | | * Added error codes for shell_out checks * Added ignore lines for allowed Modules * Added shell out checks * Fixed pep8 * Updated regex to only match subprocess.Popen * Added failing modules to ignore.txt * Wrong postgresql module in ignore.txt * Removed bigip from ignore.txt
* Argument spec must be dict/hash (#40858)Abhijeet Kasurde2018-06-201-0/+1
| | | | | validate-modules should fail when argument is not dict/hash. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Remove tab check from validate-modules.Matt Clay2018-05-211-1/+0
| | | | It is redundant with the pycodestyle W191 "indentation contains tabs" check.
* Use arg_spec type for comparisons on default and choices (#37741)Matt Martz2018-03-261-0/+4
| | | | | | | | | | | | * Use arg_spec type for comparisons on default and choices * Further improve type casting * Make sure to capture output in more places * Individually report invalid choices * Update ignore.txt after resolving merge conflicts
* Add several new doc<->arg_spec checks (#36247)Matt Martz2018-02-151-0/+3
| | | | | | * Add several new doc<->arg_spec checks. See #18183 * Update ignore.txt for validate-modules
* Module deprecation: docs, scheme and tests (#34100)John R Barker2018-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | Enforce module deprecation. After module has reached the end of it's deprecation cycle we will replace it with a docs stub. * Replace deprecated modules with docs-only sub * Use of deprecated past deprecation cycle gives meaningful message (see examples below) * Enforce documentation.deprecation dict via `schema.py` * Update `ansible-doc` and web docs to display documentation.deprecation * Document that structure in `dev_guide` * Ensure that all modules starting with `_` have a `deprecation:` block * Ensure `deprecation:` block is only used on modules that start with `_` * `removed_in` A string which represents when this module needs **deleting** * CHANGELOG.md and porting_guide_2.5.rst list removed modules as well as alternatives * CHANGELOG.md links to porting guide index To ensure that meaningful messages are given to the user if they try to use a module at the end of it's deprecation cycle we enforce the module to contain: ```python if __name__ == '__main__': removed_module() ```
* ANSIBLE_METADATA doesn't support YAML currently, change 315 to invalid data ↵Matt Martz2018-01-171-1/+1
| | | | type (#35009)
* Compare arg+aliases between docs and argument_spec (#34809)Matt Martz2018-01-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * compare arg+aliases between docs and argument_spec * Add some special handling for the network modules provider options that also appear in the top level arg spec * Fix error code for bigip_hostname * Address merge conflicts due to changes in f5 modules * Update validate-modules ignore based off a clean execution * Address merge conflicts * Address renamed module * Address recent changes to modules * Add ignore for ucs_ip_pool * Update aci modules to get more reliable documentation comparison, but not mutating the module_utils aci_argument_spec * Update ignore.txt after recent aci updates * Add extra guard to ensure we handle provider special only for network modules * Address additional changes to modules
* Extend validate-modules to check the next to last line (#34819)jctanner2018-01-151-0/+1
| | | | | | | | | | | | * Add validation for the next to last line of a module * Fix last error code * Reduce to a single conditional * Fix conditionals * Move the final warnings statement to main() in mysql_replication
* Validate modules arg spec fixes (#34477)Matt Martz2018-01-111-0/+1
| | | | | | | * Update validate-modules arg_spec introspection to be faster, by only mocking the imports we explicitly list * The use of types.MethodType in redhat_subscription wasn't py3 compatible, use partial instead * Remove argument_spec import hacks, make them errors, we can ignore them with ansible-test * Enable the --arg-spec flag for validate-modules
* Add validation test for new copyright (#32919)Will Thames2017-12-161-0/+1
| | | | | | | | | | | | | | | * Update validation test for new copyright Ensure new modules without the new copyright header fail validation Ensure existing modules without copyright in top 20 lines fail * Add documentation of 108 error Create label in developing modules documentation so that the validation page can point to it * Ensure new style copyright header passes test!
* Fix module validator handling of empty options.Matt Clay2017-12-051-0/+1
|
* Allow specific __future__ imports in modulesToshio Kuratomi2017-07-271-120/+79
| | | | | | | | | | We do want to allow certain from __future__ imports in modules that make it easier to code compatible python2 and python3. Note that unicode_literals is specifically left out and should never be allowed. Now that python-3.4+ allows u"" there's no good reason to use unicode_literals. Also switch tables in the validate_modules documentation to simple table format
* Added test for 'RETURN' field in validate-modules (#23322)Andrea Tartaglia2017-05-021-0/+2
| | | | | | | | | | | | | | * Added test for 'RETURN' field in validate-modules * print the field being tested. Useful when the RETURN structure is complex. * Fixed schema after CI traceback fail * Fixed list_string_types * Fixed line in 319 code for RETURN
* Docs how to test (2nd) (#24094)John R Barker2017-04-281-0/+181
* Big testing doc refactor * Combine all the testing documentation in to one place to make it easier to find * Convert everything to RST * Create testing_network guide * Create testing landing page * For each section detail "how to run" and "how to extend testing" * More examples * Lots more detail