summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-05-09 14:44:48 +0200
committerLudovic Courtès <ludo@gnu.org>2022-05-09 14:44:48 +0200
commitda3be3ff4f6d8b643ed9bdf6834df366b1bcea44 (patch)
tree913ff6010447b6a31dfbe4be6eccc06b11fd83cf /tests
parentf5fe0082abe4547f3fb9f29d8351473cfb3a387b (diff)
parent4980630d1e3e6f9a6dc05438c7593a727207d9a0 (diff)
Merge branch 'master' into staging
Diffstat (limited to 'tests')
-rw-r--r--tests/gexp.scm18
-rw-r--r--tests/publish.scm23
-rw-r--r--tests/transformations.scm14
3 files changed, 54 insertions, 1 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index c80ca13fab..35bd99e6d4 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -1606,6 +1606,24 @@ importing.* \\(guix config\\) from the host"
(not (member (derivation-file-name native) refs))
(member (derivation-file-name cross) refs))))))
+(test-assertm "references-file"
+ (let* ((exp #~(symlink #$%bootstrap-guile #$output))
+ (computed (computed-file "computed" exp
+ #:guile %bootstrap-guile))
+ (refs (references-file computed "refs"
+ #:guile %bootstrap-guile)))
+ (mlet* %store-monad ((drv0 (lower-object %bootstrap-guile))
+ (drv1 (lower-object computed))
+ (drv2 (lower-object refs)))
+ (mbegin %store-monad
+ (built-derivations (list drv2))
+ (mlet %store-monad ((refs ((store-lift requisites)
+ (list (derivation->output-path drv1)))))
+ (return (lset= string=?
+ (call-with-input-file (derivation->output-path drv2)
+ read)
+ refs)))))))
+
(test-assert "lower-object & gexp-input-error?"
(guard (c ((gexp-input-error? c)
(gexp-error-invalid-input c)))
diff --git a/tests/publish.scm b/tests/publish.scm
index 47c5eabca0..efb5698bed 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -41,12 +41,15 @@
#:autoload (zstd) (call-with-zstd-input-port)
#:use-module (web uri)
#:use-module (web client)
+ #:use-module (web request)
#:use-module (web response)
+ #:use-module ((guix http-client) #:select (http-multiple-get))
#:use-module (rnrs bytevectors)
#:use-module (ice-9 binary-ports)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-64)
+ #:use-module (srfi srfi-71)
#:use-module (ice-9 threads)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
@@ -166,6 +169,26 @@ FileSize: ~a\n"
(publish-uri
(string-append "/" (store-path-hash-part %item) ".narinfo")))))
+(test-equal "/*.narinfo pipeline"
+ (make-list 500 200)
+ ;; Make sure clients can pipeline requests and correct responses, in the
+ ;; right order. See <https://issues.guix.gnu.org/54723>.
+ (let* ((uri (string->uri (publish-uri
+ (string-append "/"
+ (store-path-hash-part %item)
+ ".narinfo"))))
+ (_ expected (http-get uri #:streaming? #f #:decode-body? #f)))
+ (http-multiple-get (string->uri (publish-uri ""))
+ (lambda (request response port result)
+ (and (bytevector=? expected
+ (get-bytevector-n port
+ (response-content-length
+ response)))
+ (cons (response-code response) result)))
+ '()
+ (make-list 500 (build-request uri))
+ #:batch-size 77)))
+
(test-equal "/*.narinfo with properly encoded '+' sign"
;; See <http://bugs.gnu.org/21888>.
(let* ((item (add-text-to-store %store "fake-gtk+" "Congrats!"))
diff --git a/tests/transformations.scm b/tests/transformations.scm
index 8db85b4305..dbfe523518 100644
--- a/tests/transformations.scm
+++ b/tests/transformations.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016-2017, 2019-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
;;;
;;; This file is part of GNU Guix.
@@ -451,6 +451,18 @@
(string=? (local-file-file input) patch)))
inputs))))))))
+(test-equal "options->transformation, property order"
+ ;; See <https://issues.guix.gnu.org/54942>.
+ '((with-debug-info . "does-not-exist")
+ (with-commit . "does-not-exist=aaaaaaa")
+ (without-tests . "does-not-exist"))
+ (let* ((t (options->transformation
+ '((with-debug-info . "does-not-exist")
+ (with-commit . "does-not-exist=aaaaaaa")
+ (without-tests . "does-not-exist")))))
+ (let ((new (t coreutils)))
+ (assq-ref (package-properties new) 'transformations))))
+
(test-equal "options->transformation, with-latest"
"42.0"
(mock ((guix upstream) %updaters