Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix modules filter wrong results while using comma #1993

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/OpenQA/Utils.pm
Expand Up @@ -962,8 +962,8 @@ sub compose_job_overview_search_args {
$search_args{$arg} = {-in => $params};
}
}
if ($controller->param('modules')) {
$search_args{modules} = $controller->every_param('modules');
if (my $modules = param_hash($controller, 'modules')) {
$search_args{modules} = [keys %$modules];
}
if ($controller->param('modules_result')) {
$search_args{modules_result} = $controller->every_param('modules_result');
Expand Down
14 changes: 12 additions & 2 deletions t/ui/10-tests_overview.t
Expand Up @@ -267,14 +267,24 @@ subtest 'filtering by module' => sub {
my $number_of_found_jobs = 4;
$driver->get("/tests/overview?arch=&distri=opensuse&modules_result=$result");
my @jobs = $driver->find_elements($JOB_ICON_SELECTOR);
# Assert that all the jobs with the specified module and result are shown in the results
# Assert that all the jobs with the specified result are shown in the results
is(scalar @jobs, $number_of_found_jobs,
"$number_of_found_jobs jobs where modules with \"$result\" result found");
element_visible('#res_DVD_i586_kde');
element_visible('#res_DVD_x86_64_kde');
element_visible('#res_DVD_i586_textmode');
element_visible('#res_DVD_x86_64_doc');
}
};
subtest "jobs containing all the modules separated by comma are present" => sub {
my $modules = 'kate,zypper_up';
my $number_of_found_jobs = 2;
$driver->get("/tests/overview?arch=&distri=opensuse&modules=$modules&modules_result=$result");
my @jobs = $driver->find_elements($JOB_ICON_SELECTOR);
# Assert that all the jobs with the specified modules and result are shown in the results
is(scalar @jobs, $number_of_found_jobs, "$number_of_found_jobs jobs with \"$modules\" modules found");
element_visible('#res_DVD_i586_kde');
element_visible('#res_DVD_i586_textmode');
};
};

kill_driver();
Expand Down