Commit graph

103 commits

Author SHA1 Message Date
Matt Clay
eec01e2137 Set IO encoding for ansible-test on Shippable. 2017-04-08 23:06:44 -07:00
Matt Clay
dfe8eca3d2 Update Shippable downloader to support new API.
- Download run/jobs by URL (old or new).
- Download run metadata.
- Download job metadata.
- Format downloaded JSON.
- Handle and save coverage/testresults download errors.
2017-03-24 14:24:38 -07:00
Matt Clay
12f6beaebd Remove python2.4 package install from other test. 2017-03-15 16:40:05 -07:00
Matt Clay
869449e288 Add test verification to ansible-test. (#22636)
* Add unified git diff parser.
* Add metadata and diff handling.
* Add test confidence/verification to bot output.
2017-03-15 12:17:42 -07:00
Matt Clay
89559f78de Add --failure-ok option to ansible-test. (#22623) 2017-03-14 16:32:21 -07:00
Matt Clay
a64665ae91 Fix error handling in CI other script. 2017-03-08 01:31:53 -08:00
Matt Clay
3ab344e8bd Use lint/junit output for compile test. (#22395)
* Refactor sanity classes for use in all tests.
* Use lint/junit output for compile test.
* Add missing options for compile test.
* Fix early bailout on requirements install.
2017-03-08 00:47:21 -08:00
Matt Clay
9acf551674 Run all other tests on Shippable before failing. 2017-03-07 20:26:10 -08:00
Matt Clay
8f463fcdd2 Create bot friendly sanity output. (#22381) 2017-03-07 14:59:50 -08:00
Matt Clay
72c96b3ac3 Fix encoding issue in shippable downloader. 2017-03-03 16:38:36 -08:00
Matt Clay
d66ce40ecb Overhaul ansible-test sanity implementation. (#22177)
- Tests are run to completion instead of stopping on first failure.
- Test results are now parsed instead of passing through to the console.
- Test results can be saved in junit xml format.
- Test results will show up on the Shippable "Tests" result tab.
- Added an experimental --lint option for easier integration with other tools.
- Code smell tests are now usable with the --list-tests, --test and --skip-test options.
- Code split out from executor.py into sanity.py.
- Rename download-logs to download.py and add support for test and coverage results.
- Miscellaneous improvements.
2017-03-02 12:36:46 -08:00
Matt Clay
ae2d2860f5 Reduce CI output processing code coverage. 2017-02-27 22:39:35 -08:00
Matt Clay
2804d2e848 Split up unit tests on Shippable. (#21931)
* Add more verbose output to coverage combine.
* Run unit tests on CI separately by version.
2017-02-24 16:58:56 -08:00
Matt Clay
b2bd75a408 Restore 2008-SP2 and 2008-R2_SP1 CI testing. 2017-02-21 20:55:25 -08:00
Matt Davis
8527013fbe Complete rewrite of Windows exec wrapper (#21510)
* supports pipelining for faster execution
* supports become (runas), creates interactive subsession under WinRM batch logon
* supports usage of arbitrary module_utils files
* modular exec wrapper payload supports easier extension
* integrates async wrapper behavior for pipelined/become'd async
* module_utils are loaded as true Powershell modules, no more runtime modifications to module code
2017-02-17 00:09:56 -08:00
Matt Clay
f16ee2841b Add retries to Shippable CI scripts. (#21108)
* Add retry.py for auto-retry in CI scripts.
* Add retries to other and units CI scripts.
2017-02-07 16:33:45 -08:00
Matt Clay
f42fa8879b Temporarily remove Windows Server 2016 from CI. 2017-01-27 11:56:50 -08:00
Matt Clay
7ed67746cf Enable Windows 2016 on Shippable.
Also launch Windows instances on us-east-2 and all others on us-east-1.
2017-01-18 18:37:42 -08:00
Matt Clay
3c51ce56fd Enable more network support in ansible-test. (#20372)
* Only start platform instances with tests selected.
* Enable ios on Shippable.
* Show inventory in explain mode.
* Fix indentation of generated network inventory.
* Update classification of network module_utils.
2017-01-17 16:24:05 -08:00
Matt Clay
203e375449 Fix python 3.6 install. 2017-01-13 15:30:27 -08:00
Matt Clay
f534573dcf Enable first network tests on Shippable. (#20208) 2017-01-12 18:23:53 -08:00
Matt Clay
cd3fdca540 Switch tests to pytest and ansible-test.
- Replace nose usage with pytest.
- Remove legacy Shippable integration.sh.
- Update Makefile to use pytest and ansible-test.
- Convert most yield unit tests to pytest parametrize.
2017-01-11 12:34:59 -08:00
Matt Clay
f340b8d14f Add test support for python 3.6. 2017-01-10 14:34:42 -08:00
Matt Clay
422857166b Remove legacy test alias migration script. (#19629)
* Require code-smell tests to be files.
* Add sanity check for integration test aliases.
* Remove migration script for test aliases.
2016-12-21 16:46:28 -08:00
Matt Clay
f789a20f29 Update log download url. 2016-12-13 16:26:10 -08:00
Toshio Kuratomi
c6b42028c4 Fixes for uri under python3 and local (non-httptester) testing 2016-12-13 15:46:07 -08:00
Matt Clay
dab2bf7e13 Skip test_uri on python 3. 2016-12-13 13:51:57 -08:00
Lumír 'Frenzy' Balhar
84544ee8fd Fix AST nodes for Python 3 and enable dependent test_uri (#18597)
* Enable tests on python 3 for uri

* Added one more node type to SAFE_NODES into safe_eval module.

ast.USub represents unary operators. This is necessary for
parsing some unusual but still valid JSON files during testing
with Python 3.
2016-12-13 07:37:39 -08:00
Matt Clay
f9c4158ff8 Remove core/extras dirs from old PRs during CI. 2016-12-12 12:41:26 -08:00
Matt Clay
580401c02b Remove legacy test code. 2016-12-08 11:35:20 -05:00
Matt Clay
4da7a7ce0e Update coverage exclusions. (#18675)
* Update coverage exclusions.
* Fix logic error in Windows change detection.
2016-11-29 22:46:56 -08:00
Matt Clay
6bbd92e422 Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
Adrien Vergé
527d8307c1 Lint YAML files under test/
This commit extends YAML linting by enabling standard rules from the
`yamllint` tool [1]. Since syntax errors and key duplicates are already
checked since 4d48711, this change only adds detection for cosmetic
problems. It also narrows checks to the test/ dir only.

The main goal is to prevent future problems to enter the code base
without being noticed. While it would be a huge effort to be PEP8
compliant, it is relatively easy to have correct YAML style *now* and
prevent future errors by enabling linting.

Note: for those (like me) caring about code attribution: use `git blame
-w` to ignore whitespace-only changes.

Note: I disabled some linting checks (such as indentation), they can be
enforced in the future if needed. Similarly, current checks can also be
disabled. See the `.yamllint` file.

[1]: https://yamllint.readthedocs.io/
2016-11-11 14:50:57 -08:00
Matt Clay
c955688772 Move ansible ad-hoc tests to integration targets. 2016-11-10 23:58:32 -08:00
Matt Clay
912d6ed8cc Clean up code-smell sanity scripts. (#18407)
- Replace find ';' with '+' for faster execution.
- Replace grep -R with -r to avoid recursive warnings.
- Exclude .git and .tox directories from recursive grep.
- Improve messaging on failed sanity checks.
- Add no-basestring check to Shippable.
2016-11-07 16:46:33 -08:00
Matt Clay
8c270ac75f Add empty-init code-smell script. (#18406)
Also removed boilerplate from otherwise empty __init__.py files
which should not contain any code (checked by empty-init script).
2016-11-07 15:02:13 -08:00
Matt Clay
ecb7f13119 Update log url for Shippable download-logs script.
Also improved error handling.
2016-11-07 10:07:42 -08:00
Matt Clay
469c4a106b Fix and create code-smell test for line endings. 2016-11-03 14:58:11 -07:00
Matt Clay
0d46805979 Clean up shebangs for various files.
- Remove shebangs from:
  - ini files
  - unit tests
  - module_utils
  - plugins
  - module_docs_fragments
  - non-executable Makefiles
- Change non-modules from '/usr/bin/python' to '/usr/bin/env python'.
- Change '/bin/env' to '/usr/bin/env'.

Also removed main functions from unit tests (since they no longer
have a shebang) and fixed a python 3 compatibility issue with
update_bundled.py so it does not need to specify a python 2 shebang.

A script was added to check for unexpected shebangs in files.
This script is run during CI on Shippable.
2016-11-02 17:00:27 -07:00
Matt Clay
71819c0a60 Test reorganization and cleanup. (#18270)
- Correct directory name in test/README.md
- Move code-smell tests to test/sanity/code-smell
- Update code-smell.sh to use new script paths
- Add test/integration/target-prefixes.win for ansible-test
- Move module unit tests to match module directory layout
2016-10-31 12:53:11 -07:00
Toshio Kuratomi
2ac12432ef Enable the git test on py3 2016-10-21 09:03:35 -07:00
Michael Scherer
2804e64ed5 Enable filters test for python 3 2016-10-20 23:36:55 -07:00
Toshio Kuratomi
67ac375188 pip tests now pass on python3. Enable them. 2016-10-20 13:58:30 -07:00
Michael Scherer
578da9a615 Enable test for lookups on python 3
Since passlib algo sometime takes a bytes, and sometime
not, depending on a internal variable, we have to convert
bnased on it, or it fail with "TypeError: salt must be bytes,
not str" (or unicode instead of bytes)

However, that's not great to use internal structure for that.
2016-10-20 13:22:59 -07:00
Michael Scherer
e93a8814a3 Let authorized_keys be tested on python 3 2016-10-20 10:29:14 -07:00
Toshio Kuratomi
60acfd1e87 Fix ansible-pull on python3
On python3, we can't write bytes directly to sys.stdout.
2016-10-17 16:31:08 -07:00
Toshio Kuratomi
fd14048d46 Thanks to mscherer, these tests are now passing 2016-10-17 15:39:30 -07:00
Toshio Kuratomi
91c1fdec3d unarchive tests now pass on python3 2016-10-15 08:50:13 -07:00
John R Barker
0ef3ff6a9d Install dependencies for validate-modules (#18028)
Currently (pre-repomerge) we aren't running sanity.sh from
ansible/ansible, after the merge we will. Therefore I've added the
requirements here, rather than in ansible-modules-*/test/utils/shippable
2016-10-14 12:23:29 +01:00
Matt Clay
656b82417e Fix role path for generate-tests. 2016-10-13 13:04:48 -07:00