diff options
author | drebs <drebs@leap.se> | 2017-07-07 20:05:39 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2017-07-08 08:05:24 -0300 |
commit | 3b51520b4be2f48a204bc0d630c88058ed51afa9 (patch) | |
tree | 34c1948df1461a33ecf15f858553ddc18d76b437 /scripts/benchmark/setup-all-commits-env.sh | |
parent | f21d9e1a4e6d0a2ed6d7af83191e39a2a883241b (diff) |
[benchmark] setup env for benchmark-all-commits conditionally
Diffstat (limited to 'scripts/benchmark/setup-all-commits-env.sh')
-rwxr-xr-x | scripts/benchmark/setup-all-commits-env.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/scripts/benchmark/setup-all-commits-env.sh b/scripts/benchmark/setup-all-commits-env.sh new file mode 100755 index 00000000..79a9324b --- /dev/null +++ b/scripts/benchmark/setup-all-commits-env.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# This script is supposed to be called while running the benchmark job defined +# in `/.gitlab-ci.yml`, to setup the environment when benchmarking all commits +# back in time. It will checkout some needed files and do whatever is needed to +# run tests from older versions of the repository with the newest benchmarking +# facilities. + +set -e + +# By default, gitlab-runner will checkout in a detached HEAD (see +# https://gitlab.com/gitlab-org/gitlab-ce/issues/19421) We want +# pytest-benchmark to report the proper branch name, so we make sure we stay at +# the current branch. + +# Variable names have changed in latest version of gitlab, but the doc seems to +# be outdated (see also https://docs.gitlab.com/ce/ci/variables/README.html). + +# Old variable names: +#git checkout -B "$CI_BUILD_RF_NAME" "$CI_BUILD_REF" + +# New (expected) variable names: +#git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA" + +# Working variable names: +git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_REF" + +# Gitlab will checkout current revision as master / origin/master +# We need some files from the "furure" in order to post the right +# benchmarking data to elasticsearch. +git remote add leap https://leap.se/git/soledad +git fetch leap +git checkout leap/master \ + testing/tox.ini \ + testing/tests/benchmarks/conftest.py \ + testing/tests/conftest.py \ + testing/check-pysqlcipher.py \ + scripts/benchmark/tune-adbapi-parameters.sh + +# ensure larger timeout and more retries for async/concurrent sqlcipher access +./scripts/benchmark/tune-adbapi-parameters.sh +git status +git show -s --pretty=fuller |