Skip to content

Commit c37fb4e

Browse files
authored
Merge pull request #6596 from perlpunk/single-quotes
perlcritic: Use single quotes in test files
2 parents dfb5af1 + f8d18a4 commit c37fb4e

File tree

93 files changed

+971
-973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+971
-973
lines changed

t/02-pod.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ use Test::Warnings qw(:no_end_test :report_warnings);
33
use Feature::Compat::Try;
44
# no OpenQA::Test::TimeLimit for this trivial test
55

6-
eval 'use Test::Pod; 1' or plan skip_all => "Test::Pod required for testing POD";
6+
eval 'use Test::Pod; 1' or plan skip_all => 'Test::Pod required for testing POD';
77

88
all_pod_files_ok();

t/03-auth-openid.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $mock_openid_consumer->redefine(
4141
'handle_server_response',
4242
sub ($self, %res_handlers) {
4343
return $res_handlers{setup_needed}
44-
? $res_handlers{setup_needed}->("https://www.opensuse.org/openid/setup")
44+
? $res_handlers{setup_needed}->('https://www.opensuse.org/openid/setup')
4545
: undef;
4646
});
4747
$c->set_always(

t/04-scheduler.t

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ my $job_ref = {
164164
# to be removed
165165
test => 'rainbow'
166166
};
167-
my $iso = sprintf("%s/iso/%s", assetdir(), $settings{ISO});
167+
my $iso = sprintf('%s/iso/%s', assetdir(), $settings{ISO});
168168
my $job = $jobs->create_from_settings(\%settings);
169-
is($job->id, 1, "job_create");
169+
is($job->id, 1, 'job_create');
170170

171171
my %settings2 = %settings;
172-
$settings2{NAME} = "OTHER NAME";
173-
$settings2{BUILD} = "44";
172+
$settings2{NAME} = 'OTHER NAME';
173+
$settings2{BUILD} = '44';
174174
my $job2 = $jobs->create_from_settings(\%settings2);
175175
is($job2->id, 2);
176176

@@ -182,7 +182,7 @@ subtest 'calling again with same settings' => sub {
182182

183183
$job->set_prio(40);
184184
my $new_job = job_get_hash($job->id);
185-
is_deeply($new_job, $job_ref, "job_get");
185+
is_deeply($new_job, $job_ref, 'job_get');
186186

187187
subtest 'job listing' => sub {
188188
my $expected_jobs = [
@@ -247,43 +247,43 @@ subtest 'job listing' => sub {
247247
];
248248

249249
$current_jobs = list_jobs();
250-
is_deeply($current_jobs, $expected_jobs, "All list_jobs");
250+
is_deeply($current_jobs, $expected_jobs, 'All list_jobs');
251251

252252
my %args = (state => SCHEDULED);
253253
$current_jobs = list_jobs(%args);
254-
is_deeply($current_jobs, $expected_jobs, "All list_jobs with state scheduled");
254+
is_deeply($current_jobs, $expected_jobs, 'All list_jobs with state scheduled');
255255

256256
%args = (state => RUNNING);
257257
$current_jobs = list_jobs(%args);
258-
is_deeply($current_jobs, [], "All list_jobs with state running");
258+
is_deeply($current_jobs, [], 'All list_jobs with state running');
259259

260-
%args = (build => "666");
260+
%args = (build => '666');
261261
$current_jobs = list_jobs(%args);
262-
is_deeply($current_jobs, [$expected_jobs->[1]], "list_jobs with build");
262+
is_deeply($current_jobs, [$expected_jobs->[1]], 'list_jobs with build');
263263

264-
%args = (iso => "whatever.iso");
264+
%args = (iso => 'whatever.iso');
265265
$current_jobs = list_jobs(%args);
266-
is_deeply($current_jobs, $expected_jobs, "list_jobs with iso");
266+
is_deeply($current_jobs, $expected_jobs, 'list_jobs with iso');
267267

268-
%args = (build => "666", state => SCHEDULED);
268+
%args = (build => '666', state => SCHEDULED);
269269
$current_jobs = list_jobs(%args);
270-
is_deeply($current_jobs, [$expected_jobs->[1]], "list_jobs combining a setting (BUILD) and state");
270+
is_deeply($current_jobs, [$expected_jobs->[1]], 'list_jobs combining a setting (BUILD) and state');
271271

272-
%args = (iso => "whatever.iso", build => "666");
272+
%args = (iso => 'whatever.iso', build => '666');
273273
$current_jobs = list_jobs(%args);
274-
is_deeply($current_jobs, [$expected_jobs->[1]], "list_jobs combining two settings (ISO and BUILD)");
274+
is_deeply($current_jobs, [$expected_jobs->[1]], 'list_jobs combining two settings (ISO and BUILD)');
275275

276-
%args = (build => "whatever.iso", iso => "666");
276+
%args = (build => 'whatever.iso', iso => '666');
277277
$current_jobs = list_jobs(%args);
278-
is_deeply($current_jobs, [], "list_jobs messing two settings up");
278+
is_deeply($current_jobs, [], 'list_jobs messing two settings up');
279279

280280
%args = (ids => [1, 2], state => [SCHEDULED, DONE]);
281281
$current_jobs = list_jobs(%args);
282-
is_deeply($current_jobs, $expected_jobs, "jobs with specified IDs and states (array ref)");
282+
is_deeply($current_jobs, $expected_jobs, 'jobs with specified IDs and states (array ref)');
283283

284-
%args = (ids => "2,3", state => "scheduled,done");
284+
%args = (ids => '2,3', state => 'scheduled,done');
285285
$current_jobs = list_jobs(%args);
286-
is_deeply($current_jobs, [$expected_jobs->[0]], "jobs with specified IDs (comma list)");
286+
is_deeply($current_jobs, [$expected_jobs->[0]], 'jobs with specified IDs (comma list)');
287287
};
288288

289289
# assume the worker has just been seen
@@ -452,7 +452,7 @@ subtest 'worker re-registration' => sub {
452452
$job_ref->{settings}->{JOBTOKEN} = $grabbed->{settings}->{JOBTOKEN};
453453
$job_ref->{settings}->{NAME} = $grabbed->{settings}->{NAME};
454454

455-
is_deeply($grabbed->{settings}, $job_ref->{settings}, "settings correct");
455+
is_deeply($grabbed->{settings}, $job_ref->{settings}, 'settings correct');
456456
$job3_id = $job->id;
457457
$job_id = $grabbed->{id};
458458
};
@@ -467,7 +467,7 @@ subtest 'setting job to done' => sub {
467467
ok(!$job->settings_hash->{JOBTOKEN}, 'job token not present after job done');
468468

469469
$current_jobs = list_jobs(result => PASSED);
470-
is(scalar @{$current_jobs}, 1, "there is one passed job listed");
470+
is(scalar @{$current_jobs}, 1, 'there is one passed job listed');
471471
};
472472

473473
subtest 'set_prio' => sub {

t/05-scheduler-cancel.t

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ embed_server_for_testing(
3333
sub job_get {
3434
my ($id) = @_;
3535

36-
my $job = $schema->resultset("Jobs")->find({id => $id});
36+
my $job = $schema->resultset('Jobs')->find({id => $id});
3737
return $job;
3838
}
3939

@@ -64,12 +64,12 @@ is_deeply(
6464
parallel_parents => [99961],
6565
},
6666
},
67-
"99963 is part of a duett"
67+
'99963 is part of a duett'
6868
);
6969
my $new_job = $job->auto_duplicate;
70-
ok($new_job, "got new job id " . $new_job->id);
70+
ok($new_job, 'got new job id ' . $new_job->id);
7171

72-
is($new_job->state, 'scheduled', "new job is scheduled");
72+
is($new_job->state, 'scheduled', 'new job is scheduled');
7373
is_deeply(
7474
$new_job->cluster_jobs,
7575
{
@@ -96,12 +96,12 @@ is_deeply(
9696
parallel_parents => [99982],
9797
},
9898
},
99-
"new job is part of a new duett"
99+
'new job is part of a new duett'
100100
);
101101

102102
$job = job_get(99963);
103-
is($job->state, 'running', "old job is running");
104-
is($job->t_finished, undef, "There is a no finish time yet");
103+
is($job->state, 'running', 'old job is running');
104+
is($job->t_finished, undef, 'There is a no finish time yet');
105105

106106
sub lj {
107107
# check the call succeeds every time, only output if verbose
@@ -131,57 +131,57 @@ is $job->reason, 'cancelled by scheduled product 42', 'jobs cancellation reason
131131
lj;
132132

133133
$job = $new_job->discard_changes;
134-
is($job->state, 'cancelled', "new job is cancelled");
135-
ok($job->t_finished, "There is a finish time");
134+
is($job->state, 'cancelled', 'new job is cancelled');
135+
ok($job->t_finished, 'There is a finish time');
136136

137137
$job = job_get(99963);
138-
is($job->state, 'cancelled', "old job cancelled as well");
138+
is($job->state, 'cancelled', 'old job cancelled as well');
139139

140140
$job = job_get(99982);
141-
is($job->state, 'cancelled', "new job 99982 cancelled");
141+
is($job->state, 'cancelled', 'new job 99982 cancelled');
142142

143143
$job = job_get(99983);
144-
is($job->state, 'cancelled', "new job 99983 cancelled");
144+
is($job->state, 'cancelled', 'new job 99983 cancelled');
145145

146146
$job = job_get(99928);
147-
is($job->state, 'scheduled', "unrelated job 99928 still scheduled");
147+
is($job->state, 'scheduled', 'unrelated job 99928 still scheduled');
148148
$job = job_get(99927);
149-
is($job->state, 'scheduled', "unrelated job 99927 still scheduled");
149+
is($job->state, 'scheduled', 'unrelated job 99927 still scheduled');
150150

151151
$job = job_get(99928);
152152
$ret = $job->cancel(USER_CANCELLED);
153-
is($ret, 1, "one job cancelled by id");
153+
is($ret, 1, 'one job cancelled by id');
154154

155155
$job = job_get(99928);
156-
is($job->state, 'cancelled', "job 99928 cancelled");
156+
is($job->state, 'cancelled', 'job 99928 cancelled');
157157
$job = job_get(99927);
158-
is($job->state, 'scheduled', "unrelated job 99927 still scheduled");
158+
is($job->state, 'scheduled', 'unrelated job 99927 still scheduled');
159159

160160

161161
$new_job = job_get(99981)->auto_duplicate;
162-
ok($new_job, "duplicate new job for iso test");
162+
ok($new_job, 'duplicate new job for iso test');
163163

164164
$job = $new_job;
165-
is($job->state, 'scheduled', "new job is scheduled");
165+
is($job->state, 'scheduled', 'new job is scheduled');
166166

167167
lj;
168168

169169
$form = {ISO => 'openSUSE-13.1-GNOME-Live-i686-Build0091-Media.iso'};
170170
$ret = $schema->resultset('Jobs')->cancel_by_settings($form);
171-
is($ret, 1, "one job cancelled by iso");
171+
is($ret, 1, 'one job cancelled by iso');
172172
is_deeply(OpenQA::Test::Case::find_most_recent_event($schema, 'job_cancel_by_settings'),
173173
$form, 'Cancellation was logged with settings');
174174

175175
$job = job_get(99927);
176-
is($job->state, 'scheduled', "unrelated job 99927 still scheduled");
176+
is($job->state, 'scheduled', 'unrelated job 99927 still scheduled');
177177

178178
my %settings = (
179179
DISTRI => 'Unicorn',
180180
FLAVOR => 'pink',
181181
VERSION => '42',
182182
BUILD => '666',
183183
ISO => 'whatever.iso',
184-
MACHINE => "RainbowPC",
184+
MACHINE => 'RainbowPC',
185185
ARCH => 'x86_64',
186186
);
187187

t/05-scheduler-capabilities.t

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ my %settings = (
5959
DESKTOP => 'DESKTOP',
6060
KVM => 'KVM',
6161
ISO_MAXSIZE => 1,
62-
MACHINE => "RainbowPC",
62+
MACHINE => 'RainbowPC',
6363
ARCH => 'x86_64'
6464
);
6565

@@ -159,15 +159,15 @@ $jobI->set_prio(10);
159159
$jobJ->set_prio(9);
160160

161161
my $c = OpenQA::WebAPI::Controller::API::V1::Worker->new;
162-
my $w1_id = $c->_register($schema, "host", "1", \%workercaps64_client);
163-
my $w2_id = $c->_register($schema, "host", "2", \%workercaps64_server);
164-
my $w3_id = $c->_register($schema, "host", "3", \%workercaps32);
165-
my $w4_id = $c->_register($schema, "host", "4", \%workercaps64);
166-
my $w5_id = $c->_register($schema, "host", "5", \%workercaps64_client);
167-
my $w6_id = $c->_register($schema, "host", "6", \%workercaps64);
168-
my $w7_id = $c->_register($schema, "host", "7", \%workercaps64_server);
169-
my $w8_id = $c->_register($schema, "host", "8", \%workercaps64);
170-
my $w9_id = $c->_register($schema, "host", "9", \%workercaps64_client);
162+
my $w1_id = $c->_register($schema, 'host', '1', \%workercaps64_client);
163+
my $w2_id = $c->_register($schema, 'host', '2', \%workercaps64_server);
164+
my $w3_id = $c->_register($schema, 'host', '3', \%workercaps32);
165+
my $w4_id = $c->_register($schema, 'host', '4', \%workercaps64);
166+
my $w5_id = $c->_register($schema, 'host', '5', \%workercaps64_client);
167+
my $w6_id = $c->_register($schema, 'host', '6', \%workercaps64);
168+
my $w7_id = $c->_register($schema, 'host', '7', \%workercaps64_server);
169+
my $w8_id = $c->_register($schema, 'host', '8', \%workercaps64);
170+
my $w9_id = $c->_register($schema, 'host', '9', \%workercaps64_client);
171171

172172
schedule() for ($jobA, $jobB, $jobE, $jobF, $jobD, $jobC, $jobH, $jobJ, $jobI);
173173
ok exists $sent->{job}->{$_}, "$_ exists"
@@ -180,27 +180,27 @@ $job = $sent->{$w2_id}->{job}->to_hash;
180180
is($job->{id}, $jobB->id, "'server' job for 'server' worker");
181181

182182
$job = $sent->{$w3_id}->{job}->to_hash;
183-
is($job->{id}, $jobE->id, "32bit worker gets 32bit job with highest prio");
183+
is($job->{id}, $jobE->id, '32bit worker gets 32bit job with highest prio');
184184

185185
$job = $sent->{$w4_id}->{job}->to_hash;
186-
is($job->{id}, $jobF->id, "next job by prio");
186+
is($job->{id}, $jobF->id, 'next job by prio');
187187

188188
$job = $sent->{$w5_id}->{job}->to_hash;
189189
is($job->{id}, $jobD->id, "next job by prio, 'client' worker can do jobs without class");
190190

191191
$job = $sent->{$w6_id}->{job}->to_hash;
192-
is($job->{id}, $jobC->id, "next job by prio, 64bit worker can get 32bit job");
192+
is($job->{id}, $jobC->id, 'next job by prio, 64bit worker can get 32bit job');
193193

194194
$job = $sent->{$w7_id}->{job}->to_hash;
195-
is($job->{id}, $jobH->id, "next job by prio, parent - server");
195+
is($job->{id}, $jobH->id, 'next job by prio, parent - server');
196196

197197
$job = $sent->{$w8_id}->{job}->to_hash;
198198
is($job->{id}, $jobJ->id,
199199
"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"
200200
);
201201

202202
$job = $sent->{$w9_id}->{job}->to_hash;
203-
is($job->{id}, $jobI->id, "this worker can do jobI, child - client");
203+
is($job->{id}, $jobI->id, 'this worker can do jobI, child - client');
204204

205205
# job G is not grabbed because there is no worker with class 'special'
206206

t/05-scheduler-dependencies.t

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -453,19 +453,19 @@ subtest 'clone and schedule parallel cluster' => sub {
453453
# now free two of them and create one more worker. So that we
454454
# have 6 free, but have vlan 1 still busy
455455
$_->done(result => PASSED) for ($jobC, $jobF);
456-
$c->_register($schema, 'host', "10", \%workercaps);
456+
$c->_register($schema, 'host', '10', \%workercaps);
457457
_schedule();
458458

459459
ok(exists $sent->{job}->{$jobA2}, " $jobA2 was assigned") or die "A2 $jobA2 wasn't scheduled";
460460
$job = $sent->{job}->{$jobA2}->{jobhash};
461-
is($job->{id}, $jobA2, "jobA2"); # lowest prio of jobs without parents
462-
is($job->{settings}->{NICVLAN}, 2, "different vlan") or die explain $job;
461+
is($job->{id}, $jobA2, 'jobA2'); # lowest prio of jobs without parents
462+
is($job->{settings}->{NICVLAN}, 2, 'different vlan') or die explain $job;
463463

464464
ok(exists $sent->{job}->{$jobB2}, " $jobB2 was assigned") or die "B2 $jobB2 wasn't scheduled";
465465
$job = $sent->{job}->{$jobB2}->{job}->to_hash;
466-
is($job->{id}, $jobB2, "jobB2"); # lowest prio of jobs without parents
466+
is($job->{id}, $jobB2, 'jobB2'); # lowest prio of jobs without parents
467467

468-
is($job->{settings}->{NICVLAN}, 2, "different vlan") or die explain $job;
468+
is($job->{settings}->{NICVLAN}, 2, 'different vlan') or die explain $job;
469469

470470
$jobB->done(result => PASSED);
471471
$jobs->find($_)->done(result => PASSED) for ($jobA2, $jobB2, $jobC2, $jobD2, $jobE2, $jobF2);
@@ -506,12 +506,12 @@ subtest 'simple chained dependency cloning' => sub {
506506
is($jobY->state, CANCELLED, 'jobY was cancelled');
507507
is($jobY->result, SKIPPED, 'jobY was skipped');
508508
my $jobY2 = $jobY->clone;
509-
ok(defined $jobY2, "jobY was cloned too");
510-
is($jobY2->blocked_by_id, $jobX2->id, "JobY2 is blocked");
509+
ok(defined $jobY2, 'jobY was cloned too');
510+
is($jobY2->blocked_by_id, $jobX2->id, 'JobY2 is blocked');
511511
is_deeply(
512512
$jobY2->to_hash(deps => 1)->{parents},
513513
{Chained => [$jobX2->id], Parallel => [], 'Directly chained' => []},
514-
"JobY parents fit"
514+
'JobY parents fit'
515515
);
516516
is($jobX2->id, $jobY2->parents->single->parent_job_id, 'jobY2 parent is now jobX clone');
517517
is($jobX2->clone, undef, 'no clone');
@@ -712,7 +712,7 @@ subtest 'duplicate parallel parent in tree with all dependency types' => sub {
712712
or always_explain \@sorted_got;
713713

714714
# check chained parents
715-
@sorted_got = sort(@{$jobTA2->{parents}->{'Chained'}});
715+
@sorted_got = sort(@{$jobTA2->{parents}->{Chained}});
716716
@sorted_exp = sort(());
717717
is_deeply(\@sorted_got, \@sorted_exp, 'jobTA2 not regularly chained after jobQ') or always_explain \@sorted_got;
718718

@@ -883,7 +883,7 @@ subtest 'clone chained child with siblings; then clone chained parent' =>
883883

884884
# clone A
885885
$jobA->discard_changes;
886-
ok(!$jobA->clone, "jobA not yet cloned");
886+
ok(!$jobA->clone, 'jobA not yet cloned');
887887
my $jobA2 = $jobA->auto_duplicate;
888888
ok($jobA2, 'jobA duplicated');
889889
$jobA->discard_changes;
@@ -954,7 +954,7 @@ subtest 'clone chained parent while children are running' => sub {
954954
$jobA2->state(RUNNING);
955955
$jobA2->update;
956956
my $jobA3 = $jobA2->auto_duplicate;
957-
ok($jobA3, "cloned A2");
957+
ok($jobA3, 'cloned A2');
958958
$_->discard_changes for ($jobA, $jobB, $jobC, $jobD);
959959

960960
# check all children were cloned anymore and has $jobA3 as parent

0 commit comments

Comments
 (0)