Available tests:
apps/workbench
-apps/workbench_performance
+apps/workbench_benchmark
+apps/workbench_profile
doc
services/api
services/crunchstat
done
fi
}
+
+sanity_checks() {
+ # Make sure WORKSPACE is set
+ if ! [[ -n "$WORKSPACE" ]]; then
+ echo >&2 "$helpmessage"
+ echo >&2
+ echo >&2 "Error: WORKSPACE environment variable not set"
+ echo >&2
+ exit 1
+ fi
+
+ # Make sure virtualenv is installed
+ `virtualenv --help >/dev/null 2>&1`
+
+ if [[ "$?" != "0" ]]; then
+ echo >&2
+ echo >&2 "Error: virtualenv could not be found"
+ echo >&2
+ exit 1
+ fi
+
+ # Make sure go is installed
+ `go env >/dev/null 2>&1`
+
+ if [[ "$?" != "0" ]]; then
+ echo >&2
+ echo >&2 "Error: go could not be found"
+ echo >&2
+ exit 1
+ fi
+
+ # Make sure gcc is installed
+ `gcc --help >/dev/null 2>&1`
+
+ if [[ "$?" != "0" ]]; then
+ echo >&2
+ echo >&2 "Error: gcc could not be found"
+ echo >&2
+ exit 1
+ fi
+
+}
+
declare -a failures
declare -A skip
declare -A testargs
+skip[apps/workbench_profile]=1
while [[ -n "$1" ]]
do
skip[$skipwhat]=1
;;
--only)
- only="$1"; shift
+ only="$1"; skip[$1]=""; shift
;;
--skip-install)
skip_install=1
esac
done
-# Sanity check
-if ! [[ -n "$WORKSPACE" ]]; then
- echo >&2 "$helpmessage"
- echo >&2
- echo >&2 "Error: WORKSPACE environment variable not set"
- echo >&2
- exit 1
-fi
+sanity_checks
echo "WORKSPACE=$WORKSPACE"
fi
# Needed for run_test_server.py which is used by certain (non-Python) tests.
-pip install PyYAML
+pip install PyYAML || fatal "pip install PyYAML failed"
checkexit() {
if [[ "$?" != "0" ]]; then
timer_reset
if [[ "$2" == "go" ]]
then
- go test "${testargs[$1]}" "git.curoverse.com/arvados.git/$1"
+ go test ${testargs[$1]} "git.curoverse.com/arvados.git/$1"
elif [[ "$2" == "pip" ]]
then
- # Other test suites can depend on tests_require
- # dependencies of this package. For example, keepproxy runs
- # run_test_server.py, which depends on the yaml package,
- # which is in sdk/python's tests_require but not
- # install_requires, and therefore does not get installed by
- # setuptools until we run "setup.py test" *and* install the
- # .egg files that setup.py downloads.
cd "$WORKSPACE/$1" \
- && python setup.py test ${testargs[$1]} \
- && (easy_install *.egg || true)
+ && python setup.py test ${testargs[$1]}
elif [[ "$2" != "" ]]
then
"test_$2"
cd "$WORKSPACE/services/api" \
&& RAILS_ENV=test bundle exec rake db:drop \
- && RAILS_ENV=test bundle exec rake db:create \
- && RAILS_ENV=test bundle exec rake db:setup
+ && RAILS_ENV=test bundle exec rake db:setup \
+ && RAILS_ENV=test bundle exec rake db:fixtures:load
}
do_install services/api apiserver
test_apiserver() {
cd "$WORKSPACE/services/api"
- RAILS_ENV=test bundle exec rake test ${testargs[apiserver]}
+ RAILS_ENV=test bundle exec rake test ${testargs[services/api]}
}
do_test services/api apiserver
-# We must test sdk/python before testing services/keepproxy, because
-# keepproxy depends on sdk/python's test dependencies.
for p in "${pythonstuff[@]}"
do
do_test "$p" pip
test_workbench() {
cd "$WORKSPACE/apps/workbench" \
- && RAILS_ENV=test bundle exec rake test ${testargs[workbench]}
+ && RAILS_ENV=test bundle exec rake test ${testargs[apps/workbench]}
}
do_test apps/workbench workbench
-test_workbench_performance() {
+test_workbench_benchmark() {
+ cd "$WORKSPACE/apps/workbench" \
+ && RAILS_ENV=test bundle exec rake test:benchmark ${testargs[apps/workbench_benchmark]}
+}
+do_test apps/workbench_benchmark workbench_benchmark
+
+test_workbench_profile() {
cd "$WORKSPACE/apps/workbench" \
- && RAILS_ENV=test bundle exec rake test:benchmark
+ && RAILS_ENV=test bundle exec rake test:profile ${testargs[apps/workbench_profile]}
}
-do_test apps/workbench_performance workbench_performance
+do_test apps/workbench_profile workbench_profile
report_outcomes
clear_temp