mirror of https://github.com/ansible/ansible.git
Split up ansible-test integration tests. (#78520)
* Relocate venv-pythons.py script. * Split out unsupported-directory test. * Split out sanity-import test. * Split out sanity-validate-modules test. * Split out units test. * Split out integration test. * Split out units-constraints test. * Split out integration-constraints test. * Split out coverage test. * Split out sanity test. * Split out git test. * Update test groups.pull/78528/head
parent
0de4480467
commit
135f95fb2f
@ -0,0 +1,4 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
|
def test_coverage():
|
||||||
|
pass
|
||||||
@ -1,11 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -eux -o pipefail
|
source ../collection/setup.sh
|
||||||
|
|
||||||
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}"
|
set -x
|
||||||
cd "${WORK_DIR}/ansible_collections/ns/col"
|
|
||||||
|
|
||||||
"${TEST_DIR}/../collection/update-ignore.py"
|
|
||||||
|
|
||||||
# common args for all tests
|
# common args for all tests
|
||||||
common=(--venv --color --truncate 0 "${@}")
|
common=(--venv --color --truncate 0 "${@}")
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source ../collection/setup.sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
ansible-test integration --venv --color --truncate 0 "${@}"
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
@ -0,0 +1 @@
|
|||||||
|
context/controller
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source ../collection/setup.sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
ansible-test integration --venv --color --truncate 0 "${@}"
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
|
destructive # adds and then removes packages into lib/ansible/_vendor/
|
||||||
@ -1,11 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -eux -o pipefail
|
source ../collection/setup.sh
|
||||||
|
|
||||||
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}"
|
|
||||||
cd "${WORK_DIR}/ansible_collections/ns/col"
|
|
||||||
|
|
||||||
"${TEST_DIR}/../collection/update-ignore.py"
|
|
||||||
|
|
||||||
vendor_dir="$(python -c 'import pathlib, ansible._vendor; print(pathlib.Path(ansible._vendor.__file__).parent)')"
|
vendor_dir="$(python -c 'import pathlib, ansible._vendor; print(pathlib.Path(ansible._vendor.__file__).parent)')"
|
||||||
|
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
README
|
||||||
|
------
|
||||||
|
This is a simple PowerShell-only collection used to verify that ``ansible-test`` works on a collection.
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
namespace: ns
|
||||||
|
name: ps_only
|
||||||
|
version: 1.0.0
|
||||||
|
readme: README.rst
|
||||||
|
authors:
|
||||||
|
- Ansible
|
||||||
@ -1,9 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -eux -o pipefail
|
source ../collection/setup.sh
|
||||||
|
|
||||||
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}"
|
set -eux
|
||||||
cd "${WORK_DIR}/ansible_collections/ns/ps_only"
|
|
||||||
|
ansible-test sanity --test validate-modules --color --truncate 0 "${@}"
|
||||||
|
|
||||||
|
cd ../ps_only
|
||||||
|
|
||||||
if ! command -V pwsh; then
|
if ! command -V pwsh; then
|
||||||
echo "skipping test since pwsh is not available"
|
echo "skipping test since pwsh is not available"
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source ../collection/setup.sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
ansible-test sanity --color --truncate 0 "${@}"
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
|
needs/target/ansible-test
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source ../collection/setup.sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
options=$("${TEST_DIR}"/../ansible-test/venv-pythons.py)
|
||||||
|
IFS=', ' read -r -a pythons <<< "${options}"
|
||||||
|
|
||||||
|
ansible-test units --color --truncate 0 "${pythons[@]}" "${@}"
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
|
needs/target/ansible-test
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
|
def hello(name):
|
||||||
|
return 'Hello %s' % name
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
module: hello
|
||||||
|
short_description: Hello test module
|
||||||
|
description: Hello test module.
|
||||||
|
options:
|
||||||
|
name:
|
||||||
|
description: Name to say hello to.
|
||||||
|
type: str
|
||||||
|
author:
|
||||||
|
- Ansible Core Team
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- hello:
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = ''''''
|
||||||
|
|
||||||
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
from ..module_utils.my_util import hello
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
module = AnsibleModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
name=dict(type='str'),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
module.exit_json(**say_hello(module.params['name']))
|
||||||
|
|
||||||
|
|
||||||
|
def say_hello(name):
|
||||||
|
return dict(
|
||||||
|
message=hello(name),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source ../collection/setup.sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
options=$("${TEST_DIR}"/../ansible-test/venv-pythons.py)
|
||||||
|
IFS=', ' read -r -a pythons <<< "${options}"
|
||||||
|
|
||||||
|
ansible-test units --color --truncate 0 "${pythons[@]}" "${@}"
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
shippable/posix/group3 # runs in the distro test containers
|
||||||
|
shippable/generic/group1 # runs in the default test container
|
||||||
|
context/controller
|
||||||
|
needs/target/collection
|
||||||
@ -1,5 +1 @@
|
|||||||
shippable/posix/group3 # runs in the distro test containers
|
hidden
|
||||||
shippable/generic/group1 # runs in the default test container
|
|
||||||
context/controller
|
|
||||||
needs/target/collection
|
|
||||||
destructive # adds and then removes packages into lib/ansible/_vendor/
|
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eux -o pipefail
|
|
||||||
|
|
||||||
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}"
|
|
||||||
cd "${WORK_DIR}/ansible_collections/ns/col_constraints"
|
|
||||||
|
|
||||||
ansible-test integration --venv --color --truncate 0 "${@}"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eux -o pipefail
|
|
||||||
|
|
||||||
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}"
|
|
||||||
cd "${WORK_DIR}/ansible_collections/ns/col"
|
|
||||||
|
|
||||||
ansible-test integration --venv --color --truncate 0 "${@}"
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eux -o pipefail
|
|
||||||
|
|
||||||
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}"
|
|
||||||
cd "${WORK_DIR}/ansible_collections/ns/col"
|
|
||||||
|
|
||||||
"${TEST_DIR}/../collection/update-ignore.py"
|
|
||||||
|
|
||||||
ansible-test sanity --color --truncate 0 "${@}"
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eux -o pipefail
|
|
||||||
|
|
||||||
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}"
|
|
||||||
cd "${WORK_DIR}/ansible_collections/ns/col_constraints"
|
|
||||||
|
|
||||||
options=$("${TEST_DIR}"/collection-tests/venv-pythons.py)
|
|
||||||
IFS=', ' read -r -a pythons <<< "${options}"
|
|
||||||
|
|
||||||
ansible-test units --color --truncate 0 "${pythons[@]}" "${@}"
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eux -o pipefail
|
|
||||||
|
|
||||||
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}"
|
|
||||||
cd "${WORK_DIR}/ansible_collections/ns/col"
|
|
||||||
|
|
||||||
options=$("${TEST_DIR}"/collection-tests/venv-pythons.py)
|
|
||||||
IFS=', ' read -r -a pythons <<< "${options}"
|
|
||||||
|
|
||||||
ansible-test units --color --truncate 0 "${pythons[@]}" "${@}"
|
|
||||||
Loading…
Reference in New Issue