diff --git a/test/integration/targets/ansible-test-coverage/aliases b/test/integration/targets/ansible-test-coverage/aliases new file mode 100644 index 00000000000..7741d444515 --- /dev/null +++ b/test/integration/targets/ansible-test-coverage/aliases @@ -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 diff --git a/test/integration/targets/ansible-test-coverage/ansible_collections/ns/col/plugins/module_utils/test_util.py b/test/integration/targets/ansible-test-coverage/ansible_collections/ns/col/plugins/module_utils/test_util.py new file mode 100644 index 00000000000..481c4b8568e --- /dev/null +++ b/test/integration/targets/ansible-test-coverage/ansible_collections/ns/col/plugins/module_utils/test_util.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +def test_coverage(): + pass diff --git a/test/integration/targets/ansible-test/collection-tests/coverage.sh b/test/integration/targets/ansible-test-coverage/runme.sh similarity index 70% rename from test/integration/targets/ansible-test/collection-tests/coverage.sh rename to test/integration/targets/ansible-test-coverage/runme.sh index ddc0f9b4ef4..de5a4eb2cf8 100755 --- a/test/integration/targets/ansible-test/collection-tests/coverage.sh +++ b/test/integration/targets/ansible-test-coverage/runme.sh @@ -1,11 +1,8 @@ #!/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" +set -x # common args for all tests common=(--venv --color --truncate 0 "${@}") diff --git a/test/integration/targets/ansible-test-git/aliases b/test/integration/targets/ansible-test-git/aliases new file mode 100644 index 00000000000..7741d444515 --- /dev/null +++ b/test/integration/targets/ansible-test-git/aliases @@ -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 diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/module_utils/__init__.py b/test/integration/targets/ansible-test-git/ansible_collections/ns/col/tests/.keep similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/module_utils/__init__.py rename to test/integration/targets/ansible-test-git/ansible_collections/ns/col/tests/.keep diff --git a/test/integration/targets/ansible-test/collection-tests/git-at-collection-base.sh b/test/integration/targets/ansible-test-git/collection-tests/git-at-collection-base.sh similarity index 100% rename from test/integration/targets/ansible-test/collection-tests/git-at-collection-base.sh rename to test/integration/targets/ansible-test-git/collection-tests/git-at-collection-base.sh diff --git a/test/integration/targets/ansible-test/collection-tests/git-at-collection-root.sh b/test/integration/targets/ansible-test-git/collection-tests/git-at-collection-root.sh similarity index 100% rename from test/integration/targets/ansible-test/collection-tests/git-at-collection-root.sh rename to test/integration/targets/ansible-test-git/collection-tests/git-at-collection-root.sh diff --git a/test/integration/targets/ansible-test/collection-tests/git-common.bash b/test/integration/targets/ansible-test-git/collection-tests/git-common.bash similarity index 100% rename from test/integration/targets/ansible-test/collection-tests/git-common.bash rename to test/integration/targets/ansible-test-git/collection-tests/git-common.bash diff --git a/test/integration/targets/ansible-test/collection-tests/install-git.yml b/test/integration/targets/ansible-test-git/collection-tests/install-git.yml similarity index 100% rename from test/integration/targets/ansible-test/collection-tests/install-git.yml rename to test/integration/targets/ansible-test-git/collection-tests/install-git.yml diff --git a/test/integration/targets/ansible-test/collection-tests/uninstall-git.yml b/test/integration/targets/ansible-test-git/collection-tests/uninstall-git.yml similarity index 100% rename from test/integration/targets/ansible-test/collection-tests/uninstall-git.yml rename to test/integration/targets/ansible-test-git/collection-tests/uninstall-git.yml diff --git a/test/integration/targets/ansible-test/runme.sh b/test/integration/targets/ansible-test-git/runme.sh similarity index 100% rename from test/integration/targets/ansible-test/runme.sh rename to test/integration/targets/ansible-test-git/runme.sh diff --git a/test/integration/targets/ansible-test-integration-constraints/aliases b/test/integration/targets/ansible-test-integration-constraints/aliases new file mode 100644 index 00000000000..7741d444515 --- /dev/null +++ b/test/integration/targets/ansible-test-integration-constraints/aliases @@ -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 diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/integration/constraints.txt b/test/integration/targets/ansible-test-integration-constraints/ansible_collections/ns/col/tests/integration/constraints.txt similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/integration/constraints.txt rename to test/integration/targets/ansible-test-integration-constraints/ansible_collections/ns/col/tests/integration/constraints.txt diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/integration/requirements.txt b/test/integration/targets/ansible-test-integration-constraints/ansible_collections/ns/col/tests/integration/requirements.txt similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/integration/requirements.txt rename to test/integration/targets/ansible-test-integration-constraints/ansible_collections/ns/col/tests/integration/requirements.txt diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/integration/targets/constraints/aliases b/test/integration/targets/ansible-test-integration-constraints/ansible_collections/ns/col/tests/integration/targets/constraints/aliases similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/integration/targets/constraints/aliases rename to test/integration/targets/ansible-test-integration-constraints/ansible_collections/ns/col/tests/integration/targets/constraints/aliases diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/integration/targets/constraints/tasks/main.yml b/test/integration/targets/ansible-test-integration-constraints/ansible_collections/ns/col/tests/integration/targets/constraints/tasks/main.yml similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/integration/targets/constraints/tasks/main.yml rename to test/integration/targets/ansible-test-integration-constraints/ansible_collections/ns/col/tests/integration/targets/constraints/tasks/main.yml diff --git a/test/integration/targets/ansible-test-integration-constraints/runme.sh b/test/integration/targets/ansible-test-integration-constraints/runme.sh new file mode 100755 index 00000000000..8467f25714c --- /dev/null +++ b/test/integration/targets/ansible-test-integration-constraints/runme.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../collection/setup.sh + +set -x + +ansible-test integration --venv --color --truncate 0 "${@}" diff --git a/test/integration/targets/ansible-test-integration/aliases b/test/integration/targets/ansible-test-integration/aliases new file mode 100644 index 00000000000..7741d444515 --- /dev/null +++ b/test/integration/targets/ansible-test-integration/aliases @@ -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 diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/module_utils/my_util.py b/test/integration/targets/ansible-test-integration/ansible_collections/ns/col/plugins/module_utils/my_util.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/module_utils/my_util.py rename to test/integration/targets/ansible-test-integration/ansible_collections/ns/col/plugins/module_utils/my_util.py diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/modules/hello.py b/test/integration/targets/ansible-test-integration/ansible_collections/ns/col/plugins/modules/hello.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/modules/hello.py rename to test/integration/targets/ansible-test-integration/ansible_collections/ns/col/plugins/modules/hello.py diff --git a/test/integration/targets/ansible-test-integration/ansible_collections/ns/col/tests/integration/targets/hello/aliases b/test/integration/targets/ansible-test-integration/ansible_collections/ns/col/tests/integration/targets/hello/aliases new file mode 100644 index 00000000000..1af1cf90b6a --- /dev/null +++ b/test/integration/targets/ansible-test-integration/ansible_collections/ns/col/tests/integration/targets/hello/aliases @@ -0,0 +1 @@ +context/controller diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/tests/integration/targets/hello/tasks/main.yml b/test/integration/targets/ansible-test-integration/ansible_collections/ns/col/tests/integration/targets/hello/tasks/main.yml similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/tests/integration/targets/hello/tasks/main.yml rename to test/integration/targets/ansible-test-integration/ansible_collections/ns/col/tests/integration/targets/hello/tasks/main.yml diff --git a/test/integration/targets/ansible-test-integration/runme.sh b/test/integration/targets/ansible-test-integration/runme.sh new file mode 100755 index 00000000000..8467f25714c --- /dev/null +++ b/test/integration/targets/ansible-test-integration/runme.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../collection/setup.sh + +set -x + +ansible-test integration --venv --color --truncate 0 "${@}" diff --git a/test/integration/targets/ansible-test-sanity-import/aliases b/test/integration/targets/ansible-test-sanity-import/aliases new file mode 100644 index 00000000000..09cbf4b8f26 --- /dev/null +++ b/test/integration/targets/ansible-test-sanity-import/aliases @@ -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/ diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/lookup/vendor1.py b/test/integration/targets/ansible-test-sanity-import/ansible_collections/ns/col/plugins/lookup/vendor1.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/lookup/vendor1.py rename to test/integration/targets/ansible-test-sanity-import/ansible_collections/ns/col/plugins/lookup/vendor1.py diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/lookup/vendor2.py b/test/integration/targets/ansible-test-sanity-import/ansible_collections/ns/col/plugins/lookup/vendor2.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/lookup/vendor2.py rename to test/integration/targets/ansible-test-sanity-import/ansible_collections/ns/col/plugins/lookup/vendor2.py diff --git a/test/integration/targets/ansible-test/collection-tests/sanity-vendor.sh b/test/integration/targets/ansible-test-sanity-import/runme.sh similarity index 80% rename from test/integration/targets/ansible-test/collection-tests/sanity-vendor.sh rename to test/integration/targets/ansible-test-sanity-import/runme.sh index 72043bfdc28..a12e3e3fd21 100755 --- a/test/integration/targets/ansible-test/collection-tests/sanity-vendor.sh +++ b/test/integration/targets/ansible-test-sanity-import/runme.sh @@ -1,11 +1,6 @@ #!/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" +source ../collection/setup.sh vendor_dir="$(python -c 'import pathlib, ansible._vendor; print(pathlib.Path(ansible._vendor.__file__).parent)')" diff --git a/test/integration/targets/ansible-test-sanity-validate-modules/aliases b/test/integration/targets/ansible-test-sanity-validate-modules/aliases new file mode 100644 index 00000000000..7741d444515 --- /dev/null +++ b/test/integration/targets/ansible-test-sanity-validate-modules/aliases @@ -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 diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/modules/no_callable.py b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/no_callable.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/modules/no_callable.py rename to test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/no_callable.py diff --git a/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/README.rst b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/README.rst new file mode 100644 index 00000000000..bbdd513882a --- /dev/null +++ b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/README.rst @@ -0,0 +1,3 @@ +README +------ +This is a simple PowerShell-only collection used to verify that ``ansible-test`` works on a collection. diff --git a/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/galaxy.yml b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/galaxy.yml new file mode 100644 index 00000000000..0a78b9e14b2 --- /dev/null +++ b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/galaxy.yml @@ -0,0 +1,6 @@ +namespace: ns +name: ps_only +version: 1.0.0 +readme: README.rst +authors: + - Ansible diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/ps_only/meta/runtime.yml b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/meta/runtime.yml similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/ps_only/meta/runtime.yml rename to test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/meta/runtime.yml diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/ps_only/plugins/module_utils/validate.psm1 b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/plugins/module_utils/validate.psm1 similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/ps_only/plugins/module_utils/validate.psm1 rename to test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/plugins/module_utils/validate.psm1 diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/ps_only/plugins/modules/validate.ps1 b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/plugins/modules/validate.ps1 similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/ps_only/plugins/modules/validate.ps1 rename to test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/plugins/modules/validate.ps1 diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/ps_only/plugins/modules/validate.py b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/plugins/modules/validate.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/ps_only/plugins/modules/validate.py rename to test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/ps_only/plugins/modules/validate.py diff --git a/test/integration/targets/ansible-test/collection-tests/validate-modules-collection-loader.sh b/test/integration/targets/ansible-test-sanity-validate-modules/runme.sh similarity index 70% rename from test/integration/targets/ansible-test/collection-tests/validate-modules-collection-loader.sh rename to test/integration/targets/ansible-test-sanity-validate-modules/runme.sh index 3f77a6af989..1b051b3acab 100755 --- a/test/integration/targets/ansible-test/collection-tests/validate-modules-collection-loader.sh +++ b/test/integration/targets/ansible-test-sanity-validate-modules/runme.sh @@ -1,9 +1,12 @@ #!/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/ps_only" +set -eux + +ansible-test sanity --test validate-modules --color --truncate 0 "${@}" + +cd ../ps_only if ! command -V pwsh; then echo "skipping test since pwsh is not available" diff --git a/test/integration/targets/ansible-test-sanity/aliases b/test/integration/targets/ansible-test-sanity/aliases new file mode 100644 index 00000000000..7741d444515 --- /dev/null +++ b/test/integration/targets/ansible-test-sanity/aliases @@ -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 diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/README.rst b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/README.rst similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/README.rst rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/README.rst diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/galaxy.yml b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/galaxy.yml similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/galaxy.yml rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/galaxy.yml diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/meta/runtime.yml b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/meta/runtime.yml similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/meta/runtime.yml rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/meta/runtime.yml diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/filter/check_pylint.py b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/filter/check_pylint.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/filter/check_pylint.py rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/filter/check_pylint.py diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/lookup/bad.py b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/lookup/bad.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/lookup/bad.py rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/lookup/bad.py diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/lookup/world.py b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/lookup/world.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/lookup/world.py rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/lookup/world.py diff --git a/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/module_utils/__init__.py b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/module_utils/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/modules/bad.py b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/modules/bad.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/modules/bad.py rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/modules/bad.py diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/random_directory/bad.py b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/random_directory/bad.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/random_directory/bad.py rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/plugins/random_directory/bad.py diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/tests/sanity/ignore.txt b/test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/tests/sanity/ignore.txt similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/tests/sanity/ignore.txt rename to test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/tests/sanity/ignore.txt diff --git a/test/integration/targets/ansible-test-sanity/runme.sh b/test/integration/targets/ansible-test-sanity/runme.sh new file mode 100755 index 00000000000..233db741c97 --- /dev/null +++ b/test/integration/targets/ansible-test-sanity/runme.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../collection/setup.sh + +set -x + +ansible-test sanity --color --truncate 0 "${@}" diff --git a/test/integration/targets/ansible-test-units-constraints/aliases b/test/integration/targets/ansible-test-units-constraints/aliases new file mode 100644 index 00000000000..79d7dbd7b09 --- /dev/null +++ b/test/integration/targets/ansible-test-units-constraints/aliases @@ -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 diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/unit/constraints.txt b/test/integration/targets/ansible-test-units-constraints/ansible_collections/ns/col/tests/unit/constraints.txt similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/unit/constraints.txt rename to test/integration/targets/ansible-test-units-constraints/ansible_collections/ns/col/tests/unit/constraints.txt diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/unit/plugins/modules/test_constraints.py b/test/integration/targets/ansible-test-units-constraints/ansible_collections/ns/col/tests/unit/plugins/modules/test_constraints.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/unit/plugins/modules/test_constraints.py rename to test/integration/targets/ansible-test-units-constraints/ansible_collections/ns/col/tests/unit/plugins/modules/test_constraints.py diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/unit/requirements.txt b/test/integration/targets/ansible-test-units-constraints/ansible_collections/ns/col/tests/unit/requirements.txt similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col_constraints/tests/unit/requirements.txt rename to test/integration/targets/ansible-test-units-constraints/ansible_collections/ns/col/tests/unit/requirements.txt diff --git a/test/integration/targets/ansible-test-units-constraints/runme.sh b/test/integration/targets/ansible-test-units-constraints/runme.sh new file mode 100755 index 00000000000..3ad4ea69801 --- /dev/null +++ b/test/integration/targets/ansible-test-units-constraints/runme.sh @@ -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[@]}" "${@}" diff --git a/test/integration/targets/ansible-test-units/aliases b/test/integration/targets/ansible-test-units/aliases new file mode 100644 index 00000000000..79d7dbd7b09 --- /dev/null +++ b/test/integration/targets/ansible-test-units/aliases @@ -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 diff --git a/test/integration/targets/ansible-test-units/ansible_collections/ns/col/plugins/module_utils/my_util.py b/test/integration/targets/ansible-test-units/ansible_collections/ns/col/plugins/module_utils/my_util.py new file mode 100644 index 00000000000..b9c531cf8aa --- /dev/null +++ b/test/integration/targets/ansible-test-units/ansible_collections/ns/col/plugins/module_utils/my_util.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +def hello(name): + return 'Hello %s' % name diff --git a/test/integration/targets/ansible-test-units/ansible_collections/ns/col/plugins/modules/hello.py b/test/integration/targets/ansible-test-units/ansible_collections/ns/col/plugins/modules/hello.py new file mode 100644 index 00000000000..033b6c90f0e --- /dev/null +++ b/test/integration/targets/ansible-test-units/ansible_collections/ns/col/plugins/modules/hello.py @@ -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() diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/tests/unit/plugins/module_utils/test_my_util.py b/test/integration/targets/ansible-test-units/ansible_collections/ns/col/tests/unit/plugins/module_utils/test_my_util.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/tests/unit/plugins/module_utils/test_my_util.py rename to test/integration/targets/ansible-test-units/ansible_collections/ns/col/tests/unit/plugins/module_utils/test_my_util.py diff --git a/test/integration/targets/ansible-test/ansible_collections/ns/col/tests/unit/plugins/modules/test_hello.py b/test/integration/targets/ansible-test-units/ansible_collections/ns/col/tests/unit/plugins/modules/test_hello.py similarity index 100% rename from test/integration/targets/ansible-test/ansible_collections/ns/col/tests/unit/plugins/modules/test_hello.py rename to test/integration/targets/ansible-test-units/ansible_collections/ns/col/tests/unit/plugins/modules/test_hello.py diff --git a/test/integration/targets/ansible-test-units/runme.sh b/test/integration/targets/ansible-test-units/runme.sh new file mode 100755 index 00000000000..3ad4ea69801 --- /dev/null +++ b/test/integration/targets/ansible-test-units/runme.sh @@ -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[@]}" "${@}" diff --git a/test/integration/targets/ansible-test-unsupported-directory/aliases b/test/integration/targets/ansible-test-unsupported-directory/aliases new file mode 100644 index 00000000000..7741d444515 --- /dev/null +++ b/test/integration/targets/ansible-test-unsupported-directory/aliases @@ -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 diff --git a/test/integration/targets/ansible-test-unsupported-directory/ansible_collections/ns/col/.keep b/test/integration/targets/ansible-test-unsupported-directory/ansible_collections/ns/col/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/integration/targets/ansible-test/collection-tests/unsupported-directory.sh b/test/integration/targets/ansible-test-unsupported-directory/runme.sh similarity index 81% rename from test/integration/targets/ansible-test/collection-tests/unsupported-directory.sh rename to test/integration/targets/ansible-test-unsupported-directory/runme.sh index b1b9508a75f..087177ccad4 100755 --- a/test/integration/targets/ansible-test/collection-tests/unsupported-directory.sh +++ b/test/integration/targets/ansible-test-unsupported-directory/runme.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash -set -eux -o pipefail +source ../collection/setup.sh + +set -eux cd "${WORK_DIR}" @@ -11,6 +13,9 @@ ansible-test --version # the --help option should show the current working directory when it is unsupported ansible-test --help 2>&1 | grep '^Current working directory: ' +# some shell commands also work without a supported directory +ansible-test shell pwd + if ansible-test sanity 1>stdout 2>stderr; then echo "ansible-test did not fail" exit 1 diff --git a/test/integration/targets/ansible-test/aliases b/test/integration/targets/ansible-test/aliases index 09cbf4b8f26..136c05e0d02 100644 --- a/test/integration/targets/ansible-test/aliases +++ b/test/integration/targets/ansible-test/aliases @@ -1,5 +1 @@ -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/ +hidden diff --git a/test/integration/targets/ansible-test/collection-tests/integration-constraints.sh b/test/integration/targets/ansible-test/collection-tests/integration-constraints.sh deleted file mode 100755 index 35e5a26b832..00000000000 --- a/test/integration/targets/ansible-test/collection-tests/integration-constraints.sh +++ /dev/null @@ -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 "${@}" diff --git a/test/integration/targets/ansible-test/collection-tests/integration.sh b/test/integration/targets/ansible-test/collection-tests/integration.sh deleted file mode 100755 index b257093a599..00000000000 --- a/test/integration/targets/ansible-test/collection-tests/integration.sh +++ /dev/null @@ -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 "${@}" diff --git a/test/integration/targets/ansible-test/collection-tests/sanity.sh b/test/integration/targets/ansible-test/collection-tests/sanity.sh deleted file mode 100755 index 99d9b427fb1..00000000000 --- a/test/integration/targets/ansible-test/collection-tests/sanity.sh +++ /dev/null @@ -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 "${@}" diff --git a/test/integration/targets/ansible-test/collection-tests/units-constraints.sh b/test/integration/targets/ansible-test/collection-tests/units-constraints.sh deleted file mode 100755 index 3440eb1263f..00000000000 --- a/test/integration/targets/ansible-test/collection-tests/units-constraints.sh +++ /dev/null @@ -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[@]}" "${@}" diff --git a/test/integration/targets/ansible-test/collection-tests/units.sh b/test/integration/targets/ansible-test/collection-tests/units.sh deleted file mode 100755 index ecb2e162ef6..00000000000 --- a/test/integration/targets/ansible-test/collection-tests/units.sh +++ /dev/null @@ -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[@]}" "${@}" diff --git a/test/integration/targets/ansible-test/collection-tests/venv-pythons.py b/test/integration/targets/ansible-test/venv-pythons.py similarity index 100% rename from test/integration/targets/ansible-test/collection-tests/venv-pythons.py rename to test/integration/targets/ansible-test/venv-pythons.py diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt index 3ba64b43520..293d94fe52a 100644 --- a/test/sanity/ignore.txt +++ b/test/sanity/ignore.txt @@ -118,12 +118,13 @@ lib/ansible/plugins/strategy/linear.py pylint:disallowed-name lib/ansible/utils/collection_loader/_collection_finder.py pylint:deprecated-class lib/ansible/utils/collection_loader/_collection_meta.py pylint:deprecated-class lib/ansible/vars/hostvars.py pylint:disallowed-name -test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/modules/hello.py pylint:relative-beyond-top-level -test/integration/targets/ansible-test/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py pylint:ansible-bad-function # ignore, required for testing -test/integration/targets/ansible-test/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py pylint:ansible-bad-import-from # ignore, required for testing -test/integration/targets/ansible-test/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py pylint:ansible-bad-import # ignore, required for testing -test/integration/targets/ansible-test/ansible_collections/ns/col/tests/unit/plugins/modules/test_hello.py pylint:relative-beyond-top-level -test/integration/targets/ansible-test/ansible_collections/ns/col/tests/unit/plugins/module_utils/test_my_util.py pylint:relative-beyond-top-level +test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py pylint:ansible-bad-function # ignore, required for testing +test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py pylint:ansible-bad-import-from # ignore, required for testing +test/integration/targets/ansible-test-sanity/ansible_collections/ns/col/tests/integration/targets/hello/files/bad.py pylint:ansible-bad-import # ignore, required for testing +test/integration/targets/ansible-test-integration/ansible_collections/ns/col/plugins/modules/hello.py pylint:relative-beyond-top-level +test/integration/targets/ansible-test-units/ansible_collections/ns/col/plugins/modules/hello.py pylint:relative-beyond-top-level +test/integration/targets/ansible-test-units/ansible_collections/ns/col/tests/unit/plugins/modules/test_hello.py pylint:relative-beyond-top-level +test/integration/targets/ansible-test-units/ansible_collections/ns/col/tests/unit/plugins/module_utils/test_my_util.py pylint:relative-beyond-top-level test/integration/targets/ansible-test-docker/ansible_collections/ns/col/plugins/modules/hello.py pylint:relative-beyond-top-level test/integration/targets/ansible-test-docker/ansible_collections/ns/col/tests/unit/plugins/modules/test_hello.py pylint:relative-beyond-top-level test/integration/targets/ansible-test-docker/ansible_collections/ns/col/tests/unit/plugins/module_utils/test_my_util.py pylint:relative-beyond-top-level