From c88610305ba707a2c68da7ec79f46571dc48de71 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 4 Jan 2024 23:24:35 +0100 Subject: [PATCH] [PR #7807/ee8b1570 backport][stable-7] Fix failing sanity and integration tests (#7808) Fix failing sanity and integration tests (#7807) * Remove some Shippable specific code that trips latest shellcheck. * Rename templated shell script to .sh.j2 to avoid shellcheck disliking the templating. * Copy on the remote, not from controller to remote. (cherry picked from commit ee8b15708f6514134a7628abe2c8d0d85df3ec0c) Co-authored-by: Felix Fontein --- .../targets/cmd_runner/tasks/test_cmd_echo.yml | 3 ++- tests/integration/targets/pids/tasks/main.yml | 2 +- .../pids/templates/{obtainpid.sh => obtainpid.sh.j2} | 0 tests/utils/shippable/shippable.sh | 11 +---------- 4 files changed, 4 insertions(+), 12 deletions(-) rename tests/integration/targets/pids/templates/{obtainpid.sh => obtainpid.sh.j2} (100%) diff --git a/tests/integration/targets/cmd_runner/tasks/test_cmd_echo.yml b/tests/integration/targets/cmd_runner/tasks/test_cmd_echo.yml index e2e6c4b20e..a2a9fb8b72 100644 --- a/tests/integration/targets/cmd_runner/tasks/test_cmd_echo.yml +++ b/tests/integration/targets/cmd_runner/tasks/test_cmd_echo.yml @@ -7,7 +7,8 @@ ansible.builtin.copy: src: /bin/echo dest: "{{ item.copy_to }}/echo" - mode: "755" + mode: "0755" + remote_src: true when: item.copy_to is defined - name: test cmd_echo module ({{ item.name }}) diff --git a/tests/integration/targets/pids/tasks/main.yml b/tests/integration/targets/pids/tasks/main.yml index 2ba7f37547..c8feaacf3e 100644 --- a/tests/integration/targets/pids/tasks/main.yml +++ b/tests/integration/targets/pids/tasks/main.yml @@ -45,7 +45,7 @@ - name: Copy templated helper script template: - src: obtainpid.sh + src: obtainpid.sh.j2 dest: "{{ remote_tmp_dir }}/obtainpid.sh" mode: 0755 diff --git a/tests/integration/targets/pids/templates/obtainpid.sh b/tests/integration/targets/pids/templates/obtainpid.sh.j2 similarity index 100% rename from tests/integration/targets/pids/templates/obtainpid.sh rename to tests/integration/targets/pids/templates/obtainpid.sh.j2 diff --git a/tests/utils/shippable/shippable.sh b/tests/utils/shippable/shippable.sh index e986804385..e288cca1cf 100755 --- a/tests/utils/shippable/shippable.sh +++ b/tests/utils/shippable/shippable.sh @@ -65,16 +65,7 @@ else retry pip install "https://github.com/ansible/ansible/archive/stable-${ansible_version}.tar.gz" --disable-pip-version-check fi -if [ "${SHIPPABLE_BUILD_ID:-}" ]; then - export ANSIBLE_COLLECTIONS_PATHS="${HOME}/.ansible" - SHIPPABLE_RESULT_DIR="$(pwd)/shippable" - TEST_DIR="${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/general" - mkdir -p "${TEST_DIR}" - cp -aT "${SHIPPABLE_BUILD_DIR}" "${TEST_DIR}" - cd "${TEST_DIR}" -else - export ANSIBLE_COLLECTIONS_PATHS="${PWD}/../../../" -fi +export ANSIBLE_COLLECTIONS_PATHS="${PWD}/../../../" if [ "${test}" == "sanity/extra" ]; then retry pip install junit-xml --disable-pip-version-check