#371 fix yamllint reported errors under tests/
Merged 5 years ago by astepano. Opened 5 years ago by bgoncalv.
bgoncalv/standard-test-roles fix-yaml-syntax  into  master

file modified
+5 -3
@@ -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

file modified
+1 -1
@@ -50,7 +50,7 @@ 

  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"

@@ -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

@@ -6,4 +6,3 @@ 

    file:

      state: absent

      path: "{{remote_artifacts}}/"

- 

@@ -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

- 

@@ -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

- 

file modified
+3 -2
@@ -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"

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)

@astepano the python syntax failed, and it seems to be a problem with astroid version 2.3.0 module. If I use downgrade it to 2.2.5 then inspekt lint --enable W0611,W0612,W0622 --disable W,R,C,E1002,E1101,E1103,E1120,F0401,I0011,E0611 /standard-test-roles/scripts/merge-standard-inventory works well...

@bgoncalv should get "green" confirmation from Jenkins?

@astepano it is testing on python syntax, as on my comment above, if you want the test to be fixed now what I can do is update tests/python-syntax.sh to force astroid==2.2.5 to be installed.

1 new commit added

  • freeze python modules for python-syntax.sh
5 years ago

@astepano now it passed the tests, but Error: Login invalid/expired. Please visit https://copr.fedorainfracloud.org/api to get or renew your API token.

pretty please pagure-ci rebuild

Commit 823e9f6 fixes this pull-request

Pull-Request has been merged by astepano

5 years ago

Pull-Request has been merged by astepano

5 years ago