ansible/test/integration/targets/python_requirements_info/tasks/main.yml
Matt Clay 013b0039ba
Fix incorrect assumptions in integration tests. (#58365)
* Fix nested template test.

There were two issues with the previous implementation:

1. The LOGNAME environment variable may not be set.
2. The comparison assumed that testhost is localhost.

* Fix variable display for cartesian lookup test.

* Fix vars list test.

The test assumed that the ansible_user variable is always set,
which is not guaranteed when using connections other than local.

* Fix supervisorctl integration test.

Use ansible_user_id instead of ansible_user since ansible_user
is not guaranteed to be available when the connection is not local.

* Fix file integration test.

Use ansible_user_id instead of ansible_user since ansible_user
is not guaranteed to be available when the connection is not local.

* Fix expect integration test.

Do not assume module_utils is available for utility scripts.

* Fix python_requirements_info integration test.

Check for pip instead of ansible, since ansible is not guaranteed
to be installed when using a connection other than local.

* Fix ansible-runner integration test.

Use implicit localhost to run the test since it requires access
to the ansible installation currently being tested.

* Fix tower_common integration test.

Accept errors on stdout or stderr.

* Fix tower_user integration test.

Recognize errors on stdout or stderr.
2019-06-25 18:39:41 -07:00

22 lines
563 B
YAML

- name: run python_requirements_info module
python_requirements_info:
register: basic_info
- name: ensure python_requirements_info returns desired info
assert:
that:
- "'python' in basic_info"
- "'python_version' in basic_info"
- name: run python_requirements_info module
python_requirements_info:
dependencies:
- notreal<1
- pip>1
register: dep_info
- name: ensure python_requirements_info returns desired info
assert:
that:
- "'installed' in dep_info.valid.pip"
- "'notreal' in dep_info.not_found"