summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2019-07-02 21:18:40 +0200
committerToshio Kuratomi <a.badger@gmail.com>2019-07-11 07:17:35 +0200
commit33d2728879f8655337bc2157b723f1efa3a1920a (patch)
tree5979971d5050bb06883336f38f1b61c63f3155af /test
parentSplit the metaclass == type and from future boilerplate code. (diff)
downloadansible-33d2728879f8655337bc2157b723f1efa3a1920a.tar.xz
ansible-33d2728879f8655337bc2157b723f1efa3a1920a.zip
Rename python files in hacking/ directory to have .py suffix
ansible-test only passes files which have the .py suffix for sanity tests on python files. This change will allow sanity tests to run on the Python files in hacking/ * Rename test-module to test-module.py * Symlink test-module for backwards compat since end users may be using test-module * Fix test-module sanity errors that are now triggered * Rename ansible_profile to ansible-profile.py * Rename build-ansible
Diffstat (limited to 'test')
-rw-r--r--test/integration/targets/test_infra/aliases2
-rwxr-xr-xtest/integration/targets/test_infra/runme.sh12
-rw-r--r--test/runner/requirements/sanity.txt2
-rwxr-xr-xtest/sanity/code-smell/shebang.py2
4 files changed, 9 insertions, 9 deletions
diff --git a/test/integration/targets/test_infra/aliases b/test/integration/targets/test_infra/aliases
index e3073ace3d..d342950a28 100644
--- a/test/integration/targets/test_infra/aliases
+++ b/test/integration/targets/test_infra/aliases
@@ -1,3 +1,3 @@
shippable/posix/group3
-needs/file/hacking/test-module
+needs/file/hacking/test-module.py
needs/file/lib/ansible/modules/system/ping.py
diff --git a/test/integration/targets/test_infra/runme.sh b/test/integration/targets/test_infra/runme.sh
index 9c86a5d3fd..7996a43140 100755
--- a/test/integration/targets/test_infra/runme.sh
+++ b/test/integration/targets/test_infra/runme.sh
@@ -26,14 +26,14 @@ set -e
PING_MODULE_PATH="../../../../lib/ansible/modules/system/ping.py"
-# ensure test-module script works without passing Python interpreter path
-../../../../hacking/test-module -m "$PING_MODULE_PATH"
+# ensure test-module.py script works without passing Python interpreter path
+../../../../hacking/test-module.py -m "$PING_MODULE_PATH"
-# ensure test-module script works well
-../../../../hacking/test-module -m "$PING_MODULE_PATH" -I ansible_python_interpreter="$(which python)"
+# ensure test-module.py script works well
+../../../../hacking/test-module.py -m "$PING_MODULE_PATH" -I ansible_python_interpreter="$(which python)"
-# ensure module.ansible_version is defined when using test-module
-../../../../hacking/test-module -m library/test.py -I ansible_python_interpreter="$(which python)" <<< '{"ANSIBLE_MODULE_ARGS": {}}'
+# ensure module.ansible_version is defined when using test-module.py
+../../../../hacking/test-module.py -m library/test.py -I ansible_python_interpreter="$(which python)" <<< '{"ANSIBLE_MODULE_ARGS": {}}'
# ensure exercising module code locally works
python -m ansible.modules.files.file <<< '{"ANSIBLE_MODULE_ARGS": {"path": "/path/to/file", "state": "absent"}}'
diff --git a/test/runner/requirements/sanity.txt b/test/runner/requirements/sanity.txt
index cda20ef3c9..0ea1bdeda1 100644
--- a/test/runner/requirements/sanity.txt
+++ b/test/runner/requirements/sanity.txt
@@ -8,7 +8,7 @@ pytest
rstcheck ; python_version >= '2.7' # rstcheck requires python 2.7+
sphinx
sphinx-notfound-page
-straight.plugin # needed for hacking/build-ansible which will host changelog generation
+straight.plugin # needed for hacking/build-ansible.py which will host changelog generation
virtualenv
voluptuous ; python_version >= '2.7' # voluptuous 0.11.0 and later require python 2.7+
yamllint
diff --git a/test/sanity/code-smell/shebang.py b/test/sanity/code-smell/shebang.py
index 04cfed8a39..9e7d1f136f 100755
--- a/test/sanity/code-smell/shebang.py
+++ b/test/sanity/code-smell/shebang.py
@@ -39,7 +39,7 @@ def main():
'test/utils/shippable/timing.py',
'test/integration/targets/old_style_modules_posix/library/helloworld.sh',
# The following are Python 3.6+. Only run by release engineers
- 'hacking/build-ansible',
+ 'hacking/build-ansible.py',
])
# see https://unicode.org/faq/utf_bom.html#bom1