Skip to content

OneBusAway/api-validator

Repository files navigation

api-validator

A test harness for validating OneBusAway API server behavior using known GTFS data inputs.

Prerequisites

  • Docker
  • Docker Compose
  • Go 1.24+

Setup

  1. Clone the repository:
git clone https://github.com/OneBusAway/api-validator.git
  1. Install gotestsum:
go install gotest.tools/gotestsum@latest

Running Tests

  1. Build the test environment image:
docker compose -f docker/docker-compose.yml build
  1. Run the orchestrator:
make run-orchestrator

For advanced usage, CLI flags, and configuration options, see the Orchestrator documentation: orchestrator

Test Environment

  • OBA Server: http://localhost:8085
  • MySQL Database: localhost:3310
    • Database: oba_database
    • User: oba_user
    • Password: oba_password

Debugging

If the orchestrator fails with timeout errors while waiting for the OBA server:

The orchestrator pings the /api/where/config.json?key=TEST endpoint until it gets a response within the timeout window. The current timeout window is 180 seconds. If timeouts persist, try increasing the timeout value further.

To increase the server startup timeout, edit the StartObaServerAndWait function in this file:

  • cmd/orchestrator/environment.go
func (e *Environment) StartObaServerAndWait() error {
    // increase the ctx deadline
    ctx, cancel := context.WithTimeout(e.ctx, 300*time.Second)
    defer cancel()
}

If the above steps still don't resolve the timeout issues, verify the following:

  1. Start services manually:
docker compose -f ./docker/docker-compose.yml up -d
  1. Check server startup:
docker exec -it oba_server_testing_container /bin/bash
/usr/local/tomcat/bin/catalina.sh start
  1. Monitor logs for startup issues and verify the server starts correctly.

Documentation

For detailed documentation on specific components, see the /docs folder:

Project Structure

  • /docker: Docker configuration and scripts for test environment
  • /cmd: Command-line tools and orchestrator
  • /testdata: GTFS test data
  • /tests: Test suites
  • /internal: Internal packages for test infrastructure
  • /docs: Component documentation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages