[commit: ghc] wip/jenkins: Fix testsuite (0ca1b1f)

git at git.haskell.org git at git.haskell.org
Sun Jun 4 05:08:28 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/jenkins
Link       : http://ghc.haskell.org/trac/ghc/changeset/0ca1b1ff8981b2ef46a67ccf3c15a3c886ebb2cd/ghc

>---------------------------------------------------------------

commit 0ca1b1ff8981b2ef46a67ccf3c15a3c886ebb2cd
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Tue May 30 12:11:16 2017 -0400

    Fix testsuite


>---------------------------------------------------------------

0ca1b1ff8981b2ef46a67ccf3c15a3c886ebb2cd
 Jenkinsfile | 64 ++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index c88b5ee..2e18d93 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -157,47 +157,47 @@ def buildGhc(params) {
   }
 }
 
+def withGhcBinDist(String targetTriple, Closure f) {
+  unstash "bindist-${targetTriple}"
+  def ghcVersion = readFile "ghc-version"
+  sh "tar -xf ${ghcVersion}-${targetTriple}.tar.xz"
+  dir("ghc-${ghcVersion}") { f }
+}
+
 def testGhc(params) {
   String targetTriple = params?.targetTriple
   String makeCmd = params?.makeCmd ?: 'make'
   boolean runNofib = params?.runNofib
 
-  stage('Extract binary distribution') {
-    sh "mkdir tmp"
-    dir "tmp"
-    unstash "bindist-${targetTriple}"
-    def ghcVersion = readFile "ghc-version"
-    sh "tar -xf ${ghcVersion}-${targetTriple}.tar.xz"
-    dir ghcVersion
-  }
-
-  stage('Install testsuite dependencies') {
-    if (params.nightly) {
-      def pkgs = ['mtl', 'parallel', 'parsec', 'primitive', 'QuickCheck',
-                  'random', 'regex-compat', 'syb', 'stm', 'utf8-string',
-                  'vector']
-      installPkgs pkgs
+  withGhcBinDist(targetTriple) {
+    stage('Install testsuite dependencies') {
+      if (params.nightly) {
+        def pkgs = ['mtl', 'parallel', 'parsec', 'primitive', 'QuickCheck',
+                    'random', 'regex-compat', 'syb', 'stm', 'utf8-string',
+                    'vector']
+        installPkgs pkgs
+      }
     }
-  }
 
-  stage('Run testsuite') {
-    def target = 'test'
-    if (params.nightly) {
-      target = 'slowtest'
+    stage('Run testsuite') {
+      def target = 'test'
+      if (params.nightly) {
+        target = 'slowtest'
+      }
+      sh "${makeCmd} THREADS=${env.THREADS} ${target}"
     }
-    sh "${makeCmd} THREADS=${env.THREADS} ${target}"
-  }
 
-  stage('Run nofib') {
-    if (runNofib) {
-      installPkgs(['regex-compat'])
-      sh """
-         cd nofib
-         ${makeCmd} clean
-         ${makeCmd} boot
-         ${makeCmd} >../nofib.log 2>&1
-         """
-      archiveArtifacts 'nofib.log'
+    stage('Run nofib') {
+      if (runNofib) {
+        installPkgs(['regex-compat'])
+        sh """
+          cd nofib
+          ${makeCmd} clean
+          ${makeCmd} boot
+          ${makeCmd} >../nofib.log 2>&1
+          """
+        archiveArtifacts 'nofib.log'
+      }
     }
   }
 }



More information about the ghc-commits mailing list