Skip to content

Commit

Permalink
Merge pull request #1881 from metacpan/oalders/faster-travis
Browse files Browse the repository at this point in the history
Speed up Travis build
  • Loading branch information
mickeyn committed May 13, 2017
2 parents 6cb3e64 + 7034eda commit 85ad690
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 123 deletions.
13 changes: 4 additions & 9 deletions .travis.yml
Expand Up @@ -5,9 +5,7 @@ perl:
matrix:
allow_failures:
- perl: "5.22"
exclude:
- perl: "5.22"
env: USE_CPANFILE_SNAPSHOT=true
env: USE_CPANFILE_SNAPSHOT=false

env:
global:
Expand All @@ -23,22 +21,19 @@ before_install:
# Pre-install from backpan to avoid upgrade breakage.
- cpanm -n http://cpan.metacpan.org/authors/id/M/ML/MLEHMANN/common-sense-3.6.tar.gz
- cpanm -n Devel::Cover::Report::Coveralls
- cpanm -n Carton
- cpanm -n App::cpm Carton

install:
# Carton::Builder (carton install) passes --notest to cpanm.
- 'carton install `test "${TRAVIS_PERL_VERSION}" = "${DEPLOYMENT_PERL_VERSION}" && test "${USE_CPANFILE_SNAPSHOT}" = "true" && echo " --deployment"`'

- 'cpm install `test "${USE_CPANFILE_SNAPSHOT}" = "false" && echo " --resolver metadb" || echo " --resolver snapshot"`'

script:
# Devel::Cover isn't in the cpanfile
# but if it's installed into the global dirs this should work.
- HARNESS_PERL_SWITCHES=-MDevel::Cover=+ignore,local carton exec prove -lrv t
- HARNESS_PERL_SWITCHES=-MDevel::Cover=+ignore,local carton exec prove -lr -j 2 t

after_success:
- cover -report coveralls


notifications:
email:
recipients:
Expand Down
2 changes: 1 addition & 1 deletion cpanfile
Expand Up @@ -100,6 +100,7 @@ requires 'XML::Feed';
requires 'XML::Simple';

test_requires 'App::Prove';
test_requires 'Code::TidyAll', '>= 0.47';
test_requires 'Path::Iterator::Rule', '1.008';
test_requires 'Perl::Tidy';
test_requires 'Test::Code::TidyAll';
Expand All @@ -109,4 +110,3 @@ test_requires 'Perl::Critic', '1.124';
test_requires 'Test::Perl::Critic';
test_requires 'Test::XPath', '0.15';

author_requires 'Code::TidyAll', '>= 0.47';
4 changes: 2 additions & 2 deletions lib/MetaCPAN/Web/Model/API/Contributors.pm
Expand Up @@ -27,8 +27,8 @@ sub get {
my ( $self, $author, $release ) = @_;
my $cv = $self->cv;

$self->request( '/release/contributors/' . $author . '/' . $release,
)->cb(
$self->request( '/release/contributors/' . $author . '/' . $release, )
->cb(
sub {
my ($contributors) = shift->recv;
$cv->send( $contributors->{contributors} );
Expand Down
111 changes: 0 additions & 111 deletions t/model/release-info.t
Expand Up @@ -13,117 +13,6 @@ sub release_info {
$model->new( c => $ctx, @_ );
}

sub groom_contributors {
my ( $meta, $author ) = @_;

# Author is used to de-dupe, but not actually added to contributors.
$author ||= {
pauseid => 'LOCAL',
name => 'A CPAN Author',
gravatar_url => '/gravatar/LOCAL',
email => ['local@example.com'],
};
release_info(

# release object
release => {
author => $author->{pauseid},
metadata => $meta,
},
author => $author,
)->groom_contributors;
}

subtest contributors => sub {
my $uri_prefix = 'http://localhost';
my $xy_string = 'X <y@cpan.org>';
my $xy_parsed = {
name => 'X',
email => [ 'y@cpan.org', ],
pauseid => 'Y',
url => "$uri_prefix/author/Y",
};

is_deeply(
groom_contributors(
{
x_contributors => [ 'Just A Name', 'A <b@c.d>', $xy_string, ],
}
),
[
{
name => 'Just A Name',
email => [],
},
{
name => 'A',
email => ['b@c.d'],
},
$xy_parsed,
],
'parse array of contributor strings'
);

is_deeply(
groom_contributors(
{
x_contributors => $xy_string,
}
),
[ $xy_parsed, ],
'groom single contributor string (not array)'
);

is_deeply(
groom_contributors(
{
x_contributors => [
$xy_string,
'person <local@cpan.org>', # releaser pauseid
'person <local@example.com>', # releaser email
'A CPAN Author <local@example.org>', # releaser name
'A. Nother <another@example.com>',
'Hello <again@example.com>',
],
author => [ 'Hello <there@example.com>', ],
}
),
[
{
email => [ 'there@example.com', 'again@example.com' ],
name => 'Hello',
},
$xy_parsed,
{
email => ['another@example.com'],
name => 'A. Nother',
}
],
'releaser removed from contributors by name and email'
);

is_deeply(
groom_contributors(
{
x_contributors => $xy_string,
author => 'unknown',
}
),
[ $xy_parsed, ],
'unknown author left out'
);

is_deeply(
groom_contributors(
{
x_contributors => { 'A <b@c.d>', 'X <y@cpan.org>', }
}
),
[],
'groom_contributors returns none but does not die with hashref'
);
};

my $rt_prefix = $model->rt_url_prefix;

sub bugtracker {
Expand Down

0 comments on commit 85ad690

Please sign in to comment.