action #34486
closeddatabase of "test cases" or how to search for tests we have in openQA
Description
Motivation¶
From time to time a request comes up "how to search for test cases in openQA". In many cases the definition of "test cases" is not clear to the person asking or no clear relation to our openQA terms exists. However, we should be able to provide an easy search interface which will simply by default return search results matching any of "testsuites", "scenarios", "test modules", "test steps".
Acceptance criteria¶
- DONE AC1: There is a common way to search for "tests" in openQA as a catch-all however ambiguous the term is understood
- DONE AC2: The user is asked one and only one question, that is the search term, nothing else
- AC3: Given a generic search term, When that search term matches any of test suite, scenario, test module, test steps or just mention in test code, Then all definition places are shown
Acceptance tests¶
- DONE AT1-1: manual UX test: An uninformed user can find the search field over the openQA web UI
- AT3-1: search term "foo" finds a test suite "foo"
- AT3-2: search term "foo" finds a test suite "123foo456"
- DONE AT3-3: search term "foo" finds a scenario "openSUSE-textmode@foo" for machine "foo"
- DONE AT3-4: search term "foo" finds a test module "tests/console/foo.pm" from a test distribution folder within /var/lib/openqa/share/tests/*/
- DONE AT3-5: search term "foo" finds a reference to "foo" in code within a test module "tests/console/bar.pm" as in AT3-4
Suggestion¶
- Find a good place for a search field, e.g. just in the top header bar, similar to what github has
- add API endpoint for search
- use API endpoint in UI search field
I envision a simple search textfield that queries:
- the names in the test suite database
- filenames in the test distribution(s), e.g. like https://github.com/os-autoinst/os-autoinst-distri-opensuse/search?q=filename%3Amultipath or
git ls-files "*<search_term>*"
- for multiple distributions, query all or just what is considered the "main" one
- search terms within the test distribution files, e.g. like https://github.com/os-autoinst/os-autoinst-distri-opensuse/search?q=multipath or
git grep <search_term>
- Show all of the results, probably a simple table view for all results from the above different queries
https://github.com/okurz/scripts/blob/master/openqa-db_query_last_use_of_module provides an external tool relying on database access but it can help to find out scenarios running a specified test module.
add keyboard shortcut to reach search field, again maybe just like github
optional: include job groups in search as well
optional: add search qualifiers, e.g. "testsuite:" or "finished:" (for jobs)
optional: extend for other stuff to search for, e.g. users, audit events, everything else we have in openQA … except maybe API keys and secrets ;)
see https://developer.github.com/v3/search/ for reference