diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm index 339fd42e52e4ac9573e64f2dd58134257595c28d..d15330d73fb7539a2a756493cb7e259aa166e6ca 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 53f772f7e681e7354f066a6854667cbaf9745ecd..1f90e65d860d66da41ebc573424e08ab4885b75d 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 b4ed046cfc5ace4dea85583670797d83f10f3cc5..e03fb132ed7e919c151762d8b0a26c653681c088 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 3e963461f2f47729968831c405cc08720d16aa18..c716d7a05a657a0d3609416ec47faac4327c6359 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 2432fb9cca4bf1be0438e39e68b656716b0eabc2..ff85f7d06f9e8b463f486ee7c502c0b17e824b88 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 6e827c52005ced3e3140bbbe4c65fbb64f2996a1..423f2b1931274efabb562c6b3d670d2d728180dd 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 414210952b2e76545b40a997920082b596f13725..d982aa5d4e2babc27022b822078506856d69cab3 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