Sha256: c4a860ae7e8ff81928e0f00d8ac5dcda614ea3105373d668c09c59bf04342c49
Contents?: true
Size: 1.02 KB
Versions: 7
Compression:
Stored size: 1.02 KB
Contents
#!/usr/bin/env bash set -euo pipefail readonly urlfile=cockroach-url # Start a CockroachDB server, wait for it to become ready, and arrange for it to # be force-killed when the script exits. rm -f "$urlfile" # Clean out a past CockroachDB instance. This happens if a build was # canceled on an agent. rm -rf $HOME/tmp/rails & # Start CockroachDB. cockroach start --insecure --host=localhost --listening-url-file="$urlfile" --store=path=$HOME/tmp/rails & trap "echo 'Exit routine: Killing CockroachDB.' && kill -9 $! &> /dev/null" EXIT for i in {0..3} do [[ -f "$urlfile" ]] && break backoff=$((2 ** i)) echo "server not yet available; sleeping for $backoff seconds" sleep $backoff done # Target the Rails dependency file. export BUNDLE_GEMFILE=$(pwd)/rails/Gemfile # Run the tests. cp build/config.teamcity.yml rails/activerecord/test/config.yml echo "Rebuilding database" (cd rails/activerecord && bundle exec rake db:cockroachdb:rebuild) echo "Starting tests" (cd rails/activerecord && bundle exec rake test:cockroachdb TESTFILES=$1)
Version data entries
7 entries across 7 versions & 1 rubygems