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
Updated by szarate over 6 years ago
- Description updated (diff)
@okurz by:
**AC2:** The user is one and only one question, that is the search term, nothing else
You mean that the user has one and only one question? :).
I guess that for things like this, things would need to be indexed, and that filtering (eg. by build or distri) would be only for names of test suites and scenarios.
Updated by okurz over 6 years ago
szarate wrote:
@okurz by:
**AC2:** The user is one and only one question, that is the search term, nothing else
You mean that the user has one and only one question? :).
I am assuming that the user does not know if he means a testsuite, test module, test step, scenario, product, etc. So I envision the default to be simplistic, like google once was, just a single text field. Ok, you can provide buttons below or above the search bar for advanced stuff, help, customization but let's start simple :)
I guess that for things like this, things would need to be indexed, and that filtering (eg. by build or distri) would be only for names of test suites and scenarios.
What do you want to index? We have git repos -> already indexed, and we have database tables for test suites, so go with that :)
Updated by EDiGiacinto over 6 years ago
okurz wrote:
szarate wrote:
@okurz by:
**AC2:** The user is one and only one question, that is the search term, nothing else
You mean that the user has one and only one question? :).
I am assuming that the user does not know if he means a testsuite, test module, test step, scenario, product, etc. So I envision the default to be simplistic, like google once was, just a single text field. Ok, you can provide buttons below or above the search bar for advanced stuff, help, customization but let's start simple :)
While i can agree with being simplistic i don't share re-implementing google.
I guess that for things like this, things would need to be indexed, and that filtering (eg. by build or distri) would be only for names of test suites and scenarios.
What do you want to index? We have git repos -> already indexed, and we have database tables for test suites, so go with that :)
What you propose basically is a killer (as in resources) api endpoint that does a complex query - including search in a git subtree. That's why you might want an index where to search data instead of doing the search directly whenever a user request it.
Updated by rpalethorpe over 6 years ago
Oliver just try screen scraping the whole of OpenQA and index every page with Xapian (see https://gitlab.suse.de/alnovak/fast-bzsearch/tree/master). As you are basically asking for a totally unstructured text search which OpenQA has no infrastructure to support, Xapian is really fast and you already know how to screen scrape OpenQA.
Updated by okurz about 6 years ago
- Related to action #38024: [functional][y] Add ability to search for a module occurrences in all the tests of job group added
Updated by okurz over 4 years ago
- Has duplicate action #65954: Create a way to check which jobs contain a test added
Updated by okurz over 4 years ago
- Related to coordination #64126: [qe-core][epic] Identify packages that have automated indirect testing or that have sufficient build time test suite added
Updated by mkittler over 4 years ago
I'm really wondering about the idea to search the file system. Beside the problem pointed out by @EDiGiacinto I'm wondering what you want to do once you've found a file in the repository. There's no relation from such a file to a concrete openQA job. But openQA jobs are what the results of that search are supposed to be, right? The acceptance criteria should clarify what kind of results the search is supposed to reveal. I assume visitors of the openQA page would expect to find concrete openQA jobs and if they wanted to search for particular files within a certain test distribution they would use a different kind of search in the first place.
Updated by livdywan over 4 years ago
mkittler wrote:
I'm really wondering about the idea to search the file system. Beside the problem pointed out by @EDiGiacinto I'm wondering what you want to do once you've found a file in the repository. There's no relation from such a file to a concrete openQA job. But openQA jobs are what the results of that search are supposed to be, right? The acceptance criteria should clarify what kind of results the search is supposed to reveal. I assume visitors of the openQA page would expect to find concrete openQA jobs and if they wanted to search for particular files within a certain test distribution they would use a different kind of search in the first place.
Not sure where searching the file system comes from. But one of the duplicates was based on this real use case:
- Allison Average looks at #63244.
- The example URLs are dead.
- So she wants to find jobs using
qa_run
.
Updated by okurz over 4 years ago
- Description updated (diff)
mkittler wrote:
[…] There's no relation from such a file to a concrete openQA job
Correct. But imagine the following: A QA automation engineer wonders if any test coverage for nginx exists. So you might call https://openqa.opensuse.org/tests?match=nginx and find nothing because there is no test suite or scenario that mentions "nginx" in the name.
But openQA jobs are what the results of that search are supposed to be, right?
No. As above, there might be no test suite or scenario that mention "nginx", but the openqa test suite "textmode" might include a test module from os-autoinst-distri-opensuse called "httpd.pm" that has zypper -n in nginx && systemctl start nginx
. You can only find that by looking into the test distribution code, i.e. files on the file system or the mentioned search in the repo using the github search.
The acceptance criteria should clarify what kind of results the search is supposed to reveal. I assume visitors of the openQA page would expect to find concrete openQA jobs and if they wanted to search for particular files within a certain test distribution they would use a different kind of search in the first place.
My experience tells me that they don't. It happened multiple times that QA engineers create a pull request – after weeks worth of work invested! – to add test code for something that already exists and they were not aware. Why? Mainly because they never searched simply in os-autoinst-distri-opensuse for mentions of the package/component/file/service/module/feature to be tested.
I do not see the relation that cdywan has mentioned relating to #63244 but the other related issues linked to this ticket here already show other examples of the same.
I think the acceptance criteria are not vague but generic and they should be. Still I tried to extend them now also with acceptance tests to show even more explicitly what I expect
Updated by okurz over 4 years ago
- Description updated (diff)
- Status changed from New to Workable
Add more suggestions. If you think like this the ticket is feasible and well-specified but too big we can split it in sub tasks, e.g. "generic search API route /api/v1/search looking at test suites only (as a first step)"
Updated by mkittler over 4 years ago
Ok, so this ticket is about combining different places to search but not being smart about the relations of the things we might find. So if "nginx" is found in a file of the test distribution that file's path is part of the results but there are still no related openQA jobs returned unless "nginx" shows up within the job settings or job module names.
Updated by livdywan over 4 years ago
- Status changed from Workable to In Progress
After having researched what's needed for this, I took a step back and pushed code for the following aspects:
- Search results view
- AT3-4 - Search for Perl modules by filename
- AT3-5 - Search Perl module contents
Updated by livdywan over 4 years ago
The initial implementation of the global search UI as well as the underlying REST API got merged - we decided to put it in the experimental namespace for now.
As per discussion, I'm also proposing a follow-up to improve general responsiveness: https://github.com/os-autoinst/openQA/pull/3313
Updated by mgrifalconi over 4 years ago
Hello, I would like to propose the following use case.
- I am working with
mau-extratests
test suite - I know which perl modules it runs
I don't know how to find openqa tests to clone that run
mau-extratests
I search for
mau-extratests
(possibly filtering only for job groups results)I get as result, between the others:
The job template: https://openqa.suse.de/admin/job_templates/232
because it contains:
- mau-extratests
- mau-filesystem
[..]
- mau-extratests-desktop:
Thanks!
Updated by livdywan over 4 years ago
- Improvements to matches for file contents: os-autoinst/openQA#3317
- Skip arbitrary files in the test root: os-autoinst/openQA#3318
Updated by livdywan over 4 years ago
mgrifalconi wrote:
Hello, I would like to propose the following use case.
- I am working with
mau-extratests
test suite- I know which perl modules it runs
- I don't know how to find openqa tests to clone that run
mau-extratests
- I search for
mau-extratests
(possibly filtering only for job groups results)- I get as result, between the others:
The job template: https://openqa.suse.de/admin/job_templates/232
because it contains:- mau-extratests - mau-filesystem [..] - mau-extratests-desktop:
Thank you for your feedback! I prepared a branch that searches job templates, which I think is what you want:
Updated by livdywan over 4 years ago
More potentially interesting match types:
- Needles
- Assets
- Bugs
Job by job module
I will also propose a PR to handle the testrepo symlink to avoid redundant results.
@mkittler also suggested we display the type of result, maybe as an icon.
We should link results, e.g. a job template links to the job group.
Updated by livdywan over 4 years ago
cdywan wrote:
- I will also propose a PR to handle the testrepo symlink to avoid redundant results. https://github.com/os-autoinst/openQA/pull/3331
Updated by okurz over 4 years ago
As discussed in the weekly QA tools team meeting a next idea would be to return current job module results similar to what https://github.com/okurz/scripts/blob/master/openqa-db_query_last_use_of_module as mentioned in the description already provides.
Updated by okurz over 4 years ago
- Copied to coordination #70840: [epic] further features for the "search" feature added
Updated by okurz over 4 years ago
I moved out all further, additional ideas into #70840 , please focus on adding the "job module results" only today to be able to resolve this ticket.
Updated by livdywan over 4 years ago
Updated by livdywan about 4 years ago
- Status changed from In Progress to Feedback
Updated by okurz about 4 years ago
- Status changed from Feedback to Resolved
so https://github.com/os-autoinst/openQA/pull/3353 is in and also deployed on osd now. Searching for job modules also works now, e.g. https://openqa.opensuse.org/search?q=kontact
All the rest is left for #70840