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

Move finished jobs filter subtest to correct file #6051

Merged

Conversation

r-richardson
Copy link
Contributor

@r-richardson r-richardson commented Nov 7, 2024

This commit moves the subtest result filter does not affect scheduled and running jobs to t/ui/01-list.t, which tests the /tests page.

This commit moves the subtest `result filter does not affect scheduled and running jobs` to t/ui/01-list.t, which tests the /tests page.
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.98%. Comparing base (29fdf01) to head (817cdac).
Report is 15 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6051   +/-   ##
=======================================
  Coverage   98.98%   98.98%           
=======================================
  Files         395      395           
  Lines       39428    39447   +19     
=======================================
+ Hits        39028    39047   +19     
  Misses        400      400           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mergify mergify bot merged commit 46542c7 into os-autoinst:master Nov 7, 2024
46 checks passed
Comment on lines +429 to +441
subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');

my @running_jobs = $driver->find_elements('#running tbody tr');
is scalar @running_jobs, 3, 'Running jobs are displayed';

my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr');
is scalar @scheduled_jobs, 3, 'Scheduled jobs are displayed';

my @finished_jobs = $driver->find_elements('#results tbody tr');
is scalar @finished_jobs, 3, 'Finished jobs table is correctly filtered';
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now at best in a separate commit use a more concise style

Suggested change
subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');
my @running_jobs = $driver->find_elements('#running tbody tr');
is scalar @running_jobs, 3, 'Running jobs are displayed';
my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr');
is scalar @scheduled_jobs, 3, 'Scheduled jobs are displayed';
my @finished_jobs = $driver->find_elements('#results tbody tr');
is scalar @finished_jobs, 3, 'Finished jobs table is correctly filtered';
};
subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');
my @running_jobs = $driver->find_elements('#running tbody tr');
is scalar @running_jobs, 3, 'Running jobs are displayed';
my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr');
is scalar @scheduled_jobs, 3, 'Scheduled jobs are displayed';
my @finished_jobs = $driver->find_elements('#results tbody tr');
is scalar @finished_jobs, 3, 'Finished jobs table is correctly filtered';
};

or even

Suggested change
subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');
my @running_jobs = $driver->find_elements('#running tbody tr');
is scalar @running_jobs, 3, 'Running jobs are displayed';
my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr');
is scalar @scheduled_jobs, 3, 'Scheduled jobs are displayed';
my @finished_jobs = $driver->find_elements('#results tbody tr');
is scalar @finished_jobs, 3, 'Finished jobs table is correctly filtered';
};
subtest 'result filter does not affect scheduled and running jobs' => sub {
$driver->get('/tests?resultfilter=Failed');
is scalar $driver->find_elements('#running tbody tr'), 3, 'Running jobs are displayed';
is scalar $driver->find_elements('#scheduled tbody tr'), 3, 'Scheduled jobs are displayed';
is scalar $driver->find_elements('#results tbody tr'), 3, 'Finished jobs table is correctly filtered';
};

maybe scalar isn't even needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants