Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a Catalyst app that uses ConfigLoader.

__PACKAGE__->config( 'Plugin::ConfigLoader' => { file => __PACKAGE__->path_to(qw|conf MYAPP.pl|), } );

There are 2 config files MYAPP.pl and MYAPP_local.pl. Running Catalyst normally all is well and values in MYAPP_local.pl overwrite the values in MYAPP.pl as expected. One of these values is called domain and is used in some TT templates:

Go to http://[% c.config.domain %]/some/widget

The issue observed is that when Catalyst is run via Test::WWW::Mechanize::Catalyst the values in conf/MYAPP.pl are found just fine, however they are not overwritten by the values in MYAPP_local.pl.

I have looked through the Catalyst::Plugin::ConfigLoader code and can't really see how it could load MYAPP.pl but not MYAPP_local.pl

Replies are listed 'Best First'.
Re: Test::WWW::Mechanize::Catalyst - ConfigLoader - Ignoring MYAPP_local.pl
by Anonymous Monk on Jul 03, 2012 at 08:19 UTC

    What does the CATALYST_DEBUG=1 produce? Is the _local.pl loaded at all?

    I usually have my MyApp::Test module which exports some handy functions for test and in the beginning I put: BEGIN { $ENV{CATALYST_CONFIG_LOCAL_SUFFIX} = 'testing' } which sets the local suffix and Catalyst will load myapp_testing.{conf,yaml,pl} (or whatever you use). It works nice for tests where I can set some test values, test dsn and etc.