#!/usr/bin/env bash
set -euo pipefail

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
repo_root="$(cd "${script_dir}/.." && pwd)"

go_root="${repo_root}/golang/nats-server"
if [[ ! -d "${go_root}" && -d "/Users/dohertj2/Desktop/natsdotnet/golang/nats-server" ]]; then
  go_root="/Users/dohertj2/Desktop/natsdotnet/golang/nats-server"
fi

if [[ ! -d "${go_root}" ]]; then
  echo "Unable to locate golang/nats-server checkout." >&2
  exit 1
fi

cd "${go_root}"
go test -v -run 'TestJetStream|TestJetStreamCluster|TestLongCluster|TestRaft' ./server -count=1 -timeout=180m
