From d62382b01f99ab8bac08b01a2609f6fb77a298f5 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 15 Jun 2017 15:13:59 +0100 Subject: Test script should run 't' when other args given. --- perllib/FixMyStreet/TestAppProve.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'perllib/FixMyStreet/TestAppProve.pm') diff --git a/perllib/FixMyStreet/TestAppProve.pm b/perllib/FixMyStreet/TestAppProve.pm index 5298d225f..806608b8b 100644 --- a/perllib/FixMyStreet/TestAppProve.pm +++ b/perllib/FixMyStreet/TestAppProve.pm @@ -91,18 +91,18 @@ sub run { local $ENV{FMS_OVERRIDE_CONFIG} = $config_out; - # If no arguments, test everything - unshift @ARGV, 't' unless @ARGV; + my $prove = App::Prove->new; + $prove->process_args(@ARGV); + # If no arguments, test everything + $prove->argv(['t']) unless @{$prove->argv}; # verbose if we have a single file - unshift @ARGV, '--verbose' if @ARGV and -f $ARGV[-1]; + $prove->verbose(1) if @{$prove->argv} and -f $prove->argv->[-1]; + # we always want to recurse + $prove->recurse(1); + # we always want to save state + $prove->state([ @state, 'save' ]); - unshift @ARGV, - '--recurse', # we always want to recurse - '--state', (join ',' => @state, 'save'); # we always want to save state - - my $prove = App::Prove->new; - $prove->process_args(@ARGV); $prove->run; } -- cgit v1.2.3 From 97fb9772bc96e82f2edb8a9191dd359b07a04fa7 Mon Sep 17 00:00:00 2001 From: Zarino Zappia Date: Fri, 30 Jun 2017 10:51:57 +0100 Subject: Add switch-site script for easily switching config Given a set of config files of the format `conf/general-{cobrand}.yml` this script lets you easily create and recreate a symlink at `conf/general.yml` that points to the cobrand config of your choice. The test suite also then uses this naming convention. --- perllib/FixMyStreet/TestAppProve.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'perllib/FixMyStreet/TestAppProve.pm') diff --git a/perllib/FixMyStreet/TestAppProve.pm b/perllib/FixMyStreet/TestAppProve.pm index 806608b8b..f6e09fbe9 100644 --- a/perllib/FixMyStreet/TestAppProve.pm +++ b/perllib/FixMyStreet/TestAppProve.pm @@ -21,7 +21,7 @@ see bin/run-tests for usage =cut sub cleanup { - unlink "conf/general.test-autogenerated.$$.yml"; + unlink "conf/general-test-autogenerated.$$.yml"; } sub signal_handler { @@ -86,7 +86,7 @@ sub run { $config->{FMS_DB_PASS} = ''; } - my $config_out = "general.test-autogenerated.$$"; + my $config_out = "general-test-autogenerated.$$"; path("conf/$config_out.yml")->spew( YAML::Dump($config) ); local $ENV{FMS_OVERRIDE_CONFIG} = $config_out; -- cgit v1.2.3 From 27110ac506f071ad0c5925ef74de1321514c23c8 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 22 Aug 2017 16:27:32 +0100 Subject: Remove hardcoded states from Problem model. We keep the internal states hardcoded, plus the core open (confirmed) and closed ones, but the remainder are moved to the database. --- perllib/FixMyStreet/TestAppProve.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/TestAppProve.pm') diff --git a/perllib/FixMyStreet/TestAppProve.pm b/perllib/FixMyStreet/TestAppProve.pm index f6e09fbe9..7a387547d 100644 --- a/perllib/FixMyStreet/TestAppProve.pm +++ b/perllib/FixMyStreet/TestAppProve.pm @@ -75,7 +75,7 @@ sub run { $SIG{__WARN__} = sub { print STDERR @_ if $_[0] !~ m/NOTICE: CREATE TABLE/; }; $dbh->do( path('db/schema.sql')->slurp ) or die $!; - $dbh->do( path('db/alert_types.sql')->slurp ) or die $!; + $dbh->do( path('db/fixture.sql')->slurp ) or die $!; $dbh->do( path('db/generate_secret.sql')->slurp ) or die $!; $SIG{__WARN__} = $tmpwarn; -- cgit v1.2.3