Add ability to chose regressiontest commit and branch
authorPaul Bauer <paul.bauer.q@gmail.com>
Thu, 4 Jun 2020 14:58:59 +0000 (14:58 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Thu, 4 Jun 2020 14:58:59 +0000 (14:58 +0000)
Change-Id: I4b51a2c1a0ea434dc4c6d306ba88768ba8032270

admin/gitlab-ci/archive.gitlab-ci.yml
docs/dev-manual/gitlab.rst

index 6c71b7a6d7b108f332d92fc706d860cb841ffe8b..39fd0e2ba95872f01771e87fa4db4a245194dc4e 100644 (file)
@@ -36,6 +36,15 @@ regressiontests:prepare:
   # Always clone the default version for this branch, master in this case
   script:
     - export REGTESTBRANCH=master
+    - if [[ -z $REGRESSIONTESTBRANCH ]] ; then
+      export REGTESTBRANCH=$REGRESSIONTESTBRANCH ;
+      echo "Using $REGTESTBRANCH instead of default" ;
+      fi
+    - export CHECKOUTCOMMIT=FETCH_HEAD
+    - if [[ ! -z $REGRESSIONTESTCOMMIT ]] ; then
+      export CHECKOUTCOMMIT=$REGRESSIONTESTCOMMIT ;
+      echo "Using $CHECKOUTCOMMIT instead of head of $SOURCEBRANCH" ;
+      fi
     - if [[ ! -d regressiontests ]] ; then
         mkdir regressiontests ;
         cd regressiontests ;
@@ -44,7 +53,7 @@ regressiontests:prepare:
       fi
     - cd regressiontests
     - git fetch https://gitlab.com/gromacs/gromacs-regressiontests.git $REGTESTBRANCH
-    - git checkout -qf FETCH_HEAD
+    - git checkout -qf $CHECKOUTCOMMIT
     - git clean -ffdxq
     - git gc
     - git archive -o gmx-regressiontests.tar.gz --prefix regressiontests/ -9 HEAD
index 51852c3f4febadacad024026fdfa29899a58e752..734f28b7b6efffb7f7b9e0fdcd6df173bdd34f53 100644 (file)
@@ -156,6 +156,21 @@ basic job name from qualifiers or details. Also consider
 
 .. _variables:
 
+Updating regression tests
+~~~~~~~~~
+
+Changes in |GROMACS| that require changes in regression-tests are notoriously hard,
+because a merge request that tests against the non-updated version of the
+regression tests will necessarily fail, while updating regression tests while
+the current change is not integrated into master, might cause other
+merge request pipelines to fail.
+
+The solution is a new regression-test branch or commit, uploaded to gitlab.
+Then set that regression test branch with REGRESSIONTESTBRANCH or
+the specific commit with REGRESSIONTESTCOMMIT when
+running the specific pipeline that requires the regressiontest-update. 
+See below on how to set variables for specific pipelines.
+
 Variables
 ~~~~~~~~~
 
@@ -209,5 +224,23 @@ Other important variable keys are as follows.
         patch to the base Docker images to include the dependency to reduce
         pipeline execution time.
 
+    REGRESSIONTESTBRANCH
+        Use this branch of the regressiontests rather than master to allow for 
+        merge requests that require updated regression tests with valid CI tests.
+
+    REGRESSIONTESTCOMMIT
+        Use this commit to the regressiontests rather than the head on master to 
+        allow for merge requests that require updated regression tests with 
+        valid CI tests.
+
+
 .. todo:: Define common variables.
     ``BUILD_DIR``, ``INSTALL_DIR``, ``CACHE_FALLBACK_KEY``, ...
+
+Setting variables
+~~~~~~~~~
+
+Variables for individual piplelines are set in the gitlab interface under 
+``CI/CD``&rarr;``Pipelines``. Then chose in the top right corner ``Run Piplelines``.
+Under ``Run for``, the desired branch may be selected, and variables may be set
+in the fields below.
\ No newline at end of file