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

@@ -25,7 +25,9 @@ 

  

  - block:

    - name: Execute the avocado test

-     shell: exec 2>>{{ remote_artifacts }}/test.log 1>>{{ remote_artifacts }}/test.log; MODULE=rpm python -m avocado run --job-results-dir {{ remote_artifacts }}/ {{tests|join(' ') }}

+     shell: >

+       exec 2>>{{ remote_artifacts }}/test.log 1>>{{ remote_artifacts }}/test.log;

+       MODULE=rpm python -m avocado run --job-results-dir {{ remote_artifacts }}/ {{tests|join(' ') }}

  

    always:

    - name: Pull out the logs

@@ -9,18 +9,27 @@ 

  #     tests:

  #     - test one:

  #         dir: tdir for test 1

- #         run: echo '$'; echo '\$'; echo a1; echo "a$2"; a3="a3\na3"; echo -e ${a3}; echo \$a4; echo '$a5'; echo ">\"a6\"<"; echo "a7'\""; echo "(a8)" ; (echo "a9"); echo $(echo "a10"); echo 'a11$a11"'; echo '\\a12\\'; echo '"a13';false

+ #         run: echo '$'; echo '\$'; echo a1; echo "a$2"; a3="a3\na3"; echo -e ${a3}; \

+ #              echo \$a4; echo '$a5'; echo ">\"a6\"<"; echo "a7'\""; echo "(a8)" ; \

+ #              (echo "a9"); echo $(echo "a10"); echo 'a11$a11"'; echo '\\a12\\'; echo '"a13';false

  

  - block:

    - name: Execute tests

      script: |

          run-basic-test -v \

-                 --workdir "{{ tenv_workdir }}/{{ item if item.keys is not defined else item[(item.keys()|list)[0]]['dir']|default((item.keys()|list)[0]) }}" \

+                 --workdir "{{ tenv_workdir }}/{{ item if item.keys is not defined else

+                            item[(item.keys()|list)[0]]['dir']|default((item.keys()|list)[0]) }}" \

                  --artifactsdir "{{ remote_artifacts }}" \

                  --test "{{ item if item.keys is not defined else (item.keys()|list)[0] }}" \

-                 --timeout "{{ '0' if item.keys is not defined else item[(item.keys()|list)[0]]['timeout']|default('0') }}" \

-                 --cmd "{{ './runtest.sh' if item.keys is not defined else item[(item.keys()|list)[0]]['run']|default('./runtest.sh') | regex_replace('\\', '\\\\') | regex_replace('\"', '\"') | regex_replace('\$', '\\$') }}" \

-                 --save-files "{{ '' if item.keys is not defined else item[(item.keys()|list)[0]]['save_files']|default(item[(item.keys()|list)[0]]['save-files']|default('')) | join(',') | regex_replace('\\', '\\\\') | regex_replace('\"', '\"') | regex_replace('\$', '\\$') }}"

+                 --timeout "{{ '0' if item.keys is not defined else

+                            item[(item.keys()|list)[0]]['timeout']|default('0') }}" \

+                 --cmd "{{ './runtest.sh' if item.keys is not defined else

+                        item[(item.keys()|list)[0]]['run']|default('./runtest.sh') | regex_replace('\\', '\\\\') |

+                        regex_replace('\"', '\"') | regex_replace('\$', '\\$') }}" \

+                 --save-files "{{ '' if item.keys is not defined else

+                               item[(item.keys()|list)[0]]['save_files']|

+                               default(item[(item.keys()|list)[0]]['save-files']|default('')) | join(',') |

+                               regex_replace('\\', '\\\\') | regex_replace('\"', '\"') | regex_replace('\$', '\\$') }}"

      with_items:

      - "{{ tests }}"

  

@@ -56,7 +56,8 @@ 

      script: run-beakerlib-test --workdir {{ tenv_workdir }} \

                      --artifactsdir {{ remote_artifacts }} \

                      --test "{{ item if item.keys is not defined else (item.keys()|list)[0] }}" \

-                     --timeout "{{ '0' if item.keys is not defined else item[(item.keys()|list)[0]]['timeout']|default('0') }}"

+                     --timeout "{{ '0' if item.keys is not defined else

+                                item[(item.keys()|list)[0]]['timeout']|default('0') }}"

      with_items:

      - "{{ tests }}"

      - "{{ filter_tests }}"

@@ -90,7 +90,8 @@ 

  - name: Extract and setup the sources

    shell: |

      rm -rf "{{srcdir}}"

-     rpmbuild -bp {{tenv_workdir}}/*.spec --nodeps --define "_sourcedir {{tenv_workdir}}/" --define "_builddir {{srcdir}}"

+     rpmbuild -bp {{tenv_workdir}}/*.spec --nodeps --define \

+     "_sourcedir {{tenv_workdir}}/" --define "_builddir {{srcdir}}"

    args:

      warn: false

    when: not fetch_only

@@ -10,7 +10,7 @@ 

      - name: Set fact 'is_atomic'

        delegate_facts: True

        set_fact:

-         is_atomic : "{{ os_release_atomic.found > 0 }}"

+         is_atomic: "{{ os_release_atomic.found > 0 }}"

  

  - name: Set facts about system

    delegate_facts: True

@@ -10,7 +10,7 @@ 

      - name: Set fact 'is_atomic'

        delegate_facts: True

        set_fact:

-         is_atomic : "{{ os_release_atomic.found > 0 }}"

+         is_atomic: "{{ os_release_atomic.found > 0 }}"

  

  - name: Set facts about system

    delegate_facts: True

@@ -34,4 +34,3 @@ 

      verbosity: 1

  

  - include_tasks: "pkgs-{{ pkg_mgr | trim}}.yml"

- 

@@ -40,7 +40,7 @@ 

      register: package_check

      changed_when: False

      failed_when: False

-     args: { warn: no }

+     args: {warn: no}

    - name: Install test-specific package requirements

      shell:

        rpm-ostree install {{ pkgs_atomic_req }}

@@ -36,4 +36,3 @@ 

    retries: 5

    delay: 10

    until: result is succeeded

- 

With the fix some warnings are still left...

# yamllint -d "{extends: default, rules: {line-length: {max: 120}, indentation: disable}}"  roles/
roles/standard-test-avocado/tasks/main.yml
6:11      warning  too few spaces before comment  (comments)

roles/standard-test-source/vars/main.yml
6:10      warning  truthy value should be one of [false, true]  (truthy)
7:13      warning  truthy value should be one of [false, true]  (truthy)

roles/standard-test-source/tasks/main.yml
13:21     warning  truthy value should be one of [false, true]  (truthy)
34:21     warning  truthy value should be one of [false, true]  (truthy)
38:20     warning  truthy value should be one of [false, true]  (truthy)

roles/standard-test-beakerlib/tasks/main.yml
39:12     warning  truthy value should be one of [false, true]  (truthy)
48:12     warning  truthy value should be one of [false, true]  (truthy)

roles/str-common-pkgs/tasks/pkgs-rpm-ostree.yml
1:1       warning  missing document start "---"  (document-start)
29:18     warning  truthy value should be one of [false, true]  (truthy)
41:19     warning  truthy value should be one of [false, true]  (truthy)
42:18     warning  truthy value should be one of [false, true]  (truthy)
43:18     warning  truthy value should be one of [false, true]  (truthy)

roles/str-common-pkgs/tasks/main.yml
1:1       warning  missing document start "---"  (document-start)

roles/str-common-pkgs/tasks/inspect.yml
1:1       warning  missing document start "---"  (document-start)
7:19      warning  truthy value should be one of [false, true]  (truthy)
8:21      warning  truthy value should be one of [false, true]  (truthy)
11:23     warning  truthy value should be one of [false, true]  (truthy)
16:19     warning  truthy value should be one of [false, true]  (truthy)

roles/str-common-pkgs/tasks/pkgs-yum.yml
1:1       warning  missing document start "---"  (document-start)
18:18     warning  truthy value should be one of [false, true]  (truthy)

roles/str-common-pkgs/tasks/pkgs-dnf.yml
1:1       warning  missing document start "---"  (document-start)
25:18     warning  truthy value should be one of [false, true]  (truthy)

roles/standard-test-basic/vars/main.yml
2:1       warning  missing document start "---"  (document-start)

roles/str-common-init/tasks/main.yml
1:1       warning  missing document start "---"  (document-start)

roles/str-common-init/tasks/inspect.yml
1:1       warning  missing document start "---"  (document-start)
7:19      warning  truthy value should be one of [false, true]  (truthy)
8:21      warning  truthy value should be one of [false, true]  (truthy)
11:23     warning  truthy value should be one of [false, true]  (truthy)
16:19     warning  truthy value should be one of [false, true]  (truthy)

roles/str-common-init/tasks/trunner.yml
1:1       warning  missing document start "---"  (document-start)
10:21     warning  truthy value should be one of [false, true]  (truthy)
31:21     warning  truthy value should be one of [false, true]  (truthy)
34:21     warning  truthy value should be one of [false, true]  (truthy)
53:21     warning  truthy value should be one of [false, true]  (truthy)

Commit ef0437c fixes this pull-request

Pull-Request has been merged by astepano

4 years ago

Pull-Request has been merged by astepano

4 years ago