diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0b7510c5cf9ff9e8bb79e08d68e6d218285b0ee5..8347d64bee2868d248157211bac731edba95fca3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -67,9 +67,9 @@ benchmark:
   services:
     - couchdb
   script:
+    - '[ -n "${BENCHMARK_ALL_COMMITS}" ] && ./scripts/benchmark/setup-all-commits-env.sh'
     - cd testing
     - curl -s couchdb:5984
-    - '[ -n "${BENCHMARK_ALL_COMMITS}" ] && ./scripts/benchmark/setup-all-commits-env.sh'
     # You can provide a $NETRC variable containing the creds for your
     # elasticsearch instance so it's protected from being leaked in the
     # CI console