diff options
author | Derf Null <derf@finalrewind.org> | 2023-06-26 20:18:27 +0200 |
---|---|---|
committer | Derf Null <derf@finalrewind.org> | 2023-06-26 20:18:27 +0200 |
commit | 16237bfe213de6141d8100402f88ad6686394580 (patch) | |
tree | 8916b60b8e83da31b468c48d35f96194fbf5301c | |
parent | 0702a0edca47bef27e8beeac0aad5f7a5da4f14c (diff) |
use small stations database for some tests
-rw-r--r-- | lib/Travelynx/Command/database.pm | 8 | ||||
-rw-r--r-- | t/02-registration.t | 1 | ||||
-rw-r--r-- | t/11-journey-stats.t | 1 | ||||
-rw-r--r-- | t/12-journey-edit.t | 1 | ||||
-rw-r--r-- | t/21-relations.t | 1 | ||||
-rw-r--r-- | t/22-visibility.t | 1 | ||||
-rw-r--r-- | t/r-negative-delay.t | 1 |
7 files changed, 14 insertions, 0 deletions
diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm index 339fd42..d15330d 100644 --- a/lib/Travelynx/Command/database.pm +++ b/lib/Travelynx/Command/database.pm @@ -1658,6 +1658,11 @@ sub sync_stations { my $count = 0; for my $s ( Travel::Status::DE::IRIS::Stations::get_stations() ) { my ( $ds100, $name, $eva, $lon, $lat ) = @{$s}; + if ( $ENV{__TRAVELYNX_TEST_MINI_IRIS} + and ( $eva < 8000000 or $eva > 8000100 ) ) + { + next; + } $db->insert( 'stations', { @@ -1708,6 +1713,9 @@ sub sync_stations { say 'Updating archived stations ...'; my $old_stations = JSON->new->utf8->decode( scalar read_file('share/old_stations.json') ); + if ( $ENV{__TRAVELYNX_TEST_MINI_IRIS} ) { + $old_stations = []; + } for my $s ( @{$old_stations} ) { $db->insert( 'stations', diff --git a/t/02-registration.t b/t/02-registration.t index 53f772f..1f90e65 100644 --- a/t/02-registration.t +++ b/t/02-registration.t @@ -33,6 +33,7 @@ $t->app->pg->on( $t->app->config->{mail}->{disabled} = 1; +$ENV{__TRAVELYNX_TEST_MINI_IRIS} = 1; $t->app->start( 'database', 'migrate' ); my $csrf_token diff --git a/t/11-journey-stats.t b/t/11-journey-stats.t index b4ed046..e03fb13 100644 --- a/t/11-journey-stats.t +++ b/t/11-journey-stats.t @@ -33,6 +33,7 @@ $t->app->pg->on( $t->app->config->{mail}->{disabled} = 1; +$ENV{__TRAVELYNX_TEST_MINI_IRIS} = 0; $t->app->start( 'database', 'migrate' ); my $csrf_token diff --git a/t/12-journey-edit.t b/t/12-journey-edit.t index 3e96346..c716d7a 100644 --- a/t/12-journey-edit.t +++ b/t/12-journey-edit.t @@ -35,6 +35,7 @@ $t->app->pg->on( $t->app->config->{mail}->{disabled} = 1; +$ENV{__TRAVELYNX_TEST_MINI_IRIS} = 0; $t->app->start( 'database', 'migrate' ); my $csrf_token diff --git a/t/21-relations.t b/t/21-relations.t index 2432fb9..ff85f7d 100644 --- a/t/21-relations.t +++ b/t/21-relations.t @@ -33,6 +33,7 @@ $t->app->pg->on( $t->app->config->{mail}->{disabled} = 1; +$ENV{__TRAVELYNX_TEST_MINI_IRIS} = 1; $t->app->start( 'database', 'migrate' ); my $u = $t->app->users; diff --git a/t/22-visibility.t b/t/22-visibility.t index 6e827c5..423f2b1 100644 --- a/t/22-visibility.t +++ b/t/22-visibility.t @@ -36,6 +36,7 @@ $t->app->pg->on( $t->app->config->{mail}->{disabled} = 1; +$ENV{__TRAVELYNX_TEST_MINI_IRIS} = 1; $t->app->start( 'database', 'migrate' ); my $u = $t->app->users; diff --git a/t/r-negative-delay.t b/t/r-negative-delay.t index 4142109..d982aa5 100644 --- a/t/r-negative-delay.t +++ b/t/r-negative-delay.t @@ -34,6 +34,7 @@ $t->app->pg->on( $t->app->config->{mail}->{disabled} = 1; +$ENV{__TRAVELYNX_TEST_MINI_IRIS} = 0; $t->app->start( 'database', 'migrate' ); my $csrf_token |