diff options
author | Sarah Morgensen <iskarian@mgsn.dev> | 2021-08-06 21:48:34 -0700 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-08-31 10:44:36 +0200 |
commit | 969fb0b2be24a9d49972cb6480ca8147b75e5748 (patch) | |
tree | ff933737404979bb6bda3227803b264600c91542 | |
parent | 92046a65fa7820a60c2773650072a488ac23dc83 (diff) | |
download | guix-969fb0b2be24a9d49972cb6480ca8147b75e5748.tar guix-969fb0b2be24a9d49972cb6480ca8147b75e5748.tar.gz |
build-system/go: Honor #:parallel-tests?.
guix/build/go-build-system.scm (build): Honor #:parallel-tests?.
guix/build-system/go.scm (go-build): Add PARALLEL-TESTS? parameter.
[builder]: Use it.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
-rw-r--r-- | guix/build-system/go.scm | 2 | ||||
-rw-r--r-- | guix/build/go-build-system.scm | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 1e8ecba80c..226688f2d2 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -193,6 +193,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)) (goarch #f) @@ -224,6 +225,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 160323b65e..8aa8a17495 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -279,9 +279,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) |