Skip to content
Snippets Groups Projects
Commit 4e5935e4 authored by Tom Robinson's avatar Tom Robinson
Browse files

time each ci step [ci drivers] [ci e2e] [ci compare_screenshots]

parent cb026706
No related branches found
No related tags found
Loading
......@@ -41,6 +41,25 @@ is_engine_enabled() {
[[ "$ENGINES" == *"$1"* ]]
}
# print a summary on exit
results=""
summary() {
echo -e "========================================"
echo -en "$results"
echo -e "========================================"
}
trap summary EXIT
# records the time and exit code of each step
run_step() {
status=0
start=$(date +%s)
"$@" || status=$?
elapsed=$(expr $(date +%s) - $start || true)
results="${results}status=$status time=$elapsed command=$@\n"
return $status
}
# default engines
export ENGINES="h2"
......@@ -49,44 +68,45 @@ case $CIRCLE_NODE_INDEX in
export ENGINES="h2,mongo,mysql,bigquery";
fi
if is_engine_enabled "mongo"; then
install-mongodb;
run_step install-mongodb;
fi
lein test
run_step lein test
;;
1) if is_enabled "drivers"; then
export ENGINES="h2,sqlserver,oracle";
fi
MB_DB_TYPE=postgres MB_DB_DBNAME=circle_test MB_DB_PORT=5432 MB_DB_USER=ubuntu MB_DB_HOST=localhost \
lein test
run_step lein test
;;
2) if is_enabled "drivers"; then
export ENGINES="h2,postgres,sqlite,crate";
fi
if is_engine_enabled "crate"; then
install-crate;
run_step install-crate;
fi
MB_DB_TYPE=mysql MB_DB_DBNAME=circle_test MB_DB_PORT=3306 MB_DB_USER=ubuntu MB_DB_HOST=localhost \
lein test
run_step lein test
;;
3) if is_enabled "drivers"; then
export ENGINES="h2,redshift,druid";
fi
lein test
run_step lein test
;;
4) lein eastwood
lein bikeshed
lein docstring-checker
./bin/reflection-linter
4) run_step lein eastwood
run_step lein bikeshed
run_step lein docstring-checker
run_step ./bin/reflection-linter
;;
5) npm run lint
npm run test
5) run_step npm run lint
run_step npm run test
;;
6) ./bin/build version frontend sample-dataset uberjar
6) run_step ./bin/build version frontend sample-dataset uberjar
if is_enabled "e2e" || is_enabled "compare_screenshots"; then
USE_SAUCE=true npm run test-e2e
USE_SAUCE=true \
run_step npm run test-e2e
fi
if is_enabled "compare_screenshots"; then
node_modules/.bin/babel-node ./bin/compare-screenshots
run_step node_modules/.bin/babel-node ./bin/compare-screenshots
fi
;;
esac
......@@ -14,7 +14,7 @@ const SLACK_TOKEN = process.env["SLACK_TOKEN"];
const SLACK_CHANNEL = "#ci-screenshots";
const CIRCLE_PROJECT = "github/metabase/metabase";
const CIRCLE_BRANCH = "new-e2e-test-setup";
const CIRCLE_BRANCH = "master";
const CIRCLE_SCREENSHOT_PATH = "/home/ubuntu/metabase/screenshots/";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment