Skip to content

Commit

Permalink
Added mirrors data indexing to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed Jul 10, 2017
1 parent 98061f2 commit 277d644
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions t/00_setup.t
Expand Up @@ -62,6 +62,7 @@ my $cpan = CPAN::Faker->new(

ok( $cpan->make_cpan, 'make fake cpan' );
$fakecpan_dir->subdir('authors')->mkpath;
$fakecpan_dir->subdir('indices')->mkpath;

# make some changes to 06perms.txt
{
Expand Down Expand Up @@ -92,6 +93,9 @@ copy( $src_dir->file('author-1.0.json'),

copy( $src_dir->file('bugs.tsv'), $fakecpan_dir->file('bugs.tsv') );

copy( $src_dir->file('mirrors.json'),
$fakecpan_dir->file(qw(indices mirrors.json)) );

$server->index_permissions;
$server->index_packages;
$server->index_releases;
Expand All @@ -100,6 +104,7 @@ $server->set_first;
$server->index_authors;
$server->prepare_user_test_data;
$server->index_cpantesters;
$server->index_mirrors;

ok(
MetaCPAN::Script::Tickets->new_with_options(
Expand Down
11 changes: 10 additions & 1 deletion t/lib/MetaCPAN/TestServer.pm
Expand Up @@ -8,6 +8,7 @@ use MetaCPAN::Script::CPANTesters ();
use MetaCPAN::Script::First ();
use MetaCPAN::Script::Latest ();
use MetaCPAN::Script::Mapping ();
use MetaCPAN::Script::Mirrors ();
use MetaCPAN::Script::Package ();
use MetaCPAN::Script::Permission ();
use MetaCPAN::Script::Release ();
Expand Down Expand Up @@ -212,10 +213,18 @@ sub index_cpantesters {
ok(
MetaCPAN::Script::CPANTesters->new_with_options( $self->_config )
->run,
'index authors'
'index cpantesters'
);
}

sub index_mirrors {
my $self = shift;

local @ARGV = ('mirrors');
ok( MetaCPAN::Script::Mirrors->new_with_options( $self->_config )->run,
'index mirrors' );
}

sub index_permissions {
my $self = shift;

Expand Down

0 comments on commit 277d644

Please sign in to comment.