From 84de8115fa55f9ea4a11ae154992c5b2df92d8c4 Mon Sep 17 00:00:00 2001 From: "Jose D. Gomez R" Date: Thu, 26 Oct 2023 09:43:07 +0200 Subject: [PATCH 1/2] experiment: Unify perl linting rules --- .perltidyrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.perltidyrc b/.perltidyrc index 24a69487529..60eb7efa11d 100644 --- a/.perltidyrc +++ b/.perltidyrc @@ -2,8 +2,9 @@ # # See . --character-encoding=none --no-valign --l=120 # 120 characters per line +-l=160 -fbl # don't change blank lines +-fnl # don't remove new lines -nsfs # no spaces before semicolons -baao # space after operators -bbao # space before operators From 5b1d054bca921351d156d4987a309791c4551745 Mon Sep 17 00:00:00 2001 From: "Jose D. Gomez R" Date: Thu, 26 Oct 2023 09:44:59 +0200 Subject: [PATCH 2/2] Applying perltidy rules --- lib/OpenQA/Constants.pm | 2 +- lib/OpenQA/LiveHandler/Controller/LiveViewHandler.pm | 4 ++-- lib/OpenQA/Parser/Format/JUnit.pm | 2 +- lib/OpenQA/Schema/Result/Jobs.pm | 4 ++-- lib/OpenQA/Schema/Result/ScheduledProducts.pm | 8 ++++---- lib/OpenQA/Schema/Result/Workers.pm | 2 +- lib/OpenQA/Script/CloneJob.pm | 2 +- lib/OpenQA/Task/Asset/Limit.pm | 2 +- lib/OpenQA/WebAPI/Controller/API/V1/Job.pm | 2 +- lib/OpenQA/WebAPI/Controller/API/V1/Table.pm | 2 +- lib/OpenQA/WebAPI/Controller/Test.pm | 6 +++--- lib/OpenQA/WebAPI/Plugin/Helpers.pm | 2 +- lib/OpenQA/WebAPI/Plugin/ObsRsync.pm | 6 +++--- lib/OpenQA/WebSockets/Controller/Worker.pm | 2 +- lib/OpenQA/Worker/WebUIConnection.pm | 2 +- t/01-style.t | 2 +- t/01-test-utilities.t | 2 +- t/05-scheduler-capabilities.t | 2 +- t/05-scheduler-dependencies.t | 6 +++--- t/05-scheduler-restart-and-duplicate.t | 2 +- t/10-jobs.t | 4 ++-- t/14-grutasks.t | 4 ++-- t/16-markdown.t | 2 +- t/17-labels_carry_over.t | 2 +- t/24-worker-engine.t | 2 +- t/24-worker-jobs.t | 4 ++-- t/24-worker-overall.t | 2 +- t/24-worker-webui-connection.t | 2 +- t/27-websockets.t | 2 +- t/api/02-iso.t | 4 ++-- t/api/04-jobs.t | 2 +- t/api/08-jobtemplates.t | 4 ++-- t/api/14-plugin_obs_rsync_async.t | 2 +- t/api/16-webhooks.t | 2 +- t/lib/OpenQA/SeleniumTest.pm | 2 +- t/ui/07-file.t | 2 +- t/ui/12-needle-edit.t | 10 +++++----- t/ui/13-admin.t | 2 +- t/ui/15-comments.t | 2 +- t/ui/18-tests-details.t | 2 +- t/ui/25-developer_mode.t | 4 ++-- 41 files changed, 62 insertions(+), 62 deletions(-) diff --git a/lib/OpenQA/Constants.pm b/lib/OpenQA/Constants.pm index 45c9133f3a1..f41577347ca 100644 --- a/lib/OpenQA/Constants.pm +++ b/lib/OpenQA/Constants.pm @@ -69,7 +69,7 @@ use constant WORKER_STOP_REASONS => ( # Define error categories used alongside the reasons defined above for finer error handling where needed use constant { WORKER_EC_CACHE_FAILURE => 'cache failure', # the cache service made problems - WORKER_EC_ASSET_FAILURE => 'asset failure', # a problem occurred when handling assets, e.g. an asset was not found + WORKER_EC_ASSET_FAILURE => 'asset failure', # a problem occurred when handling assets, e.g. an asset was not found }; # Time verification to use with the "worker_timeout" configuration. diff --git a/lib/OpenQA/LiveHandler/Controller/LiveViewHandler.pm b/lib/OpenQA/LiveHandler/Controller/LiveViewHandler.pm index 45ad18c8eff..696b5cd47ac 100644 --- a/lib/OpenQA/LiveHandler/Controller/LiveViewHandler.pm +++ b/lib/OpenQA/LiveHandler/Controller/LiveViewHandler.pm @@ -377,7 +377,7 @@ sub connect_to_cmd_srv { error => 'unable to upgrade ws to command server') unless $tx->is_websocket; -# assign transaction: don't do this before to prevent regular HTTP connections to be used in send_message_to_os_autoinst + # assign transaction: don't do this before to prevent regular HTTP connections to be used in send_message_to_os_autoinst $self->cmd_srv_transactions_by_job->{$job_id} = $tx; # instantly query the os-autoinst status @@ -500,7 +500,7 @@ sub ws_proxy { error => 'unable to create (further) development session'); } # mark session as active - $developer_session->update({ws_connection_count => \'ws_connection_count + 1'}); #'restore syntax highlighting + $developer_session->update({ws_connection_count => \'ws_connection_count + 1'}); #'restore syntax highlighting } # add JavaScript transaction to the list of JavaScript transactions for this job diff --git a/lib/OpenQA/Parser/Format/JUnit.pm b/lib/OpenQA/Parser/Format/JUnit.pm index a194c1be0ef..34219e404a6 100644 --- a/lib/OpenQA/Parser/Format/JUnit.pm +++ b/lib/OpenQA/Parser/Format/JUnit.pm @@ -77,7 +77,7 @@ sub parse { my $num = 1; for my $tc ($ts, $ts->children('testcase')->each) { - # create extra entry for whole testsuite if there is any system-out or system-err outside of particular testcase + # create extra entry for whole testsuite if there is any system-out or system-err outside of particular testcase next if ($tc->tag eq 'testsuite' && $tc->children('system-out, system-err')->size == 0); my $tc_result = $ts_result; # use overall testsuite result as fallback diff --git a/lib/OpenQA/Schema/Result/Jobs.pm b/lib/OpenQA/Schema/Result/Jobs.pm index 0a5ce49a2c8..19679fcc0ce 100644 --- a/lib/OpenQA/Schema/Result/Jobs.pm +++ b/lib/OpenQA/Schema/Result/Jobs.pm @@ -372,7 +372,7 @@ sub prepare_for_work ($self, $worker = undef, $worker_properties = {}) { @{$job_hashref->{settings}}{keys %$updated_settings} = values %$updated_settings if $updated_settings; - if ( $job_hashref->{settings}->{NICTYPE} + if ($job_hashref->{settings}->{NICTYPE} && !defined $job_hashref->{settings}->{NICVLAN} && $job_hashref->{settings}->{NICTYPE} ne 'user') { @@ -1149,7 +1149,7 @@ sub delete_videos ($self) { my @files = (find_video_files($result_dir), Mojo::Collection->new(path($result_dir, 'video_time.vtt'))); my $deleted_size = _delete_returning_size_from_array(\@files); - $self->update({result_size => \"greatest(0, result_size - $deleted_size)"}); # considering logs still present here + $self->update({result_size => \"greatest(0, result_size - $deleted_size)"}); # considering logs still present here return $deleted_size; } diff --git a/lib/OpenQA/Schema/Result/ScheduledProducts.pm b/lib/OpenQA/Schema/Result/ScheduledProducts.pm index ef2f5656eab..7e95678e386 100644 --- a/lib/OpenQA/Schema/Result/ScheduledProducts.pm +++ b/lib/OpenQA/Schema/Result/ScheduledProducts.pm @@ -586,7 +586,7 @@ sub _generate_jobs { } for my $job_template (@templates) { # compose settings from product, machine, testsuite and job template itself - # note: That order also defines the precedence from lowest to highest. The only exception is the WORKER_CLASS + # note: That order also defines the precedence from lowest to highest. The only exception is the WORKER_CLASS # variable where all occurrences are merged. my %settings; my %params = ( @@ -712,7 +712,7 @@ sub _create_dependencies_for_parents { if ($worker_class ne $parent_worker_class) { my $test_name = $job->settings_hash->{TEST}; die -"Worker class of $test_name ($worker_class) does not match the worker class of its directly chained parent ($parent_worker_class)"; + "Worker class of $test_name ($worker_class) does not match the worker class of its directly chained parent ($parent_worker_class)"; } } $job_dependencies->create( @@ -779,7 +779,7 @@ sub _schedule_from_yaml ($self, $args, $skip_chained_deps, $include_children, @l next unless defined $products; next unless my $product = $products->{$product_name}; next - if ( $product->{distri} ne _distri_key($args) + if ($product->{distri} ne _distri_key($args) || $product->{flavor} ne $args->{FLAVOR} || ($product->{version} ne '*' && $product->{version} ne $args->{VERSION}) || $product->{arch} ne $args->{ARCH}); @@ -951,7 +951,7 @@ sub cancel ($self, $reason = undef) { # update status to CANCELLING if (!$self->_update_status_if(CANCELLING, -not => {status => SCHEDULING})) { - # the scheduled product is SCHEDULING; set it nevertheless to CANCELLING but back off from cancelling immediately + # the scheduled product is SCHEDULING; set it nevertheless to CANCELLING but back off from cancelling immediately # unless it is not SCHEDULING anymore after all return 0 if $self->_update_status_if(CANCELLING, status => SCHEDULING); } diff --git a/lib/OpenQA/Schema/Result/Workers.pm b/lib/OpenQA/Schema/Result/Workers.pm index 1abb976c7d1..f820197e2fc 100644 --- a/lib/OpenQA/Schema/Result/Workers.pm +++ b/lib/OpenQA/Schema/Result/Workers.pm @@ -281,7 +281,7 @@ sub reschedule_assigned_jobs { } catch { my $worker_id = $self->id; # uncoverable statement - log_warning("Unable to re-schedule job $job_id abandoned by worker $worker_id: $_"); # uncoverable statement + log_warning("Unable to re-schedule job $job_id abandoned by worker $worker_id: $_"); # uncoverable statement }; } } diff --git a/lib/OpenQA/Script/CloneJob.pm b/lib/OpenQA/Script/CloneJob.pm index 5081d2ff3de..2e839d9d756 100644 --- a/lib/OpenQA/Script/CloneJob.pm +++ b/lib/OpenQA/Script/CloneJob.pm @@ -192,7 +192,7 @@ sub openqa_baseurl ($local_url) { my $port = ''; if ( $local_url->port - && ( ($local_url->scheme eq 'http' && $local_url->port != 80) + && (($local_url->scheme eq 'http' && $local_url->port != 80) || ($local_url->scheme eq 'https' && $local_url->port != 443))) { $port = ':' . $local_url->port; diff --git a/lib/OpenQA/Task/Asset/Limit.pm b/lib/OpenQA/Task/Asset/Limit.pm index 6e9d527ce18..ca98e55357c 100644 --- a/lib/OpenQA/Task/Asset/Limit.pm +++ b/lib/OpenQA/Task/Asset/Limit.pm @@ -117,7 +117,7 @@ sub _limit { my $age_in_days = $age->delta_days($now)->in_units('days'); if ($age_in_days >= $limit_in_days) { _remove_if($schema, $asset, - "Removing asset $asset_name (not in any group, age " + "Removing asset $asset_name (not in any group, age " . "($age_in_days days) exceeds limit ($limit_in_days days)"); } else { diff --git a/lib/OpenQA/WebAPI/Controller/API/V1/Job.pm b/lib/OpenQA/WebAPI/Controller/API/V1/Job.pm index 6c8de8ae5dd..b618cbb9e1c 100644 --- a/lib/OpenQA/WebAPI/Controller/API/V1/Job.pm +++ b/lib/OpenQA/WebAPI/Controller/API/V1/Job.pm @@ -953,7 +953,7 @@ sub _generate_job_setting ($self, $args) { my %params = (input_args => $args, settings => \%settings); # Populated with Product settings if there are DISTRI, VERSION, FLAVOR, ARCH in arguments. - if ( defined $args->{DISTRI} + if (defined $args->{DISTRI} && defined $args->{VERSION} && defined $args->{FLAVOR} && defined $args->{ARCH}) diff --git a/lib/OpenQA/WebAPI/Controller/API/V1/Table.pm b/lib/OpenQA/WebAPI/Controller/API/V1/Table.pm index 46c1bb8784c..bc3e3caffbf 100644 --- a/lib/OpenQA/WebAPI/Controller/API/V1/Table.pm +++ b/lib/OpenQA/WebAPI/Controller/API/V1/Table.pm @@ -248,7 +248,7 @@ sub update { (($table eq 'TestSuites' || $table eq 'Machines') && $rc->name ne $self->param('name')) || ( $table eq 'Products' - && ( $rc->arch ne $self->param('arch') + && ($rc->arch ne $self->param('arch') || $rc->distri ne $self->param('distri') || $rc->flavor ne $self->param('flavor') || $rc->version ne $self->param('version')))) diff --git a/lib/OpenQA/WebAPI/Controller/Test.pm b/lib/OpenQA/WebAPI/Controller/Test.pm index 6e00ec746fb..d67ca995776 100644 --- a/lib/OpenQA/WebAPI/Controller/Test.pm +++ b/lib/OpenQA/WebAPI/Controller/Test.pm @@ -641,7 +641,7 @@ sub _prepare_job_results ($self, $all_jobs, $limit) { my $machines = $self->param_hash('machine'); my @jobs = grep { - (not $states or $states->{$_->state}) + (not $states or $states->{$_->state}) and (not $results or $results->{$_->result}) and (not $archs or $archs->{$_->ARCH}) and (not $machines or $machines->{$_->MACHINE}) @@ -687,7 +687,7 @@ sub _prepare_job_results ($self, $all_jobs, $limit) { # Append machine name to TEST if it does not match the most frequently used MACHINE # for the jobs architecture - if ( $job->MACHINE + if ($job->MACHINE && $preferred_machines->{$job->ARCH} && $preferred_machines->{$job->ARCH} ne $job->MACHINE) { @@ -890,7 +890,7 @@ sub module_fails { sub _add_dependency_to_graph ($dependency_data, $parent_job_id, $child_job_id, $dependency_type) { # add edge for chained dependencies - if ( $dependency_type eq OpenQA::JobDependencies::Constants::CHAINED + if ($dependency_type eq OpenQA::JobDependencies::Constants::CHAINED || $dependency_type eq OpenQA::JobDependencies::Constants::DIRECTLY_CHAINED) { push(@{$dependency_data->{edges}}, {from => $parent_job_id, to => $child_job_id}); diff --git a/lib/OpenQA/WebAPI/Plugin/Helpers.pm b/lib/OpenQA/WebAPI/Plugin/Helpers.pm index 18b7f2c2410..fbac3cd53de 100644 --- a/lib/OpenQA/WebAPI/Plugin/Helpers.pm +++ b/lib/OpenQA/WebAPI/Plugin/Helpers.pm @@ -195,7 +195,7 @@ sub register ($self, $app, $config) { my $data = {toggle => 'popover', trigger => 'focus', title => $title, content => $content}; $data->{placement} = $placement if $placement; return $c->t(a => (tabindex => 0, class => $class, role => 'button', data => $data, @args)); - }); + }); $app->helper( help_popover_todo => sub ($c) { diff --git a/lib/OpenQA/WebAPI/Plugin/ObsRsync.pm b/lib/OpenQA/WebAPI/Plugin/ObsRsync.pm index 6ac8edd5317..831b87ed536 100644 --- a/lib/OpenQA/WebAPI/Plugin/ObsRsync.pm +++ b/lib/OpenQA/WebAPI/Plugin/ObsRsync.pm @@ -102,13 +102,13 @@ sub register { # terminology: # * project - Obs Project name alone, e.g. 'openSUSE:Factory:ToTest' -# * batch - abstraction used by openqa-trigger-from-obs to split actions, needed to be taken when Obs Project is ready for testing, + # * batch - abstraction used by openqa-trigger-from-obs to split actions, needed to be taken when Obs Project is ready for testing, # e.g. 'base, 'jeos', 'migration'. # * alias - Obs Project name alone or with corresponding batch concatenated with '|': 'projectname|batchname' # e.g. 'openSUSE:Factory:ToTest|base', 'openSUSE:Factory:ToTest|microos', 'openSUSE:Factory:ToTest|jeos' - # * subfolder - folder, containing artifacts from paricular synch actions. Most often if form `.run_YYYYMMDDhhmmss`. + # * subfolder - folder, containing artifacts from paricular synch actions. Most often if form `.run_YYYYMMDDhhmmss`. # - # routes which have parameter #alias, can be called for simple project, for batched project or for particular batch + # routes which have parameter #alias, can be called for simple project, for batched project or for particular batch # routes which have parameter #project, can not be called for single batch $plugin_r->get('/obs_rsync/queue')->name('plugin_obs_rsync_queue') ->to('Plugin::ObsRsync::Controller::Gru#index'); diff --git a/lib/OpenQA/WebSockets/Controller/Worker.pm b/lib/OpenQA/WebSockets/Controller/Worker.pm index 044d7457509..351cc969fbb 100644 --- a/lib/OpenQA/WebSockets/Controller/Worker.pm +++ b/lib/OpenQA/WebSockets/Controller/Worker.pm @@ -207,7 +207,7 @@ sub _message { # skip any further actions if worker just does the one job we expected it to do return undef - if ( defined $job_id + if (defined $job_id && defined $current_job_id && defined $job_token && defined $registered_job_token diff --git a/lib/OpenQA/Worker/WebUIConnection.pm b/lib/OpenQA/Worker/WebUIConnection.pm index 137e14728b5..ec9de8e0ec4 100644 --- a/lib/OpenQA/Worker/WebUIConnection.pm +++ b/lib/OpenQA/Worker/WebUIConnection.pm @@ -123,7 +123,7 @@ sub _setup_websocket_connection ($self, $websocket_url = undef) { # prevent messing around when there's still an active websocket connection return undef if $self->websocket_connection; - # make URL for websocket connection unless specified as argument (which would be the case when following redirection) + # make URL for websocket connection unless specified as argument (which would be the case when following redirection) if (!$websocket_url) { my $worker_id = $self->worker_id; my $webui_host = $self->webui_host; diff --git a/t/01-style.t b/t/01-style.t index a50cc6719dd..18a43f4b040 100755 --- a/t/01-style.t +++ b/t/01-style.t @@ -8,7 +8,7 @@ ok system(qq{git grep -I -l 'Copyright \((C)\|(c)\|©\)' ':!COPYING' ':!external 'No redundant copyright character'; ok system( -qq{git grep -I -l 'This program is free software.*if not, see sub { # Give Utils.pm a chance to install $SIG{CHLD} sleep 1; # uncoverable statement OpenQA::Test::Utils::_setup_sub_process 'test-process-1'; # uncoverable statement - '' . undef; # uncoverable statement: provoke Perl warning "Use of uninitialized value in concatenation …" + '' . undef; # uncoverable statement: provoke Perl warning "Use of uninitialized value in concatenation …" }; note "waiting at most $signal_timeout seconds for SIGCHLD (sleep is supposed to be interrupted by SIGCHLD)"; sleep $signal_timeout; diff --git a/t/05-scheduler-capabilities.t b/t/05-scheduler-capabilities.t index 2d74901ac77..968db92eb31 100644 --- a/t/05-scheduler-capabilities.t +++ b/t/05-scheduler-capabilities.t @@ -196,7 +196,7 @@ is($job->{id}, $jobH->id, "next job by prio, parent - server"); $job = $sent->{$w8_id}->{job}->to_hash; is($job->{id}, $jobJ->id, -"I is a scheduled child of running H so it should have the highest prio, but this worker can't do it because of class -> take next job by prio instead" + "I is a scheduled child of running H so it should have the highest prio, but this worker can't do it because of class -> take next job by prio instead" ); $job = $sent->{$w9_id}->{job}->to_hash; diff --git a/t/05-scheduler-dependencies.t b/t/05-scheduler-dependencies.t index 87114dae39b..582f6927c70 100644 --- a/t/05-scheduler-dependencies.t +++ b/t/05-scheduler-dependencies.t @@ -748,17 +748,17 @@ subtest 'duplicate parallel parent in tree with all dependency types' => sub { is_deeply( $jobW2->{parents}, {Chained => [$jobQ2->{id}], Parallel => [], 'Directly chained' => []}, -'jobW2 has clone of jobQ as chained parent (although jobQ has only been cloned because it is a direct parent of jobTA)' + 'jobW2 has clone of jobQ as chained parent (although jobQ has only been cloned because it is a direct parent of jobTA)' ) or diag explain $jobW2->{parents}; is_deeply( $jobU2->to_hash(deps => 1)->{parents}, {Chained => [$jobQ2->{id}], Parallel => [], 'Directly chained' => []}, -'jobU2 has clone of jobQ as chained parent (although jobQ has only been cloned because it is a direct parent of jobTA)' + 'jobU2 has clone of jobQ as chained parent (although jobQ has only been cloned because it is a direct parent of jobTA)' ) or diag explain $jobU2->to_hash(deps => 1)->{parents}; is_deeply( $jobR2->{parents}, {Chained => [$jobQ2->{id}], Parallel => [], 'Directly chained' => []}, -'jobR2 has clone of jobQ as chained parent (although jobQ has only been cloned because it is a direct parent of jobTA)' + 'jobR2 has clone of jobQ as chained parent (although jobQ has only been cloned because it is a direct parent of jobTA)' ) or diag explain $jobR2->{parents}; }; diff --git a/t/05-scheduler-restart-and-duplicate.t b/t/05-scheduler-restart-and-duplicate.t index abf603f7d57..9135d76dd36 100644 --- a/t/05-scheduler-restart-and-duplicate.t +++ b/t/05-scheduler-restart-and-duplicate.t @@ -172,7 +172,7 @@ subtest 'restart with (directly) chained child' => sub { 99938 => {is_parent_or_initial_job => 0, @empty_deps, directly_chained_parents => [99937]}, ); is_deeply(job_get_rs(99937)->cluster_jobs, \%expected_cluster, - '99937 has one directly chained child and one directly chained parent; ' + '99937 has one directly chained child and one directly chained parent; ' . 'parent considered for restarting but not siblings'); $job_before_restart = job_get(99937); diff --git a/t/10-jobs.t b/t/10-jobs.t index d12934b426e..4136bdf4e88 100644 --- a/t/10-jobs.t +++ b/t/10-jobs.t @@ -260,7 +260,7 @@ subtest 'job with all modules passed and at least one ignore_failure failed => o }; subtest -'job with important modules passed and at least one softfailed and at least one ignore_failure failed => overall softfailed' + 'job with important modules passed and at least one softfailed and at least one ignore_failure failed => overall softfailed' => sub { my %_settings = %settings; $_settings{TEST} = 'F'; @@ -282,7 +282,7 @@ subtest }; subtest -'job with one "important" (old flag we now ignore) module failed and at least one ignore_failure passed => overall failed' + 'job with one "important" (old flag we now ignore) module failed and at least one ignore_failure passed => overall failed' => sub { my %_settings = %settings; $_settings{TEST} = 'G'; diff --git a/t/14-grutasks.t b/t/14-grutasks.t index 73358c1e665..06d80251f7d 100644 --- a/t/14-grutasks.t +++ b/t/14-grutasks.t @@ -370,8 +370,8 @@ subtest 'assets associated with pending jobs are preserved' => sub { [$pending_asset_name, $other_asset_name], "asset $pending_asset_name has been deleted with 99947 no longer pending" ) or diag explain $deleted_assets; - # note: The main purpose of this subtest is to cross-check whether this test is actually working. If the asset would - # still not be cleaned up here that would mean the pending state makes no difference for this test and it is + # note: The main purpose of this subtest is to cross-check whether this test is actually working. If the asset would + # still not be cleaned up here that would mean the pending state makes no difference for this test and it is # therefore meaningless. }; }; diff --git a/t/16-markdown.t b/t/16-markdown.t index b7152abdeb7..70c32bcebc7 100644 --- a/t/16-markdown.t +++ b/t/16-markdown.t @@ -70,7 +70,7 @@ subtest 'openQA additions' => sub { qq{

