tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Allow test selection using a shell script

Open psss opened this issue 4 years ago • 2 comments

@bachradsusi shared an interesting use case: In the selinux tests repository they are using a shell script to pick only those tests which have been modified by the pull request:

- name: Generate list of tests in this PR
  shell: |
      git log --format= --stat --name-only origin/master..HEAD | sed '/\//!d;s#\(.*\)/.*#\1#' | sort -u | xargs
  delegate_to: localhost
  register: tests_list

It would be nice to provide a similar functionality in the discover step. Currently we support selecting tests by name or filter:

discover:
    how: fmf
    test: /tests/basic
    filter: 'tier: 1'

We could also support executing a shell script instead:

discover:
    how: fmf
    test: shell(git log...)
    filter: 'tier: 1'

This brings, however, a similar question about security as mentioned in #373.

psss avatar Oct 15 '20 12:10 psss