Initial push of test utility
10 files changed
tree: 5fcf6b4984066080b7da117d238ca2c8acdf0cf6
  1. api/
  2. bookingservice/
  3. feeds/
  4. testclient/
  5. utils/

Maps Booking

This repo contains tools and code samples for partners that wish to integrate with Reserve

Testing Client

Before using the test utility, the Go programming language must be installed on your workstation. A precompiled Go binary for your operating system can be found here

This guide will assume you're using the default GOPATH and subsequent GOBIN. For a comprehensive explanation of the GOPATH env variable please see this document by the Go team.

Installing the utility

First, build your Go directory structure. A comprehensive guide on the intended structure of Go code can be found here.

mkdir -p $HOME/go/bin $HOME/go/pkg $HOME/go/src/

Next, retrieve the utility from the maps-booking repository

git clone $HOME/go/src/

Lastly, download all dependencies and install the tool.

go get -d $HOME/go/...
go install $HOME/go/src/

Using the utility

After following the install steps above an executable should now live in


All available flags can be displayed using the ‘--help’ flag. The currently accepted flags are:

    Whether to test all endpoints.
-availability_feed string
    Absolute path to availability feed required for all tests except health.
    Feeds can be in either json or pb3 format
    Whether to test the GetBookingStatus endpoint.
    Whether to test the CreateBooking endpoint.
    Whether to test the CheckAvailability endpoint.
    Whether to test the Health endpoint.
    Whether to test the ListBookings endpoint
-num_test_slots int
    Maximum number of slots to test from availability_feed.
    Slots will be selected randomly (default 10)
-output_dir string
    Absolute path of dir to dump log file.
    Whether to test the UpdateBooking endpoint.
-rpc_timeout duration
    Number of seconds to wait before abandoning request (default 30s)
-server_addr string
    Your grpc server's address in the format of
    host:port (default "")

Example Usage:

bin/main -health_check_test=true -check_availability_test=true
-output_dir="/tmp" -server_addr="localhost:50051”

Parsing the output

The test utility will output a file with the prefix ‘grpc_test_client_log_’ followed by a timestamp in RFC3339 format. The output file contains a complete log of all Requests and Responses sent/received by the testing tool as well as diffs of the expected response in the event of errors. Similar to a compiler, an overview of the entire run can be found at the end of the file for user friendly digestion.