[commit: ghc] wip/jenkins: Fix testsuite (7ec638a)

git at git.haskell.org git at git.haskell.org
Fri Jul 28 16:41:38 UTC 2017


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

On branch  : wip/jenkins
Link       : http://ghc.haskell.org/trac/ghc/changeset/7ec638a16e6d3c376a71e8c0539a9e421e96fdb0/ghc

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

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

    Fix testsuite


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

7ec638a16e6d3c376a71e8c0539a9e421e96fdb0
 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