Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .tidyallrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ argv = --indent-size 4 --end_with_newline

[Test::Vars]
select = {lib,t}/**/*.pm
ignore = lib/MetaCPAN/Web/View/HTML.pm
18 changes: 10 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@ perl:
matrix:
fast_finish: true
allow_failures:
- env: COVERAGE=1 USE_CPANFILE_SNAPSHOT=true
- env: USE_CPANFILE_SNAPSHOT=false HARNESS_VERBOSE=1
- env: USE_CPANFILE_SNAPSHOT=false CPAN_RESOLVER=metadb PERL_CARTON_PATH=$TRAVIS_BUILD_DIR/no-snapshot HARNESS_VERBOSE=1
- env: USE_CPANFILE_SNAPSHOT=true COVERAGE=1
env:
global:
# Carton --deployment only works on the same version of perl
# that the snapshot was built from.
- DEPLOYMENT_PERL_VERSION=5.22
- DEVEL_COVER_OPTIONS="-ignore,^local/"
- PERL_CARTON_PATH=$TRAVIS_BUILD_DIR/local
- CPAN_RESOLVER=snapshot
matrix:

# Get one passing run with coverage and one passing run with Test::Vars
# checks. If run together they more than double the build time.
- COVERAGE=1 USE_CPANFILE_SNAPSHOT=true
- USE_CPANFILE_SNAPSHOT=false HARNESS_VERBOSE=1
- USE_CPANFILE_SNAPSHOT=false CPAN_RESOLVER=metadb PERL_CARTON_PATH=$TRAVIS_BUILD_DIR/no-snapshot HARNESS_VERBOSE=1
- USE_CPANFILE_SNAPSHOT=true
- USE_CPANFILE_SNAPSHOT=true COVERAGE=1

before_install:
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
Expand All @@ -32,15 +34,15 @@ before_install:

install:
- cpan-install --coverage # installs converage prereqs, if enabled
- 'cpm install `test "${USE_CPANFILE_SNAPSHOT}" = "false" && echo " --resolver metadb" || echo " --resolver snapshot"`'
- cpm install -L $PERL_CARTON_PATH --resolver $CPAN_RESOLVER

before_script:
- coverage-setup

script:
# Devel::Cover isn't in the cpanfile
# but if it's installed into the global dirs this should work.
- carton exec prove -lr -j$(test-jobs) t
# Parallel tests seem to have Heisenfailures. Disable for now.
# - carton exec prove -lr -j$(test-jobs) t
- carton exec prove -lr t

after_success:
- coverage-report
Expand Down
13 changes: 7 additions & 6 deletions app.psgi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use warnings;
# TODO: When we know everything will work reliably: $ENV{PLACK_ENV} ||= 'development';
#
use File::Basename;
use Config::JFDI;
use Config::ZOMG ();
use Log::Log4perl;
use File::Spec;
use File::Path ();
Expand All @@ -21,7 +21,7 @@ my $config;
BEGIN {
$root_dir = File::Basename::dirname(__FILE__);
$dev_mode = $ENV{PLACK_ENV} && $ENV{PLACK_ENV} eq 'development';
$config = Config::JFDI->new(
$config = Config::ZOMG->open(
name => 'MetaCPAN::Web',
path => $root_dir,
);
Expand All @@ -31,8 +31,9 @@ BEGIN {
$ENV{METACPAN_WEB_DEBUG} = 1;
}

my $log4perl_config = File::Spec->rel2abs( $config->get->{log4perl_file}
|| 'log4perl.conf', $root_dir );
my $log4perl_config
= File::Spec->rel2abs( $config->{log4perl_file} || 'log4perl.conf',
$root_dir );
Log::Log4perl::init($log4perl_config);

# use a unique package and tell l4p to ignore it when finding the warning location.
Expand Down Expand Up @@ -74,15 +75,15 @@ builder {

builder {
die 'cookie_secret not configured'
unless $config->get->{cookie_secret};
unless $config->{cookie_secret};

# Add session cookie here only
enable 'Session::Cookie::MetaCPAN' => (
session_key => 'metacpan_secure',
expires => 2**30,
secure => ( !$dev_mode ),
httponly => 1,
secret => $config->get->{cookie_secret},
secret => $config->{cookie_secret},
);

MetaCPAN::Web->psgi_app;
Expand Down
2 changes: 1 addition & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ requires 'Catalyst::View::TT::Alloy';
requires 'CatalystX::RoleApplicator';
requires 'CatalystX::Fastly::Role::Response', '0.06';
requires 'Config::General';
requires 'Config::JFDI';
requires 'Config::ZOMG', '1.000000';
requires 'Cpanel::JSON::XS';
requires 'Data::Dumper';
requires 'Data::Pageset';
Expand Down
Loading