Skip to content

Commit

Permalink
Gcloud Verify Upload
Browse files Browse the repository at this point in the history
basic use test
  • Loading branch information
ebelter committed Jun 4, 2018
1 parent 16c68a7 commit d06109e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Tenx/Gcloud/Command.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ use warnings 'FATAL';

class Tenx::Gcloud::Command {
is => 'Command::Tree',
);
};

1;
10 changes: 5 additions & 5 deletions lib/Tenx/Gcloud/Command/VerifyUpload.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings 'FATAL';

use File::Find 'find';
use File::Spec;
use IO::File
use IO::File;

class Tenx::Gcloudy::Command::VerifyUpload {
is => 'Command::V2',
Expand Down Expand Up @@ -34,18 +34,18 @@ sub execute {

my $adir = File::Spec->join('', 'mnt', 'disks', 'linked-reads-pilot', 'assembly', $assembly_id);
my $local = $self->_build_local($adir);
$self->fatal_message( "No local paths found") if not %$local;
$self->fatal_message("No local paths found") if not %$local;
my $rdir = File::Spec->join('mgi-rg-linked-reads-ccdg-pilot', 'assembly', $rassembly_id);
my $remote = $self->_build_remote($rdir);
$self->fatal_message( "No remote paths found)" if not %$remote;
$self->fatal_message("No remote paths found") if not %$remote;

my @missing;
for my $lpath ( keys %$local ) {
push @missing, $lpath if not exists $remote->{$lpath};
}

if ( @missing ) {
$self->fatal_message( "ERROR Found @missing files!";
$self->fatal_message( "ERROR Found @missing files!");
}
else {
$self->status_message("All local files found on remote!");
Expand All @@ -54,7 +54,7 @@ sub execute {

sub _build_local {
my ($self, $dir) = @_;
$self->fatal_message( "No directory given." if not $dir;
$self->fatal_message( "No directory given.") if not $dir;
print STDERR "Find local paths for $dir\n";

my (%local);
Expand Down
10 changes: 10 additions & 0 deletions t/Tenx-Gcloud-Command-VerifyUpload.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env perl

use strict;
use warnings;

use TenxTestEnv;
use Test::More tests => 1;

use_ok('Tenx::Gcloud::Command::VerifyUpload') or die;
done_testing();

0 comments on commit d06109e

Please sign in to comment.