GNU bug report logs -
#49919
[PATCH core-updates 0/2] build-system/go: Enable parallelism.
Previous Next
Reported by: Sarah Morgensen <iskarian <at> mgsn.dev>
Date: Sat, 7 Aug 2021 04:47:01 UTC
Severity: normal
Tags: patch
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
guix/build/go-build-system.scm (build): Honor #:parallel-tests?.
guix/build-system/go.scm (go-build): Add PARALLEL-TESTS? parameter.
[builder]: Use it.
---
guix/build-system/go.scm | 2 ++
guix/build/go-build-system.scm | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index a5aa21b99e..7b66163779 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -131,6 +131,7 @@ commit hash and its date rather than a proper release tag."
(build-flags ''())
(tests? #t)
(parallel-build? #t)
+ (parallel-tests? #t)
(allow-go-reference? #f)
(system (%current-system))
(guile #f)
@@ -156,6 +157,7 @@ commit hash and its date rather than a proper release tag."
#:build-flags #$build-flags
#:tests? #$tests?
#:parallel-build? #$parallel-build?
+ #:parallel-tests? #$parallel-tests?
#:allow-go-reference? #$allow-go-reference?
#:inputs #$(input-tuples->gexp inputs)))))
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 521bad9667..0ad580a484 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -239,9 +239,12 @@ unpacking."
(invoke "go" "env"))))
;; Can this also install commands???
-(define* (check #:key tests? import-path #:allow-other-keys)
+(define* (check #:key tests? import-path (parallel-tests? #t)
+ #:allow-other-keys)
"Run the tests for the package named by IMPORT-PATH."
(when tests?
+ (let* ((njobs (if parallel-tests? (parallel-job-count) 1)))
+ (setenv "GOMAXPROCS" (number->string njobs)))
(invoke "go" "test" import-path))
#t)
--
2.31.1
This bug report was last modified 1 year and 182 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.