Skip to content

Commit

Permalink
Remove redundant concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
josegomezr committed Oct 25, 2023
1 parent c3d8fe8 commit 8811a7a
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/OpenQA/CacheService/Model/Cache.pm
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ sub track_asset ($self, $asset) {
eval {
my $db = $self->sqlite->db;
my $tx = $db->begin('exclusive');
my $sql = "INSERT INTO assets (filename, size, last_use) VALUES (?, 0, strftime('%s','now'))" . "ON CONFLICT (filename) DO UPDATE SET pending=1";
my $sql = "INSERT INTO assets (filename, size, last_use) VALUES (?, 0, strftime('%s','now')) ON CONFLICT (filename) DO UPDATE SET pending=1";
$db->query($sql, $asset);
$tx->commit;
};
Expand Down
2 changes: 1 addition & 1 deletion lib/OpenQA/Schema/ResultSet/Assets.pm
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ sub status {

# check whether the data from the 2nd select is inconsistent with what we've got from the 1st
# (pure pre-caution, shouldn't happen due to the transaction)
die "$asset_info->{name} was scheduled during cleanup" . " (max job initially $init_max_job, now $res_max_job)"
die "$asset_info->{name} was scheduled during cleanup (max job initially $init_max_job, now $res_max_job)"
if $fail_on_inconsistent_status && $res_max_job && ($res_max_job > $init_max_job);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/OpenQA/Task/Asset/Limit.pm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,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 " . "($age_in_days days) exceeds limit ($limit_in_days days)");
_remove_if($schema, $asset, "Removing asset $asset_name (not in any group, age ($age_in_days days) exceeds limit ($limit_in_days days)");
}
else {
my $limit = $age->add(days => $limit_in_days);
Expand Down
2 changes: 1 addition & 1 deletion lib/OpenQA/Task/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sub finish_job_if_disk_usage_below_percentage (%args) {

my $free_percentage = $available_bytes / $total_bytes * 100;
return undef if $free_percentage <= $percentage;
$job->finish("Skipping, free disk space on '$dir' exceeds configured percentage $percentage %" . " (free percentage: $free_percentage %)");
$job->finish("Skipping, free disk space on '$dir' exceeds configured percentage $percentage % (free percentage: $free_percentage %)");
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/OpenQA/WebAPI/Controller/API/V1/Job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ sub update_status ($self) {
}
else {
my $job_status = $job->status_info;
my $err = "Got status update for job $job_id and worker $worker_id but there is" . " not even a worker assigned to this job (job is $job_status)";
my $err = "Got status update for job $job_id and worker $worker_id but there is not even a worker assigned to this job (job is $job_status)";

Check warning on line 532 in lib/OpenQA/WebAPI/Controller/API/V1/Job.pm

View check run for this annotation

Codecov / codecov/patch

lib/OpenQA/WebAPI/Controller/API/V1/Job.pm#L532

Added line #L532 was not covered by tests
log_info($err);
return $self->render(json => {error => $err}, status => 400);
}
Expand All @@ -538,7 +538,7 @@ sub update_status ($self) {
if (!$worker || $worker->id != $worker_id) {
my $expected_worker_id = $worker ? $worker->id : 'no updates anymore';
my $job_status = $job->status_info;
my $err = "Got status update for job $job_id with unexpected worker ID $worker_id" . " (expected $expected_worker_id, job is $job_status)";
my $err = "Got status update for job $job_id with unexpected worker ID $worker_id (expected $expected_worker_id, job is $job_status)";
log_info($err);
return $self->render(json => {error => $err}, status => 400);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/OpenQA/WebSockets/Controller/Worker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ sub _message {
# (the status "working" is special because it will be sent immediately after a worker started a new job)
my ($last_seen, $now) = ($worker_status->{last_seen}, time);
if ($last_seen && ($last_seen + MIN_TIMER) > $now) {
log_info("Received worker $worker_id status too close to the last update," . " websocket server possibly overloaded or worker misconfigured")
log_info("Received worker $worker_id status too close to the last update, websocket server possibly overloaded or worker misconfigured")
if $current_worker_status ne 'working';
}
$worker_status->{last_seen} = $now;
Expand Down
2 changes: 1 addition & 1 deletion lib/OpenQA/Worker/CommandHandler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sub handle_command {
else {
# ignore messages which belong to a job
if (defined $job_id) {
log_warning("Ignoring WS message from $webui_host with type $type and job ID $job_id " . "(currently not executing a job):\n" . pp($json));
log_warning("Ignoring WS message from $webui_host with type $type and job ID $job_id (currently not executing a job):\n" . pp($json));
return undef;
}
}
Expand Down
2 changes: 1 addition & 1 deletion t/16-markdown.t
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ subtest 'bugrefs to markdown' => sub {
'[gfs#flatpak/fedora-flatpaks#26](https://gitlab.com/fedora/sigs/flatpak/fedora-flatpaks/issues/26)',
'right markdown';
is bugref_to_markdown("boo#9876\n\ntest boo#211\n"),
"[boo#9876](https://bugzilla.opensuse.org/show_bug.cgi?id=9876)\n\n" . "test [boo#211](https://bugzilla.opensuse.org/show_bug.cgi?id=211)\n",
"[boo#9876](https://bugzilla.opensuse.org/show_bug.cgi?id=9876)\n\ntest [boo#211](https://bugzilla.opensuse.org/show_bug.cgi?id=211)\n",
'right markdown';
is bugref_to_markdown('label:force_result:passed:bsc#1234'), 'label:force_result:passed:bsc#1234', 'right markdown';
};
Expand Down
2 changes: 1 addition & 1 deletion t/api/02-iso.t
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ subtest 'Handling different WORKER_CLASS in directly chained dependency chains'

for my $machine_separator (qw(@ :)) {
$schema->txn_begin;
subtest "Create dependency for jobs on different machines" . " - dependency setting are correct (using machine separator '$machine_separator')" => sub {
subtest "Create dependency for jobs on different machines - dependency setting are correct (using machine separator '$machine_separator')" => sub {
$t->post_ok('/api/v1/machines', form => {name => '64bit-ipmi', backend => 'ipmi', 'settings[TEST]' => 'ipmi'})->status_is(200);
add_opensuse_test('supportserver1');
add_opensuse_test('supportserver2', MACHINE => ['64bit-ipmi']);
Expand Down
2 changes: 1 addition & 1 deletion t/api/15-search.t
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ subtest 'Job modules' => sub {
$t->json_is(
'/data/0' => {
occurrence => 'lorem',
contents => "tests/lorem/ipsum.pm\n" . "tests/lorem/ipsum_dolor.py"
contents => "tests/lorem/ipsum.pm\ntests/lorem/ipsum_dolor.py"
},
'job module found'
);
Expand Down

0 comments on commit 8811a7a

Please sign in to comment.