Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add stops-for-location endpoint test #95

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/checkout@v4

- name: Docker Compose up
run: docker-compose up -d
run: docker compose up -d

- name: Wait for services to be up
run: sleep 30
Expand All @@ -44,7 +44,7 @@ jobs:

- name: Docker Compose down
if: always()
run: docker-compose down
run: docker compose down

services_standalone:
name: Services standalone
Expand All @@ -54,7 +54,7 @@ jobs:
uses: actions/checkout@v4

- name: Docker Compose up
run: docker-compose -f docker-compose.standalone.yml up -d
run: docker compose -f docker-compose.standalone.yml up -d

- name: Wait for services to be up
# leave time to download and process the GTFS data
Expand All @@ -67,4 +67,4 @@ jobs:

- name: Docker Compose down
if: always()
run: docker-compose down
run: docker compose down
8 changes: 8 additions & 0 deletions bin/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ else
exit 1
fi

output=$(curl -s "http://localhost:8080/onebusaway-api-webapp/api/where/stops-for-location.json?lat=38.555308&lon=-121.735991&key=test" | jq '.data.outOfRange')
if [[ ! -z "$output" && "$output" == "false" ]]; then
echo "stops-for-location/unitrans_false.json endpoint works."
else
echo "Error: stops-for-location/unitrans_false.json endpoint is not working: $output"
exit 1
fi

# todo: add support for arrivals-and-departures-for-stop endpoint.
# however, it doesn't seem that the unitrans_22182 stop has arrivals and departures on the weekend, so we'll need
# something else to test with. However, for now, this is still a great step forward.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
- JDBC_USER=oba_user
- JDBC_PASSWORD=oba_password
- TEST_API_KEY=test # For test only, remove in production
- TZ=America/New_York
- TZ=America/Los_Angeles

volumes:
# Share the host's `bundle` directory
Expand All @@ -48,4 +48,4 @@ services:
# restart: always

volumes:
mysql-data:
mysql-data:
Loading