[commit: ghc] wip/jenkins: Fix testsuite (545817d)

git at git.haskell.org git at git.haskell.org
Fri Jun 9 07:22:56 UTC 2017


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

On branch  : wip/jenkins
Link       : http://ghc.haskell.org/trac/ghc/changeset/545817d5fec6746b77512b1188e6ee848e96f695/ghc

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

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

    Fix testsuite


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

545817d5fec6746b77512b1188e6ee848e96f695
 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