1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

tests: don't use 'file://...' URIs for testing git downloads.

While 'url-fetch*' in (guix download) special-cases these URIs, 'git-fetch'
does not.  Consequently, the recent changes to (guix scripts perform-download)
that disallow these URIs cause tests that use builtin:git-download to fail.

* guix/tests/git.scm (serve-git-repository, call-with-served-git-repository):
  new procedures.
  (with-served-git-repository, with-served-temporary-git-repository): new
  syntax.
* .dir-locals.el (scheme-mode): add indentation information for
  'with-served-git-repository'.
* tests/builders.scm ("git-fetch, file URI"): use git:// URI with
  'with-served-temporary-git-repository'.
* tests/derivations.scm ("'git-download' build-in builder, invalid hash",
  "'git-download' built-in builder, invalid commit", "'git-download' built-in
  builder, not found"): same.
  ("'git-download' built-in builder"): same, and use a nonce in the repo
  contents so that success isn't cached.

Change-Id: Id3e1233bb74d5987faf89c4341e1d37f09c77c80
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Reepca Russelstein
2025-09-16 22:08:19 -05:00
committed by Ludovic Courtès
parent b39f914b3e
commit 55a10ce4e6
4 changed files with 107 additions and 24 deletions

View File

@@ -88,10 +88,10 @@
(and (file-exists? out)
(valid-path? %store out))))
(test-equal "git-fetch, file URI"
(test-equal "git-fetch, local URI"
'("." ".." "a.txt" "b.scm")
(let ((nonce (random-text)))
(with-temporary-git-repository directory
(with-served-temporary-git-repository directory port
`((add "a.txt" ,nonce)
(add "b.scm" "#t")
(commit "Commit.")
@@ -103,7 +103,9 @@
#:recursive? #t))
(drv (git-fetch
(git-reference
(url (string-append "file://" directory))
(url (string-append "git://localhost:"
(number->string port)
"/"))
(commit "v1.0.0"))
'sha256 hash
"git-fetch-test")))