From 5c263fb437ac4da76fd189817d42ddb79757cbbc Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 28 May 2020 20:46:21 +0100 Subject: [PATCH] test-playbooks: avoid warnings with shell/command Avoids runtime warnings from use of Ansible shell/command module when executed commands also have ansible modules. Change-Id: I4e415cbd34f0f4cb15857051bf95458e0316de86 --- test-playbooks/dhall/test-dhall-diff.yaml | 1 + test-playbooks/dstat-graph.yaml | 5 ++++- test-playbooks/ensure-tox.yaml | 4 ++++ test-playbooks/haskell/setup-stack-project.yaml | 2 ++ test-playbooks/javascripts/fetch-javascript-tarball.yaml | 2 ++ test-playbooks/python/fetch-sphinx-output.yaml | 2 ++ test-playbooks/python/fetch-sphinx-tarball.yaml | 2 ++ test-playbooks/registry/buildset-registry-k8s-crio.yaml | 4 ++++ test-playbooks/registry/buildset-registry-k8s-docker.yaml | 2 ++ .../registry/buildset-registry-openshift-docker.yaml | 4 ++++ test-playbooks/registry/test-registry.yaml | 2 ++ test-playbooks/tox/reinstall-tox.yaml | 4 ++++ test-playbooks/upload-git-mirror.yaml | 4 ++++ 13 files changed, 37 insertions(+), 1 deletion(-) diff --git a/test-playbooks/dhall/test-dhall-diff.yaml b/test-playbooks/dhall/test-dhall-diff.yaml index 72c013db3..651303f2a 100644 --- a/test-playbooks/dhall/test-dhall-diff.yaml +++ b/test-playbooks/dhall/test-dhall-diff.yaml @@ -18,6 +18,7 @@ command: git commit -a -m "test update" args: chdir: "{{ zuul.project.src_dir }}" + warn: false - name: Failed dhall-diff include_role: diff --git a/test-playbooks/dstat-graph.yaml b/test-playbooks/dstat-graph.yaml index 24e553544..ed7f28083 100644 --- a/test-playbooks/dstat-graph.yaml +++ b/test-playbooks/dstat-graph.yaml @@ -6,8 +6,11 @@ # Simulate workload - hosts: all tasks: + # Not using ansible pause module on purpose in order to simulate the load - name: Simulate workload - shell: "sleep 10" + command: sleep 10 + args: + warn: false - hosts: all roles: diff --git a/test-playbooks/ensure-tox.yaml b/test-playbooks/ensure-tox.yaml index 854b37b39..0b5d40004 100644 --- a/test-playbooks/ensure-tox.yaml +++ b/test-playbooks/ensure-tox.yaml @@ -3,10 +3,14 @@ tasks: - name: Remove tox package with pip shell: pip uninstall -y tox + args: + warn: false become: true failed_when: false - name: Remove tox package with pip3 shell: pip3 uninstall -y tox + args: + warn: false become: true failed_when: false - name: Verify tox is not installed diff --git a/test-playbooks/haskell/setup-stack-project.yaml b/test-playbooks/haskell/setup-stack-project.yaml index d9fb288a7..f301c74b7 100644 --- a/test-playbooks/haskell/setup-stack-project.yaml +++ b/test-playbooks/haskell/setup-stack-project.yaml @@ -5,3 +5,5 @@ - name: Copy file over zuul-jobs command: rsync -a new-project/ "{{ zuul.project.src_dir }}/" + args: + warn: false diff --git a/test-playbooks/javascripts/fetch-javascript-tarball.yaml b/test-playbooks/javascripts/fetch-javascript-tarball.yaml index c05cc4d3c..c8de86b94 100644 --- a/test-playbooks/javascripts/fetch-javascript-tarball.yaml +++ b/test-playbooks/javascripts/fetch-javascript-tarball.yaml @@ -4,6 +4,8 @@ shell: | mkdir -p {{ zuul.project.src_dir }} tar czf {{ zuul.project.src_dir }}/dist.tgz /etc/os-release + args: + warn: false tasks: - import_role: name: fetch-javascript-tarball diff --git a/test-playbooks/python/fetch-sphinx-output.yaml b/test-playbooks/python/fetch-sphinx-output.yaml index 0b161051e..344542cee 100644 --- a/test-playbooks/python/fetch-sphinx-output.yaml +++ b/test-playbooks/python/fetch-sphinx-output.yaml @@ -8,6 +8,8 @@ shell: | mkdir -p {{ zuul.project.src_dir }}/doc/build/html echo "Hello" > {{ zuul.project.src_dir }}/doc/build/html/index.html + args: + warn: false tasks: - import_role: diff --git a/test-playbooks/python/fetch-sphinx-tarball.yaml b/test-playbooks/python/fetch-sphinx-tarball.yaml index 5cd2a5832..c570b6b39 100644 --- a/test-playbooks/python/fetch-sphinx-tarball.yaml +++ b/test-playbooks/python/fetch-sphinx-tarball.yaml @@ -10,6 +10,8 @@ mkdir -p {{ zuul.project.src_dir }}/doc/build/html echo "%PDF-1.2" > {{ zuul.project.src_dir }}/doc/build/pdf/doc-{{ zuul.project.short_name }}.pdf echo "Hello" > {{ zuul.project.src_dir }}/doc/build/html/index.html + args: + warn: false tasks: - import_role: diff --git a/test-playbooks/registry/buildset-registry-k8s-crio.yaml b/test-playbooks/registry/buildset-registry-k8s-crio.yaml index 840bd97d3..17eea4fc0 100644 --- a/test-playbooks/registry/buildset-registry-k8s-crio.yaml +++ b/test-playbooks/registry/buildset-registry-k8s-crio.yaml @@ -22,6 +22,8 @@ command: kubectl wait --for=condition=Ready pod/quaytest --timeout=60s - name: Check the output of the pod shell: "kubectl logs pod/quaytest | grep 'Zuul container test'" + args: + warn: false - name: Run a remote test pod command: kubectl run --generator=run-pod/v1 --image=docker.io/debian:testing upstream-dockertest --command -- /bin/bash -c 'echo Upstream; sleep infinity' @@ -29,3 +31,5 @@ command: kubectl wait --for=condition=Ready pod/upstream-dockertest --timeout=60s - name: Check the output of the pod shell: "kubectl logs pod/upstream-dockertest | grep 'Upstream'" + args: + warn: false diff --git a/test-playbooks/registry/buildset-registry-k8s-docker.yaml b/test-playbooks/registry/buildset-registry-k8s-docker.yaml index 5724f131b..02939be6b 100644 --- a/test-playbooks/registry/buildset-registry-k8s-docker.yaml +++ b/test-playbooks/registry/buildset-registry-k8s-docker.yaml @@ -16,6 +16,8 @@ command: kubectl wait --for=condition=Ready pod/dockertest --timeout=60s - name: Check the output of the pod shell: "kubectl logs pod/dockertest | grep 'Zuul container test'" + args: + warn: false - name: Run a remote test pod command: kubectl run --generator=run-pod/v1 --image=debian:testing upstream-dockertest --command -- /bin/bash -c 'echo Upstream; sleep infinity' diff --git a/test-playbooks/registry/buildset-registry-openshift-docker.yaml b/test-playbooks/registry/buildset-registry-openshift-docker.yaml index 348683e40..8437fe985 100644 --- a/test-playbooks/registry/buildset-registry-openshift-docker.yaml +++ b/test-playbooks/registry/buildset-registry-openshift-docker.yaml @@ -18,6 +18,8 @@ command: oc wait --for=condition=Ready pod/dockertest --timeout=60s - name: Check the output of the pod shell: "oc logs pod/dockertest | grep 'Zuul container test'" + args: + warn: false - name: Run a remote test pod command: oc run --generator=run-pod/v1 --image=debian:testing upstream-dockertest --command -- /bin/bash -c 'echo Upstream; sleep infinity' @@ -25,3 +27,5 @@ command: oc wait --for=condition=Ready pod/upstream-dockertest --timeout=60s - name: Check the output of the pod shell: "oc logs pod/upstream-dockertest | grep 'Upstream'" + args: + warn: false diff --git a/test-playbooks/registry/test-registry.yaml b/test-playbooks/registry/test-registry.yaml index 08233f359..0f1473c55 100644 --- a/test-playbooks/registry/test-registry.yaml +++ b/test-playbooks/registry/test-registry.yaml @@ -129,6 +129,8 @@ mkdir -p src/openstack.org/project/fake-sibling && touch src/opendev.org/project/fake-sibling/file && touch src/openstack.org/project/fake-sibling/file + args: + warn: false - name: Build docker image include_role: diff --git a/test-playbooks/tox/reinstall-tox.yaml b/test-playbooks/tox/reinstall-tox.yaml index 039125424..8ee182014 100644 --- a/test-playbooks/tox/reinstall-tox.yaml +++ b/test-playbooks/tox/reinstall-tox.yaml @@ -3,10 +3,14 @@ tasks: - name: Remove tox package with pip shell: pip uninstall -y tox + args: + warn: false become: true failed_when: false - name: Remove tox package with pip3 shell: pip3 uninstall -y tox + args: + warn: false become: true failed_when: false - name: Verify tox is not installed diff --git a/test-playbooks/upload-git-mirror.yaml b/test-playbooks/upload-git-mirror.yaml index 6510a57df..d09977c11 100644 --- a/test-playbooks/upload-git-mirror.yaml +++ b/test-playbooks/upload-git-mirror.yaml @@ -31,6 +31,8 @@ - name: Get localhost ssh host public key shell: ssh-keyscan -t rsa localhost + args: + warn: false register: host_key tasks: - name: Get git commit hash for current patch of zuul-jobs @@ -38,6 +40,7 @@ changed_when: false args: chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" + warn: false register: current_commit - name: Clone upstream zuul-jobs as a bare repository @@ -71,6 +74,7 @@ changed_when: false args: chdir: "{{ test_repo_path }}" + warn: false register: after_mirror - name: Assert that the git repositories have the same commit for HEAD