[Git][ghc/ghc][wip/ci-only-tests] gitlab-ci: Introduce ONLY_TESTS variable

Ben Gamari gitlab at gitlab.haskell.org
Fri Nov 27 18:39:02 UTC 2020



Ben Gamari pushed to branch wip/ci-only-tests at Glasgow Haskell Compiler / GHC


Commits:
005227ec by Ben Gamari at 2020-11-27T13:38:54-05:00
gitlab-ci: Introduce ONLY_TESTS variable

When using ci.sh manually it is often useful to run just a subset of
tests.

- - - - -


1 changed file:

- .gitlab/ci.sh


Changes:

=====================================
.gitlab/ci.sh
=====================================
@@ -45,6 +45,7 @@ Environment variables affecting both build systems:
 
   VERBOSE           Set to non-empty for verbose build output
   MSYSTEM           (Windows-only) Which platform to build form (MINGW64 or MINGW32).
+  ONLY_TESTS        Select a subset of tests to run
 
 Environment variables determining build configuration of Make system:
 
@@ -430,10 +431,15 @@ function determine_metric_baseline() {
 }
 
 function test_make() {
+  local args=(
+    "THREADS=$cores"
+    "JUNIT_FILE=../../junit.xml"
+  )
+  if [[ -n "$ONLY_TESTS" ]]; then
+    args+=( "TEST=$ONLY_TESTS" )
+  fi
   run "$MAKE" test_bindist TEST_PREP=YES
-  run "$MAKE" V=0 test \
-    THREADS="$cores" \
-    JUNIT_FILE=../../junit.xml
+  run "$MAKE" V=0 test "${args[@]}"
 }
 
 function build_hadrian() {
@@ -450,6 +456,11 @@ function build_hadrian() {
 }
 
 function test_hadrian() {
+  local tests=""
+  if [[ -n "$ONLY_TESTS" ]]; then
+    tests="--only=$ONLY_TESTS"
+  fi
+
   cd _build/bindist/ghc-*/
   run ./configure --prefix="$TOP"/_build/install
   run "$MAKE" install
@@ -458,7 +469,8 @@ function test_hadrian() {
   run_hadrian \
     test \
     --summary-junit=./junit.xml \
-    --test-compiler="$TOP"/_build/install/bin/ghc
+    --test-compiler="$TOP"/_build/install/bin/ghc \
+    "$tests"
 }
 
 function cabal_test() {
@@ -498,13 +510,15 @@ function clean() {
 function run_hadrian() {
   if [ -z "$BIGNUM_BACKEND" ]; then BIGNUM_BACKEND="gmp"; fi
   if [ -n "$VERBOSE" ]; then HADRIAN_ARGS="$HADRIAN_ARGS -V"; fi
-  run hadrian/build-cabal \
-    --flavour="$BUILD_FLAVOUR" \
-    -j"$cores" \
-    --broken-test="$BROKEN_TESTS" \
-    --bignum=$BIGNUM_BACKEND \
-    $HADRIAN_ARGS \
-    $@
+  local args=(
+    "--flavour=$BUILD_FLAVOUR"
+    "-j$cores"
+    "--broken-test=$BROKEN_TESTS"
+    "--bignum=$BIGNUM_BACKEND"
+    "${HADRIAN_ARGS[@]}"
+    "$@"
+  )
+  run hadrian/build-cabal "${args[@]}"
 }
 
 # A convenience function to allow debugging in the CI environment.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/005227ecc4be13957d9ff5ea38a802954cdb4d28

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/005227ecc4be13957d9ff5ea38a802954cdb4d28
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201127/0b343d37/attachment-0001.html>


More information about the ghc-commits mailing list