From c3846da561c1553d5df7bb81b248a60a54ad053c Mon Sep 17 00:00:00 2001 From: Bruno Goncalves Date: Sep 25 2019 13:05:35 +0000 Subject: [PATCH 1/2] fix yamllint reported errors under tests/ With the fix some warnings are still left... # yamllint -d "{extends: default, rules: {line-length: {max: 120}, indentation: disable}}" tests/ tests/prepare.yml 2:1 warning missing document start "---" (document-start) tests/avocado.yml 2:1 warning missing document start "---" (document-start) 13:20 warning truthy value should be one of [false, true] (truthy) tests/rhts.yml 1:1 warning missing document start "---" (document-start) 28:20 warning truthy value should be one of [false, true] (truthy) tests/inventory.yml 1:1 warning missing document start "---" (document-start) tests/source.yml 2:1 warning missing document start "---" (document-start) tests/basic.yml 1:1 warning missing document start "---" (document-start) 56:20 warning truthy value should be one of [false, true] (truthy) 90:20 warning truthy value should be one of [false, true] (truthy) tests/beakerlib.yml 1:1 warning missing document start "---" (document-start) 30:20 warning truthy value should be one of [false, true] (truthy) 63:20 warning truthy value should be one of [false, true] (truthy) tests/shared-tasks/verify_failed_test.yml 2:1 warning missing document start "---" (document-start) tests/shared-tasks/req-pkg.yml 1:1 warning missing document start "---" (document-start) tests/shared-tasks/artifacts_test_env.yml 2:1 warning missing document start "---" (document-start) tests/shared-tasks/verify_error_test.yml 2:1 warning missing document start "---" (document-start) tests/shared-tasks/artifacts_test_runner.yml 2:1 warning missing document start "---" (document-start) tests/shared-tasks/artifacts.yml 2:1 warning missing document start "---" (document-start) --- diff --git a/tests/basic.yml b/tests/basic.yml index 0589b29..12adf16 100644 --- a/tests/basic.yml +++ b/tests/basic.yml @@ -13,7 +13,8 @@ - test-basic-parameters: dir: ./ run: echo "check parameters on basic role" | grep "check parameters on basic role" - # make sure having testcase named 'test' doesn't delete test.log. see: https://pagure.io/standard-test-roles/issue/339 + # make sure having testcase named 'test' doesn't delete test.log. + # see: https://pagure.io/standard-test-roles/issue/339 - test: dir: ./ run: ls @@ -35,8 +36,9 @@ tests: - basic with advanced cmdline: dir: ./ - run: | - echo -n "Cmdline test: "; a="some text"; [ "x$a" = "xsome text" ] && (echo "Passed"; exit 0) || (echo "Failed"; exit 1) + run: > + echo -n "Cmdline test: "; a="some text"; + [ "x$a" = "xsome text" ] && (echo "Passed"; exit 0) || (echo "Failed"; exit 1) tasks: - import_tasks: shared-tasks/artifacts_test_env.yml - import_tasks: shared-tasks/artifacts_test_runner.yml diff --git a/tests/shared-tasks/artifacts_test_env.yml b/tests/shared-tasks/artifacts_test_env.yml index 4d8ae88..0b04db5 100644 --- a/tests/shared-tasks/artifacts_test_env.yml +++ b/tests/shared-tasks/artifacts_test_env.yml @@ -6,4 +6,3 @@ file: state: absent path: "{{remote_artifacts}}/" - diff --git a/tests/shared-tasks/verify_error_test.yml b/tests/shared-tasks/verify_error_test.yml index 5d1253d..530be80 100644 --- a/tests/shared-tasks/verify_error_test.yml +++ b/tests/shared-tasks/verify_error_test.yml @@ -8,4 +8,3 @@ when: test_log.stdout.find("ERROR") == -1 # We should fail when we can not find ERROR string on log # -1 means string not found - diff --git a/tests/shared-tasks/verify_failed_test.yml b/tests/shared-tasks/verify_failed_test.yml index a51af94..ce74459 100644 --- a/tests/shared-tasks/verify_failed_test.yml +++ b/tests/shared-tasks/verify_failed_test.yml @@ -8,4 +8,3 @@ when: test_log.stdout.find("FAIL") == -1 # We should fail when we can not find FAIL string on log # -1 means string not found - diff --git a/tests/source.yml b/tests/source.yml index c23901a..f6bb90a 100644 --- a/tests/source.yml +++ b/tests/source.yml @@ -10,5 +10,6 @@ srcdir: "{{playbook_dir}}/source" tasks: - name: "Check if sources were pulled for zsh" - shell: ls "{{playbook_dir}}/source/configure" "{{playbook_dir}}/source/aczsh.m4" "{{playbook_dir}}/source/patch-created.txt" - + shell: > + ls "{{playbook_dir}}/source/configure" "{{playbook_dir}}/source/aczsh.m4" + "{{playbook_dir}}/source/patch-created.txt" From 7038a9993f73d51f4850e2c3bef300e64c794f6e Mon Sep 17 00:00:00 2001 From: Bruno Goncalves Date: Sep 25 2019 14:20:00 +0000 Subject: [PATCH 2/2] freeze python modules for python-syntax.sh --- diff --git a/tests/python-syntax.sh b/tests/python-syntax.sh index dd6694d..f6db497 100755 --- a/tests/python-syntax.sh +++ b/tests/python-syntax.sh @@ -50,7 +50,7 @@ fi virtualenv ${virt_env_dir} source ${virt_env_dir}/bin/activate -pip3 install inspektor +pip3 install -r tests/requirements.txt if [[ $? -ne 0 ]]; then deactivate echo "FAIL: Could not install inspektor" diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000..5b82cda --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,19 @@ +astroid==2.2.5 +cliff==2.16.0 +cmd2==0.8.9 +inspektor==0.5.2 +isort==4.3.21 +lazy-object-proxy==1.4.2 +mccabe==0.6.1 +pbr==5.4.3 +prettytable==0.7.2 +pycodestyle==2.5.0 +pylint==2.3.1 +pyparsing==2.4.2 +pyperclip==1.7.0 +PyYAML==5.1.2 +six==1.12.0 +stevedore==1.31.0 +typed-ast==1.4.0 +wcwidth==0.1.7 +wrapt==1.11.2