use small stations database for some tests

This commit is contained in:
Derf Null 2023-06-26 20:18:27 +02:00
parent 0702a0edca
commit 16237bfe21
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA
7 changed files with 14 additions and 0 deletions

View file

@ -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',

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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