https://example.com/#fragment_-

\n}, 'URL with fragment turned into a link'; is markdown_to_html('https://example.com/#fragment/'), -qq{

https://example.com/#fragment/test

\n}, + qq{

https://example.com/#fragment/test

\n}, 'URL with fragment + script turned into a link'; is markdown_to_html('https://example.com/#?(.-/\' some text'), qq{

https://example.com/#?(.-/' some text

\n}, diff --git a/t/17-labels_carry_over.t b/t/17-labels_carry_over.t index db85cd2e38d..a2dfa4a32c2 100644 --- a/t/17-labels_carry_over.t +++ b/t/17-labels_carry_over.t @@ -66,7 +66,7 @@ subtest '"happy path": failed->failed carries over last issue reference' => sub local $ENV{OPENQA_JOB_DONE_HOOK_FAILED} = 'foo'; my $bugs = $t->app->schema->resultset('Bugs'); - $bugs->search({bugid => 'bsc#1234'})->delete; # ensure the bugref supposed to be inserted does not exist anyways + $bugs->search({bugid => 'bsc#1234'})->delete; # ensure the bugref supposed to be inserted does not exist anyways $t->app->log->level('debug'); $group->update({carry_over_bugrefs => 1}); my $output = combined_from { diff --git a/t/24-worker-engine.t b/t/24-worker-engine.t index 53e23639566..7104a5f822a 100644 --- a/t/24-worker-engine.t +++ b/t/24-worker-engine.t @@ -163,7 +163,7 @@ subtest 'asset caching' => sub { cache_assets => sub ($cache_client, $job, $vars, $assets_to_cache, $assetkeys, $webui_host, $pooldir, $callback) { $callback->(undef); - }); + }); my $job = Test::MockObject->new; my $testpool_server; $job->mock(client => sub { Test::MockObject->new->set_bound(testpool_server => \$testpool_server) }); diff --git a/t/24-worker-jobs.t b/t/24-worker-jobs.t index 86a3b39b2dc..97251663918 100644 --- a/t/24-worker-jobs.t +++ b/t/24-worker-jobs.t @@ -1337,7 +1337,7 @@ subtest 'override job reason when qemu terminated with known issues by parsing a { reason => 'QEMU terminated: Failed to allocate KVM .* Cannot allocate memory', log_file_content => -'[warn] !!! : qemu-system-ppc64: Failed to allocate KVM HPT of order 25 (try smaller maxmem?): Cannot allocate memory.', + '[warn] !!! : qemu-system-ppc64: Failed to allocate KVM HPT of order 25 (try smaller maxmem?): Cannot allocate memory.', base_state_content => '{"component": "backend", "msg": "QEMU exited unexpectedly, see log for details"}' }, { @@ -1348,7 +1348,7 @@ subtest 'override job reason when qemu terminated with known issues by parsing a }, { reason => -'terminated prematurely: Encountered corrupted state file: No space left on device, see log output for details', + 'terminated prematurely: Encountered corrupted state file: No space left on device, see log output for details', log_file_content => '[debug] Unable to serialize fatal error: Can\'t write to file "base_state.json": No space left on device at /usr/lib/os-autoinst/bmwqemu.pm line 86.', base_state_content => 'foo boo', diff --git a/t/24-worker-overall.t b/t/24-worker-overall.t index 587b9f44895..75e593c62b4 100644 --- a/t/24-worker-overall.t +++ b/t/24-worker-overall.t @@ -786,7 +786,7 @@ subtest 'handle job status changes' => sub { combined_like { $worker->_handle_job_status_changed($fake_job, {status => 'stopped', reason => 'done'}); } -qr/Job 42 from some-host finished - reason: done.*A QEMU instance using.*Skipping job 769 from queue because worker is broken/s, + qr/Job 42 from some-host finished - reason: done.*A QEMU instance using.*Skipping job 769 from queue because worker is broken/s, 'status logged'; is( $worker->current_error, diff --git a/t/24-worker-webui-connection.t b/t/24-worker-webui-connection.t index af725b6053a..eead88563ff 100644 --- a/t/24-worker-webui-connection.t +++ b/t/24-worker-webui-connection.t @@ -388,7 +388,7 @@ subtest 'command handler' => sub { combined_like { $command_handler->handle_command(undef, {}) } qr/Ignoring WS message without type from http:\/\/test-host.*/, 'ignoring non-result message without type'; combined_like { $command_handler->handle_command(undef, {type => WORKER_COMMAND_LIVELOG_STOP, jobid => 1}) } -qr/Ignoring WS message from http:\/\/test-host with type livelog_stop and job ID 1 \(currently not executing a job\).*/, + qr/Ignoring WS message from http:\/\/test-host with type livelog_stop and job ID 1 \(currently not executing a job\).*/, 'ignoring job-specific message when no job running'; $worker->current_error('some error'); $app->log->level('debug'); diff --git a/t/27-websockets.t b/t/27-websockets.t index d77efdd0e81..8b98860cc51 100644 --- a/t/27-websockets.t +++ b/t/27-websockets.t @@ -167,7 +167,7 @@ subtest 'web socket message handling' => sub { } qr/Job 42 reset to state scheduled/s, 'info logged when worker rejects job'; is($jobs->find(42)->state, SCHEDULED, - 'job is immediately set back to scheduled if assigned worker goes offline ' + 'job is immediately set back to scheduled if assigned worker goes offline ' . 'gracefully before starting to work on the job'); $worker->discard_changes; ok($worker->dead, 'worker considered immediately dead when it goes offline gracefully'); diff --git a/t/api/02-iso.t b/t/api/02-iso.t index a5b9f7aa111..46602ab75a1 100644 --- a/t/api/02-iso.t +++ b/t/api/02-iso.t @@ -30,7 +30,7 @@ sub lj { return unless $ENV{HARNESS_IS_VERBOSE}; $t->get_ok('/api/v1/jobs')->status_is(200); # uncoverable statement my $jobs = $t->tx->res->json->{jobs}; # uncoverable statement - printf("%d %-10s %s (%s)\n", $_->{id}, $_->{state}, $_->{name}, $_->{priority}) for @$jobs; # uncoverable statement + printf("%d %-10s %s (%s)\n", $_->{id}, $_->{state}, $_->{name}, $_->{priority}) for @$jobs; # uncoverable statement } sub find_job ($jobs, $newids, $name, $machine) { @@ -554,7 +554,7 @@ subtest 'Handling different WORKER_CLASS in directly chained dependency chains' is($res->json->{count}, 0, 'none of the jobs has been scheduled'); like( $_->{error_messages}->[0], -qr/Worker class of chained-(c|d|e) \(bar\) does not match the worker class of its directly chained parent \(foo\)/, + qr/Worker class of chained-(c|d|e) \(bar\) does not match the worker class of its directly chained parent \(foo\)/, 'error reported' ) for @{$res->json->{failed}}; $schema->txn_rollback; diff --git a/t/api/04-jobs.t b/t/api/04-jobs.t index 732116d959d..54ce11198c2 100644 --- a/t/api/04-jobs.t +++ b/t/api/04-jobs.t @@ -773,7 +773,7 @@ subtest 'update job status' => sub { combined_like { $t->post_ok('/api/v1/jobs/99963/status', json => {status => {worker_id => 999999}})->status_is(400) } -qr/Got status update for job 99963 with unexpected worker ID 999999 \(expected no updates anymore, job is done with result incomplete\)/, + qr/Got status update for job 99963 with unexpected worker ID 999999 \(expected no updates anymore, job is done with result incomplete\)/, 'status update for job that is already considered done rejected'; }; diff --git a/t/api/08-jobtemplates.t b/t/api/08-jobtemplates.t index 62b0156b2d6..296f7a8d864 100644 --- a/t/api/08-jobtemplates.t +++ b/t/api/08-jobtemplates.t @@ -861,7 +861,7 @@ subtest 'Create and modify groups with YAML' => sub { )->status_is(400, 'Post rejected because scenarios are ambiguous')->json_is( '' => { error => [ -'Job template name \'textmode\' with opensuse-13.1-DVD-i586 and 64bit is already used in job group \'opensuse\'' + 'Job template name \'textmode\' with opensuse-13.1-DVD-i586 and 64bit is already used in job group \'opensuse\'' ], error_status => 400, id => $job_group_id3, @@ -930,7 +930,7 @@ subtest 'Create and modify groups with YAML' => sub { $t->status_is(400, 'Post rejected because scenarios are ambiguous')->json_is( '' => { error => [ - 'Job template name \'foobar\' is defined more than once. ' + 'Job template name \'foobar\' is defined more than once. ' . 'Use a unique name and specify \'testsuite\' to re-use test suites in multiple scenarios.' ], error_status => 400, diff --git a/t/api/14-plugin_obs_rsync_async.t b/t/api/14-plugin_obs_rsync_async.t index 796e1aac99b..e71d2c089dc 100644 --- a/t/api/14-plugin_obs_rsync_async.t +++ b/t/api/14-plugin_obs_rsync_async.t @@ -48,7 +48,7 @@ sub sleep_until_job_start { (undef, my $jobs) = _jobs($status); for my $other_job (@$jobs) { return 1 - if ( $other_job->{args} + if ($other_job->{args} && ($other_job->{args}[0]->{project} eq $project) && $other_job->{notes}{project_lock}); } diff --git a/t/api/16-webhooks.t b/t/api/16-webhooks.t index fe361a7b233..61f1837844e 100644 --- a/t/api/16-webhooks.t +++ b/t/api/16-webhooks.t @@ -107,7 +107,7 @@ $vcs_mock->redefine( is $params->{description}, $expected_ci_check_desc, 'check description'; ++$status_reports; $callback ? $callback->($ua, $tx) : $tx; - }); + }); subtest 'scheduled product created via webhook' => sub { $t->post_ok($url, \%headers, json => $test_payload)->status_is(200, 'scheduled product has been created'); diff --git a/t/lib/OpenQA/SeleniumTest.pm b/t/lib/OpenQA/SeleniumTest.pm index cad768a5227..c4b66c7344c 100644 --- a/t/lib/OpenQA/SeleniumTest.pm +++ b/t/lib/OpenQA/SeleniumTest.pm @@ -74,7 +74,7 @@ sub start_driver ($mojoport) { # context but bail out to not have repeated entries for the # same problem exceeded console scrollback buffers easily my ($driver, $exception, $args) = @_; # uncoverable statement - my $err = (split /\n/, $exception)[0] =~ s/Error while executing command: //r; # uncoverable statement + my $err = (split /\n/, $exception)[0] =~ s/Error while executing command: //r; # uncoverable statement $err .= ' at ' . __FILE__ . ':' . __LINE__; # uncoverable statement # prevent aborting the complete test when interactively debugging diff --git a/t/ui/07-file.t b/t/ui/07-file.t index 8161e2c7f13..8cb5d670f47 100644 --- a/t/ui/07-file.t +++ b/t/ui/07-file.t @@ -89,7 +89,7 @@ subtest 'needle download' => sub { # getting needle image and json by ID also does not work for needles # in subdirectories, but arguably should do and should be tested: #$t->get_ok('/needles/2/image')->status_is(200)->content_type_is('image/png')->content_is("png\n"); - #$t->get_ok('/needles/2/json')->status_is(200)->content_type_is('application/json;charset=UTF-8')->content_is($json2); + #$t->get_ok('/needles/2/json')->status_is(200)->content_type_is('application/json;charset=UTF-8')->content_is($json2); }; diff --git a/t/ui/12-needle-edit.t b/t/ui/12-needle-edit.t index b690f270853..b25d33db87e 100644 --- a/t/ui/12-needle-edit.t +++ b/t/ui/12-needle-edit.t @@ -521,7 +521,7 @@ subtest 'Showing new needles limited to the 5 most recent ones' => sub { # add expected warnings and needle names for needle if ($i >= 2) { unshift(@expected_needle_warnings, - "A new needle with matching tags has been created since the job started: $new_needle_name.json" + "A new needle with matching tags has been created since the job started: $new_needle_name.json" . ' (tags: ENV-VIDEOMODE-text, inst-timezone, test-newtag, test-overwritetag)'); splice(@expected_needle_names, 2, 0, 'new: ' . $new_needle_name); } @@ -595,7 +595,7 @@ subtest 'open needle editor for running test' => sub { my $t = Test::Mojo->new('OpenQA::WebAPI'); $t->ua->max_redirects(1); warnings { $t->get_ok('/tests/99980/edit') }; - note( 'ignoring warning "DateTime objects passed to search() are not supported properly"' + note('ignoring warning "DateTime objects passed to search() are not supported properly"' . ' at lib/OpenQA/WebAPI/Controller/Step.pm line 211'); $t->status_is(200); $t->text_is(title => 'openQA: Needle Editor', 'needle editor shown for running test'); @@ -614,7 +614,7 @@ subtest 'error handling when opening needle editor for running test' => sub { $t->text_is(title => 'openQA: Needle Editor', 'title still the same'); $t->text_like( '#content p', -qr/The test opensuse-13\.1-DVD-i586-Build0091-textmode\@32bit has no worker assigned so the page \"Needle Editor\" is not available\./, + qr/The test opensuse-13\.1-DVD-i586-Build0091-textmode\@32bit has no worker assigned so the page \"Needle Editor\" is not available\./, 'error message' ); @@ -623,7 +623,7 @@ qr/The test opensuse-13\.1-DVD-i586-Build0091-textmode\@32bit has no worker assi $t->text_is(title => 'openQA: Page not found', 'generic title present'); $t->text_like( '#content p', -qr/The test opensuse-13\.1-DVD-i586-Build0091-textmode\@32bit has no worker assigned so this route is not available\./, + qr/The test opensuse-13\.1-DVD-i586-Build0091-textmode\@32bit has no worker assigned so this route is not available\./, 'error message' ); }; @@ -656,7 +656,7 @@ subtest '(created) needles can be accessed over API' => sub { map { like($_, qr/is not in a subdir of/, 'expected warning') } @warnings; @warnings = warnings { $t->get_ok( -'/needles/opensuse/test-newneedle.png?jsonfile=t/data/openqa/share/tests/opensuse/needles/../../../../try/to/break_out.json' + '/needles/opensuse/test-newneedle.png?jsonfile=t/data/openqa/share/tests/opensuse/needles/../../../../try/to/break_out.json' )->status_is(403, 'access to files outside the test directory not granted (relative)'); }; map { like($_, qr/cannot contain ../, 'expected warning') } @warnings; diff --git a/t/ui/13-admin.t b/t/ui/13-admin.t index 15a4820a561..688bbf83aa5 100644 --- a/t/ui/13-admin.t +++ b/t/ui/13-admin.t @@ -243,7 +243,7 @@ subtest 'add test suite' => sub() { is($driver->find_element_by_xpath('//button[@title="Add"]')->click(), 1, 'added'); # leave the ajax some time wait_for_ajax; -# now read data back and compare to original, name and value shall be the same, key sanitized by removing all special chars + # now read data back and compare to original, name and value shall be the same, key sanitized by removing all special chars $elem = $driver->find_element('.admintable tbody tr:nth-child(7)') ; # sorting by name so `t"e\st'Suite\'` is supposed to be the 7th element is($elem->get_text(), "$suiteName testKey=$suiteValue", 'stored text is the same except key'); diff --git a/t/ui/15-comments.t b/t/ui/15-comments.t index a5407aeeda4..329f9e6b69d 100644 --- a/t/ui/15-comments.t +++ b/t/ui/15-comments.t @@ -75,7 +75,7 @@ sub write_comment ($text, $desc) { wait_for_ajax msg => $desc; }; return undef unless my $error = $@; - die $error if ($error !~ qr/unexpected alert/i) || ($attempts >= $max_write_attempts); # uncoverable statement + die $error if ($error !~ qr/unexpected alert/i) || ($attempts >= $max_write_attempts); # uncoverable statement # try to dismiss the alert "The comment text mustn't be empty." that is for some reason possibly shown # note: Even waiting until document.forms.commentForm.text.value is not empty anymore before submitting diff --git a/t/ui/18-tests-details.t b/t/ui/18-tests-details.t index c83b2f0394f..25288936433 100644 --- a/t/ui/18-tests-details.t +++ b/t/ui/18-tests-details.t @@ -99,7 +99,7 @@ sub find_candidate_needles { is(scalar @needle_parts, 3, 'exactly three parts per needle present (percentage, name, diff buttons)'); push(@needles, - OpenQA::Test::Case::trim_whitespace($needle_parts[0]->get_text()) . '%: ' + OpenQA::Test::Case::trim_whitespace($needle_parts[0]->get_text()) . '%: ' . OpenQA::Test::Case::trim_whitespace($needle_parts[1]->get_text())); } diff --git a/t/ui/25-developer_mode.t b/t/ui/25-developer_mode.t index 5a04ea0f147..b21b66fa4f9 100644 --- a/t/ui/25-developer_mode.t +++ b/t/ui/25-developer_mode.t @@ -140,7 +140,7 @@ mock_js_functions( updateStatus => '', setupWebsocketConnection => '', startDeveloperSession => -'developerMode.ownSession = true; developerMode.useDeveloperWsRoute = true; handleWebsocketConnectionOpened(developerMode.wsConnection);', + 'developerMode.ownSession = true; developerMode.useDeveloperWsRoute = true; handleWebsocketConnectionOpened(developerMode.wsConnection);', sendWsCommand => 'if (!window.sentCmds) { window.sentCmds = [] } window.sentCmds.push(arg1);', ); @@ -672,7 +672,7 @@ subtest 'process state changes from os-autoinst/worker' => sub { my $ignored_connection_error = '{\"type\":\"error\",\"what\":\"ignored error\",\"data\":{\"category\":\"cmdsrv-connection\"}}'; - # assume there's no running module (so connection issues with os-autoinst are expected and errors regarding it ignored) + # assume there's no running module (so connection issues with os-autoinst are expected and errors regarding it ignored) fake_state(testStatus => {running => 'null'}); # let the JavaScript code process those errors