From 109608e8c1051e8569f06f02f477412d16e4ef66 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 22 Mar 2017 11:24:42 +0100 Subject: Post benchmark results to elastticsearch In order to do this from CI, please create a secret variable (at i.e. https://0xacab.org/varac/soledad/settings/ci_cd) called PYTEST_OPTS and use this example: --benchmark-autosave --benchmark-storage="elasticsearch+https://USER:PASSWORD@moose.leap.se:9200" --- .gitlab-ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee57c51c..6cafdf54 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,16 @@ stages: - code-check - tests + - benchmark # Cache tox envs between builds cache: paths: - testing/.tox/ +before_script: + - echo "Running on ${HOST_HOSTNAME:=$(hostname)}" + code-check: stage: code-check image: leapcode/soledad:latest @@ -22,3 +26,25 @@ tests: script: - cd testing - tox -- --couch-url http://couchdb:5984 + +benchmark: + stage: benchmark + image: leapcode/soledad:latest + tags: + - benchmark + services: + - couchdb + allow_failure: true + script: + - cd testing + - curl -s couchdb:5984 + # You can provide a $NETRC variable containing the creds for your + # elasticsearch instance so it's protected from being leaked in the + # CI console + # We can't get it working inside docker for unknown reasons. + #- echo "$NETRC" > /root/.netrc && chmod 600 /root/.netrc + # + # Add $PYTEST_OPTS to pytest.ini to allow posting benchmark tests + # to an elasticsearch instance + - echo "addopts=$PYTEST_OPTS" >> pytest.ini && chmod 600 pytest.ini + - tox --recreate -e benchmark -- --couch-url http://couchdb:5984 -- cgit v1.2.3