Merge pull request #1003 from DeterminateSystems/perlcritic-level-4

perlcritic: level 4
This commit is contained in:
Eelco Dolstra
2021-09-27 20:23:55 +02:00
committed by GitHub
98 changed files with 163 additions and 60 deletions

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init(hydra_config => q|

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init(

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init(hydra_config => q|

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use Data::Dumper;
my %ctx = test_init();

View File

@ -1,5 +1,6 @@
use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
use IO::Uncompress::Bunzip2 qw(bunzip2);
use Archive::Tar;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use Data::Dumper;
my %ctx = test_init();

View File

@ -1,5 +1,6 @@
use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
use JSON qw(decode_json encode_json);

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use Data::Dumper;
my %ctx = test_init();

View File

@ -1,5 +1,6 @@
use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
use JSON qw(decode_json encode_json);

View File

@ -1,5 +1,6 @@
use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
use JSON qw(decode_json encode_json);

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Hydra::Event;
use Test2::V0;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use Data::Dumper;
use Test2::V0;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use JSON;
use File::Copy;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,5 +1,6 @@
use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use TestScmInput;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use TestScmInput;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use TestScmInput;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use TestScmInput;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use TestScmInput;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use TestScmInput;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use TestScmInput;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use TestScmInput;

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use Setup;
use TestScmInput;

View File

@ -1,6 +1,7 @@
package Setup;
use strict;
use warnings;
use Exporter;
use Test::PostgreSQL;
use File::Temp;
@ -49,7 +50,7 @@ sub test_init {
$ENV{'NIX_CONF_DIR'} = "$dir/nix/etc/nix";
make_path($ENV{'NIX_CONF_DIR'});
my $nixconf = "$ENV{'NIX_CONF_DIR'}/nix.conf";
my $nix_config = "sandbox = false\n" . $opts{'nix_config'};
my $nix_config = "sandbox = false\n" . ($opts{'nix_config'} || "");
write_file($nixconf, $nix_config);
$ENV{'HYDRA_CONFIG'} = "$dir/hydra.conf";

View File

@ -1,5 +1,6 @@
use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
my %ctx = test_init(

View File

@ -1,4 +1,5 @@
use strict;
use warnings;
use File::Basename;
use Hydra::Model::DB;
use Hydra::Helper::Nix;
@ -38,12 +39,12 @@ ok(-e "/tmp/s3/hydra/$successful_hash.nar", "The nar of a build that's a root is
ok(-e "/tmp/s3/hydra/$successful_hash.narinfo", "The narinfo of a build that's a root is not removed by gc");
my $gcRootsDir = getGCRootsDir;
opendir DIR, $gcRootsDir or die;
while(readdir DIR) {
next if $_ eq "." or $_ eq "..";
unlink "$gcRootsDir/$_";
opendir my $dir, $gcRootsDir or die;
while(my $file = readdir $dir) {
next if $file eq "." or $file eq "..";
unlink "$gcRootsDir/$file";
}
closedir DIR;
closedir $dir;
system("hydra-s3-backup-collect-garbage");
ok(not -e "/tmp/s3/hydra/$successful_hash.nar", "The nar of a build that's not a root is removed by gc");
ok(not -e "/tmp/s3/hydra/$successful_hash.narinfo", "The narinfo of a build that's not a root is removed by gc");

View File

@ -1,5 +1,6 @@
use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,5 +1,6 @@
use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,5 +1,6 @@
use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
my %ctx = test_init();

View File

@ -1,3 +1,5 @@
use strict;
use warnings;
use LWP::UserAgent;
use JSON;