Add global search to JUnit test reports
What does this MR do and why?
Implements #213691.
The JUnit test report page currently shows test results grouped by job. To find a specific failing test, a user must know which job it belongs to, click into it, and scroll through potentially hundreds of rows. There is no way to search across all jobs at once.
This MR adds a global search bar to the test report page that filters test cases by classname or name across all jobs simultaneously.
Key behaviours
- Search box appears in the heading row of the test report page, right-aligned, always visible.
- Summary view (no job selected): typing auto-fetches all job artifacts and shows a flat filtered list across all jobs.
- Drilled into a job: typing filters within that job only, with a subtle hint line: "Showing results from rspec-unit · Search all jobs" Clicking "Search all jobs" expands the scope to all jobs.
- Large pipelines (> 20 jobs): instead of auto-fetching, a confirmation prompt appears: "This pipeline has N jobs. Search results will include tests from all jobs." with a Search all jobs button. This avoids firing N server-side JUnit XML parses without user intent.
- Once all suites are fetched, subsequent searches are instant (no re-fetching).
- Search results show: Job, Suite (classname), Test name, Filename, Status, Duration, Details.
- Pagination is reset on each new search term.
Implementation notes
- New Vuex state:
searchTerm,searchScope('suite'|'all'),hasFetchedAllSuites,isLoadingAllSuites,pageInfo. - New actions:
setSearchTerm,setSearchScope,fetchAllSuites,setPage. - New getter:
getFilteredTestCasesfilters the flat list of all loaded test cases client-side; respectssearchScopeto restrict to the current suite when drilled in. SEARCH_ALL_SUITES_THRESHOLD = 20is based on suite count, since the cost is one HTTP request + one server-side XML parse per suite, regardless of how many tests each suite contains.- The heading row and search box are co-located in the same flex row in
test_reports.vueto guarantee consistent vertical alignment across all states (summary, suite drill-down, search results, no results). test_summary.vueaccepts a newshowHeadingprop (defaulttrue) so the parent can suppress its heading when the unified heading row is used instead.
References
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
If no. of jobs exceed SEARCH_ALL_SUITES_THRESHOLD (set to 20), it needs an explicit confirmation from user.

How to set up and validate locally
-
Ensure you have a pipeline with JUnit test report artifacts. You can seed one via the Rails console:
# Pipeline should have multiple jobs each uploading a junit.xml artifact -
Navigate to the pipeline's Tests tab:
http://your-gdk-host/namespace/project/-/pipelines/:id/test_report -
Validate summary view search:
- Type a class name or test name in the search box (top right)
- Results from all jobs should appear in a flat table
- Clearing the search restores the normal summary view
-
Validate job-scoped search:
- Click into any job row to drill down
- Type in the search box
- Results should be scoped to that job only
- The hint line "Showing results from · Search all jobs" should appear
- Clicking "Search all jobs" should expand results to all jobs
-
Validate large pipeline prompt (optional):
- Temporarily lower
SEARCH_ALL_SUITES_THRESHOLDto a value below your pipeline's job count - Type in the search box from the summary view
- A confirmation alert should appear instead of auto-fetching
- Temporarily lower
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
- I have added/updated tests for the new behaviour (Jest unit tests — to be added in a follow-up)
- I have run
bin/rake gettext:regenerateto updatelocale/gitlab.pot - UI changes have been tested in the GDK locally
- No new N+1 queries introduced (search is client-side after initial artifact fetch)



