Commit graph

108 commits

Author SHA1 Message Date
Matt Clay
89a022b6a0 Update handling of the non_local test alias.
Previously the alias disabled all code coverage collection.
Now it only disables Ansible module code coverage collection.
2019-03-22 16:05:24 -07:00
Matt Clay
a8e328f474
Overhaul ansible-test code coverage and injector. (#53510) 2019-03-13 07:14:12 -07:00
Matt Clay
8535c05b29 Add ansible-test finally block after tests run.
This will record data from passing tests even when tests fail.
2019-03-07 18:31:02 -08:00
Jordan Borean
8ef2e6da05 Add support for Windows hosts in the SSH connection plugin (#47732)
* Add support for Windows hosts in the SSH connection plugin

* fix Python 2.6 unit test and sanity issues

* fix up connection tests in CI, disable SCP for now

* ensure we don't pollute the existing environment during the test

* Add connection_windows_ssh to classifier

* use test dir for inventory file

* Required powershell as default shell and fix tests

* Remove exlicit become_methods on connection

* clarify console encoding comment

* ignore recent SCP errors in integration tests

* Add cmd shell type and added more tests

* Fix some doc issues

* revises windows faq

* add anchors for windows links

* revises windows setup page

* Update changelogs/fragments/windows-ssh.yaml

Co-Authored-By: jborean93 <jborean93@gmail.com>
2019-03-07 16:38:02 -08:00
Matt Clay
156613f025 Fix coverage handling for non_local tests. 2019-03-06 16:30:37 -08:00
Matt Clay
eeaff731de
Overhaul ansible-test cloud test plugins. (#53044) 2019-02-28 18:25:49 -08:00
Matt Clay
6a82827ddd Add Python 3.8 to ansible-test and CI. 2019-02-14 23:24:24 -08:00
Jordan Borean
ce8db479f0
ansible-test: make the httptester for Windows more resiliant around the shell chosen (#51416) 2019-01-30 07:50:23 +10:00
Matt Clay
b834b29e43 Run integration tests from temporary directory.
ci_complete
2019-01-17 17:22:51 -08:00
Matt Clay
eee3dc888b Pass ansible-test inventory path to test funcs.
This avoids declaring the inventory path/names in multiple places.
Also expose the inventory path using the INVENTORY_PATH env var.
2019-01-15 18:07:13 -08:00
Matt Clay
3b705efc93 Fix ansible-test skip warning message. 2018-11-27 07:50:22 -08:00
Matt Clay
0826a00803 Add --raw option to ansible-test shell command.
It is currently supported only with the `--remote` option.

This makes it easier to troubleshoot new instances which are not
yet supported by the setup scripts used by ansible-test.
2018-11-16 17:38:15 -08:00
Matt Clay
8066acc90c
Support skip of platforms by version in tests. (#48826)
* Support skip of platforms by version in tests.

Previously a remote platform could be skipped completely using the alias:

`skip/{platform}` such as `skip/rhel`

Now a specific platform version can be skipped using the alias:

`skip/{platform}{version}` such as `skip/rhel7.6`

This feature is available for platforms specified with the `--remote` option.

* Add skip by version to the docs.
2018-11-16 16:38:47 -08:00
Matt Clay
fa53b4805b Fix ansible-test interpreter tracking.
Track the interpreter for each copy of the injector by the interpreter
path instead of the interpreter version. This avoids the possibility
of mixing different interpreters with the same version.
2018-11-14 13:58:03 -08:00
Matt Clay
eec21a3d12 Use correct interpreter for ansible-test injector. 2018-11-13 22:50:34 -08:00
Jordan Borean
9a5561da0f
ansible-test: setup up http runner in between each target (#47100)
* ansible-test: setup up http runner in between each target

* review changes
2018-10-16 18:09:17 +10:00
Jordan Borean
69e1088ec1
ansible-test: run win httptester with bypass policy (#47090) 2018-10-16 08:07:02 +10:00
Matt Clay
38eba60849 Fix ansible-test --exclude with delegation.
Previously the option worked with integration commands but not units or sanity.
2018-10-15 14:05:37 -07:00
Jordan Borean
6e2897647c
win test: add http tester container to Windows tests (#46606) 2018-10-13 08:20:00 +10:00
Jordan Borean
0f5331645f
ansible-test: add skip/windows/... alias to skip tests on specific Windows versions (#46845)
* ansible-test: add skip/windows/... alias to skip tests on specific Windows versions

* show what tests were skipped

* changes to logic to only skip if all Windows targets are set to skip

* codestyle improvements

* change warning message based on review

* check args type before running the Windows path
2018-10-12 15:32:46 +10:00
Matt Clay
ec88510fd4 Add OUTPUT_DIR env var to integration tests. 2018-10-11 20:34:12 -07:00
Matt Clay
712ad9ed64 Fix ansible-test custom docker image traceback. 2018-10-11 10:49:38 -07:00
Matt Clay
0dc7f38787
Improve ansible-test environment checking between tests. (#46459)
* Add unified diff output to environment validation.

This makes it easier to see where the environment changed.

* Compare Python interpreters by version to pip shebangs.

This helps expose cases where pip executables use a different
Python interpreter than is expected.

* Query `pip.__version__` instead of using `pip --version`.

This is a much faster way to query the pip version. It also more
closely matches how we invoke pip within ansible-test.

* Remove redundant environment scan between tests.

This reuses the environment scan from the end of the previous test
as the basis for comparison during the next test.
2018-10-03 21:41:27 -07:00
Matt Clay
e53390b3b1
Fix ansible-test multi-group smoke test handling. (#46363)
* Fix ansible-test smoke tests across groups.
* Fix ansible-test list arg defaults.
* Fix ansible-test require and exclude delegation.
* Fix detection of Windows specific changes.
* Add minimal Windows testing for Python 3.7.
2018-10-02 12:26:14 -07:00
Matt Clay
54937ba784 Fix ansible-test docker python version handling.
This removes the old name based version detection behavior and
uses versions defined in the docker completion file instead, as
the new containers do not follow the old naming scheme.
2018-09-21 20:11:38 -07:00
Matt Clay
ac492476e5
Bug fixes and cleanup for ansible-test. (#45991)
* Remove unused imports.
* Clean up ConfigParser usage in ansible-test.
* Fix bare except statements in ansible-test.
* Miscellaneous cleanup from PyCharm inspections.
* Enable pylint no-self-use for ansible-test.
* Remove obsolete pylint ignores for Python 3.7.
* Fix shellcheck issuers under newer shellcheck.
* Use newer path for ansible-test.
* Fix issues in code-smell tests.
2018-09-21 11:38:22 -07:00
Jordan Borean
27c10fa502
add skip/docker alias to skip tests when running on Docker (#45955)
* add skip/docker alias to skip tests when running on Docker

* changed warning message wording
2018-09-21 16:09:54 +10:00
Matt Clay
abe8e4c9e8
Run unit tests in parallel. (#45812) 2018-09-18 13:58:22 -07:00
Matt Clay
379a7f4f5a
Fix ansible-test unit test execution. (#45772)
* Fix ansible-test units requirements install.
* Run unit tests as unprivileged user under Docker.
2018-09-18 08:37:14 -07:00
Matt Clay
c1f9efabf4
Overhaul httptester support in ansible-test. (#39892)
- Works with the --remote option.
- Can be disabled with the --disable-httptester option.
- Change image with the --httptester option.
- Only load and run httptester for targets that require it.
2018-05-09 09:24:40 -07:00
Matt Clay
8a223009ca
Improve handling of integration test aliases. (#38698)
* Include change classification data in metadata.
* Add support for disabled tests.
* Add support for unstable tests.
* Add support for unsupported tests.
* Overhaul integration aliases sanity test.
* Update Shippable scripts to handle unstable tests.
* Mark unstable Azure tests.
* Mark unstable Windows tests.
* Mark disabled tests.
2018-04-12 16:15:28 -07:00
Matt Clay
a5cbc0a2c8
Multiple ansible-test fixes. (#38247)
* Add ansible-test integration --allow-root option.
* Fix destructive target override.
* Fix bad type hint SanityResult -> TestResult.
* Fix skip/python3 filtering with --docker option.
2018-04-03 18:53:53 -07:00
Matt Clay
a8487feb70 Fix ansible-test python and pip executable search. 2018-03-14 23:34:14 -07:00
Matt Clay
b9b8081a87
Cleanup and enhancements for ansible-test. (#37142)
* Fix type hint typos.
* Add one-time cloud env setup after delegation.
* Add generate_password to util.
* Add username/password support to HttpClient.
* Avoid pip requirement for ansible-test shell.
* Support provisioning Tower instances.
2018-03-07 14:02:31 -08:00
David Newswanger
3f5caf659e added support for --testcase flag in ansible-test (#36134)
* added support for --testcase flag in ansible-test

* fixed command format

* added tab completion

* fixed sanity issues

* added documenation for --testcase

* don't autocomplete when multiple modules are selected
2018-02-14 15:40:35 -08:00
Matt Clay
7abdab6c9e Convert ansible-test compile into a sanity test. 2018-01-25 09:45:36 -08:00
Matt Clay
5fa1edc15d
Track ansible-test cloud and target overhead. (#34902) 2018-01-16 15:52:42 -08:00
Matt Clay
f968776d86 Remove ansible-test obsolete net_* target logic. 2018-01-10 12:12:39 -08:00
Matt Clay
82b5a6a0c9
Fix ansible-test network-integration command. (#34661)
* Fix ansible-test network platform init filter.
* Fix ansible-test network inventory generation.
* Remove ios/csr1000v from CI.
* Run network tests on Python 2.7 and 3.6.
2018-01-09 14:52:36 -08:00
Matt Clay
1b5c4b72bd Add Azure provider support to ansible-test and CI.
ci_complete
2017-12-06 00:34:54 -08:00
Matt Clay
1ee511f82c Use an abspath for network inventory ssh key path. 2017-11-22 11:10:22 -08:00
Matt Clay
f9cd50411f Enable Python 3.7 in ansible-test. 2017-11-21 09:24:04 -08:00
Matt Clay
ef21038dd5 Fix ansible-test race calling get_coverage_path. 2017-11-15 12:57:18 -08:00
Matt Clay
6472723ba8
Add missing ansible-test --remote-terminate support. (#32918)
* Expand ansible-test --remote-terminate support:

- windows-integration
- network-integration

These commands previously accepted the option, but did not support it.

* Terminate windows and network instances when done.
2017-11-14 17:08:48 -08:00
Matt Clay
cf1337ca9a Update ansible-test sanity command. (#31958)
* Use correct pip version in ansible-test.
* Add git fallback for validate-modules.
* Run sanity tests in a docker container.
* Use correct python version for sanity tests.
* Pin docker completion images and add default.
* Split pylint execution into multiple contexts.
* Only test .py files in use-argspec-type-path test.
* Accept identical python interpeter name or binary.
* Switch cloud tests to default container.
* Remove unused extras from pip install.
* Filter out empty pip commands.
* Don't force running of pip list.
* Support delegation for windows and network tests.
* Fix ansible-test python version usage.
* Fix ansible-test python version skipping.
* Use absolute path for log in ansible-test.
* Run vyos_command test on python 3.
* Fix windows/network instance persistence.
* Add `test/cache` dir to classification.
* Enable more python versions for network tests.
* Fix cs_router test.
2017-10-26 00:21:46 -07:00
Matt Clay
36b13e3e3d Fix ansible-test default image. (#31966)
* Add openssh-client to default docker container.
* Include Azure requirements in default container.

To do so, handling of pip requirements was updated to install each
set of requirements separately and then run a verification pass to
make sure there are no conflicts between requirements.

* Add missing --docker-no-pull option.
* Add documentation for the azure-requirements test.
2017-10-20 08:48:01 -07:00
Matt Clay
a1453a7917 Improve handling of first CI run for new branch. (#29070) 2017-09-06 16:40:04 -07:00
Matt Clay
f71d861563 Collect data from integration test runs. (#28650) 2017-08-25 18:14:47 -04:00
Matt Clay
5ea8a5e34b Add support for setup targets to ansible-test. (#28544)
* Add support for setup targets to ansible-test.
* Code cleanup.
2017-08-23 14:09:50 -04:00
Ricardo Carrillo Cruz
746b433c29 Remove 'net' hardcoding on ansible-test executor (#28334)
We need to run network-integration against platform agnostic modules,
which they all are named as net_* .
There is a hardcoding in executor where if prefix is 'net' the hosts is set
to all, removing these lines to have desired behaviour.
2017-08-17 18:15:59 +02:00