Skip to content

Commit

Permalink
tests: download & import GTFS Schedule before testing ✅
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Aug 29, 2024
1 parent 9ea0060 commit e00827a
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions test/index.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
#!/bin/bash

set -eu -o pipefail
cd $(dirname $(realpath $0))

cd "$(dirname $0)"
set -x

wget -nv --compression auto \
-r --no-parent --no-directories -R .csv.gz,.csv.br,shapes.csv \
-P gtfs -N 'https://vbb-gtfs.jannisr.de/2024-06-21/'

env | grep '^PG' || true
psql -c 'CREATE DATABASE vbb_2024_06_21'
export PGDATABASE=vbb_2024_06_21

NODE_ENV=production gtfs-to-sql -d \
--trips-without-shape-id -- \
gtfs/agency.csv \
gtfs/calendar.csv \
gtfs/calendar_dates.csv \
gtfs/frequencies.csv \
gtfs/routes.csv \
gtfs/stop_times.csv \
gtfs/stops.csv \
gtfs/transfers.csv \
gtfs/trips.csv \
| sponge | psql -q -b -v 'ON_ERROR_STOP=1'

NODE_ENV=production build-gtfs-match-index \
../hafas-info.js ../gtfs-info.js \
| sponge | psql -q -b -v 'ON_ERROR_STOP=1'

# ---

node vdv-aus-istfahrt-as-fptf-trip.js
node fptf-trip-as-gtfs-rt-tripupdate.js

0 comments on commit e00827a

Please sign in to comment.