good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit f0ac7040 authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Improve local CI experience

parent 0236290a
No related branches found
No related tags found
No related merge requests found
......@@ -3,12 +3,13 @@
source ci/lib.sh || exit 1
mkdir -p profs
go test --vet=off --run=^$ -bench=. \
-cpuprofile=profs/cpu \
-memprofile=profs/mem \
-blockprofile=profs/block \
-mutexprofile=profs/mutex \
./...
# -cpuprofile=profs/cpu \
# -memprofile=profs/mem \
# -blockprofile=profs/block \
# -mutexprofile=profs/mutex \
set +x
echo "profiles are in ./profs
......
......@@ -18,6 +18,19 @@ function docker_run() {
"${IMAGE}"
}
function help() {
set +x
echo
echo "$0 [-h] <step>"
cat << EOF
If you do not pass in an explicit step, all steps will be ran in order.
Pass "analyze" as the step to be put into an interactive container to analyze
profiles.
EOF
exit 1
}
# Use this to analyze benchmark profiles.
if [[ ${1-} == "analyze" ]]; then
docker run \
......@@ -29,7 +42,15 @@ if [[ ${1-} == "analyze" ]]; then
golang:1.12
fi
if [[ ${1-} == "-h" || ${1-} == "--help" || ${1-} == "help" ]]; then
help
fi
if [[ $# -gt 0 ]]; then
if [[ ! -d "ci/$*" ]]; then
help
fi
docker_run "ci/$*"
exit 0
fi
......
......@@ -16,10 +16,9 @@ go tool cover -func=profs/coverage
if [[ $CI ]]; then
bash <(curl -s https://codecov.io/bash) -f profs/coverage
else
go tool cover -html=profs/coverage -o=coverage.html
go tool cover -html=profs/coverage -o=profs/coverage.html
set +x
echo
echo "please open coverage.html to see detailed test coverage stats"
echo "profiles are in ./prof/"
echo "please open profs/coverage.html to see detailed test coverage stats"
fi
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