#336 standard-test-basic not working with inline test scripts
Closed: INVALID by ekulik. Opened by ekulik.

Aside from being hard to read, this seems to be trying to execute runtest.sh unconditionally:

TEST_CMD:
    "{{'./runtest.sh' if item.keys is not defined else item[(item.keys()|list)[0]]['run']|default('./runtest.sh')}}"

I rewrote that particular line to

"{{ item.run | default('./runtest.sh') }}"

and it works just fine. Before I bother with creating a PR, maybe someone can shed some light as to why that was written the way it was, and if my replacement is okay.


@ekulik could you please paste your playbook here?
We have been using this role to run tests that call different script then ./runtest.sh without issue.

---
- hosts: localhost
  tags:
    - classic
  pre_tasks:
    - name: Copy spec file to remote machine
      copy:
        src: "{{ playbook_dir }}/../python-argh.spec"
        dest: /tmp/python-argh.spec
    - name: Install build dependencies
      shell: dnf -y build-dep /tmp/python-argh.spec
      args:
        warn: false
  roles:
    - role: standard-test-source
    - role: standard-test-basic
      tests:
        - foo:
          dir: ./source
          run: python3 setup.py test

Could you try the playbook below? The change was related to indentation of test case name and test case name parameters.

---
- hosts: localhost
tags:
    - classic
pre_tasks:
    - name: Copy spec file to remote machine
    copy:
        src: "{{ playbook_dir }}/../python-argh.spec"
        dest: /tmp/python-argh.spec
    - name: Install build dependencies
    shell: dnf -y build-dep /tmp/python-argh.spec
    args:
        warn: false
roles:
    - role: standard-test-source
    - role: standard-test-basic
    tests:
    - foo:
        dir: ./source
        run: python3 setup.py test

Urgh, yeah, seems that I have selective blindness. Thanks and sorry for the noise!

Metadata Update from @ekulik:
- Issue close_status updated to: INVALID
- Issue status updated to: Closed (was: Open)

Metadata