tests: Remove extraneous 'with-store' in derivations test.

* tests/derivations.scm ("derivation fails but keep going"): Remove extraneous
'with-store'.

Change-Id: If30c2d457504b8524cd167f1a145fbbea61b513c
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Maxim Cournoyer 2025-02-17 14:35:07 +00:00
parent 0bda75dd47
commit aea511df93
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -150,29 +150,28 @@
(test-assert "derivation fails but keep going" (test-assert "derivation fails but keep going"
;; In keep-going mode, 'build-derivations' should fail because of D1, but it ;; In keep-going mode, 'build-derivations' should fail because of D1, but it
;; must return only after D2 has succeeded. ;; must return only after D2 has succeeded.
(with-store store (let* ((d1 (derivation %store "fails"
(let* ((d1 (derivation %store "fails" %bash `("-c" "false")
%bash `("-c" "false") #:sources (list %bash)))
#:sources (list %bash))) (d2 (build-expression->derivation %store "sleep-then-succeed"
(d2 (build-expression->derivation %store "sleep-then-succeed" `(begin
`(begin ,(random-text)
,(random-text) ;; XXX: Hopefully that's long
;; XXX: Hopefully that's long ;; enough that D1 has already
;; enough that D1 has already ;; failed.
;; failed. (sleep 2)
(sleep 2) (mkdir %output)))))
(mkdir %output))))) (set-build-options %store
(set-build-options %store #:use-substitutes? #f
#:use-substitutes? #f #:keep-going? #t)
#:keep-going? #t) (guard (c ((store-protocol-error? c)
(guard (c ((store-protocol-error? c) (and (= 100 (store-protocol-error-status c))
(and (= 100 (store-protocol-error-status c)) (string-contains (store-protocol-error-message c)
(string-contains (store-protocol-error-message c) (derivation-file-name d1))
(derivation-file-name d1)) (not (valid-path? %store (derivation->output-path d1)))
(not (valid-path? %store (derivation->output-path d1))) (valid-path? %store (derivation->output-path d2)))))
(valid-path? %store (derivation->output-path d2))))) (build-derivations %store (list d1 d2))
(build-derivations %store (list d1 d2)) #f)))
#f))))
(test-assert "identical files are deduplicated" (test-assert "identical files are deduplicated"
;; Note: DATA must be longer than %DEDUPLICATION-MINIMUM-SIZE. ;; Note: DATA must be longer than %DEDUPLICATION-MINIMUM-SIZE.