From: "Ludovic Courtès" <ludo@gnu.org>
To: 65866@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#65866] [PATCH 8/8] tests: Assume ‘git’ is always available.
Date: Mon, 11 Sep 2023 16:25:26 +0200 [thread overview]
Message-ID: <1488a25806497439ab0b586df11ee689dd7fb446.1694441831.git.ludo@gnu.org> (raw)
In-Reply-To: <cover.1694441830.git.ludo@gnu.org>
* tests/channels.scm (gpg+git-available?): Check for ‘gpg-command’
only.
Remove all ‘test-skip’ statements.
* tests/derivations.scm: Likewise.
* tests/git-authenticate.scm: Likewise.
* tests/git.scm: Likewise.
* tests/import-git.scm: Likewise.
---
tests/channels.scm | 7 +------
tests/derivations.scm | 6 +-----
tests/git-authenticate.scm | 1 -
tests/git.scm | 10 ----------
tests/import-git.scm | 18 ------------------
5 files changed, 2 insertions(+), 40 deletions(-)
diff --git a/tests/channels.scm b/tests/channels.scm
index 62312e240c..6c4276deb4 100644
--- a/tests/channels.scm
+++ b/tests/channels.scm
@@ -50,7 +50,7 @@ (define-module (test-channels)
#:use-module (ice-9 match))
(define (gpg+git-available?)
- (and (which (git-command))
+ (and #t ;'git' is always available
(which (gpg-command)) (which (gpgconf-command))))
(define commit-id-string
@@ -196,7 +196,6 @@ (define channel-metadata-dependencies
"abc1234")))
instances)))))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-channel-instances #:validate-pull"
'descendant
@@ -306,7 +305,6 @@ (define channel-metadata-dependencies
(depends? drv3
(list drv2 drv0) (list))))))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "channel-news, no news"
'()
(with-temporary-git-repository directory
@@ -318,7 +316,6 @@ (define channel-metadata-dependencies
(latest (reference-name->oid repository "HEAD")))
(channel-news-for-commit channel (oid->string latest))))))
-(unless (which (git-command)) (test-skip 1))
(test-assert "channel-news, one entry"
(with-temporary-git-repository directory
`((add ".guix-channel"
@@ -406,7 +403,6 @@ (define channel-metadata-dependencies
(channel-news-for-commit channel commit5 commit1))
'(#f "tag-for-first-news-entry")))))))
-(unless (which (git-command)) (test-skip 1))
(test-assert "channel-news, annotated tag"
(with-temporary-git-repository directory
`((add ".guix-channel"
@@ -453,7 +449,6 @@ (define channel-metadata-dependencies
(channel-news-for-commit channel commit2))
(list commit1)))))))
-(unless (which (git-command)) (test-skip 1))
(test-assert "latest-channel-instances, missing introduction for 'guix'"
(with-temporary-git-repository directory
'((add "a.txt" "A")
diff --git a/tests/derivations.scm b/tests/derivations.scm
index e1312bd46b..0e87778981 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -29,7 +29,7 @@ (define-module (test-derivations)
#:use-module (guix tests git)
#:use-module (guix tests http)
#:use-module ((guix packages) #:select (package-derivation base32))
- #:use-module ((guix build utils) #:select (executable-file? which))
+ #:use-module ((guix build utils) #:select (executable-file?))
#:use-module ((guix hash) #:select (file-hash*))
#:use-module ((git oid) #:select (oid->string))
#:use-module ((git reference) #:select (reference-name->oid))
@@ -295,8 +295,6 @@ (define* (directory-contents dir #:optional (slurp get-bytevector-all))
get-string-all)
text))))))
-;; 'with-temporary-git-repository' relies on the 'git' command.
-(unless (which (git-command)) (test-skip 1))
(test-equal "'git-download' built-in builder"
`(("/a.txt" . "AAA")
("/b.scm" . "#t"))
@@ -325,7 +323,6 @@ (define* (directory-contents dir #:optional (slurp get-bytevector-all))
(build-derivations %store (list drv))
(directory-contents (derivation->output-path drv) get-string-all)))))
-(unless (which (git-command)) (test-skip 1))
(test-assert "'git-download' built-in builder, invalid hash"
(with-temporary-git-repository directory
`((add "a.txt" "AAA")
@@ -349,7 +346,6 @@ (define* (directory-contents dir #:optional (slurp get-bytevector-all))
(build-derivations %store (list drv))
#f))))
-(unless (which (git-command)) (test-skip 1))
(test-assert "'git-download' built-in builder, invalid commit"
(with-temporary-git-repository directory
`((add "a.txt" "AAA")
diff --git a/tests/git-authenticate.scm b/tests/git-authenticate.scm
index c063920c12..4de223d422 100644
--- a/tests/git-authenticate.scm
+++ b/tests/git-authenticate.scm
@@ -44,7 +44,6 @@ (define (gpg+git-available?)
\f
(test-begin "git-authenticate")
-(unless (which (git-command)) (test-skip 1))
(test-assert "unsigned commits"
(with-temporary-git-repository directory
'((add "a.txt" "A")
diff --git a/tests/git.scm b/tests/git.scm
index 9c944d65b1..ad43435b67 100644
--- a/tests/git.scm
+++ b/tests/git.scm
@@ -21,7 +21,6 @@ (define-module (test-git)
#:use-module (git)
#:use-module (guix git)
#:use-module (guix tests git)
- #:use-module (guix build utils)
#:use-module ((guix utils) #:select (call-with-temporary-directory))
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-64)
@@ -33,8 +32,6 @@ (define-module (test-git)
(test-begin "git")
-;; 'with-temporary-git-repository' relies on the 'git' command.
-(unless (which (git-command)) (test-skip 1))
(test-assert "commit-difference, linear history"
(with-temporary-git-repository directory
'((add "a.txt" "A")
@@ -61,7 +58,6 @@ (define-module (test-git)
;; empty list.
(null? (commit-difference commit1 commit4)))))))
-(unless (which (git-command)) (test-skip 1))
(test-assert "commit-difference, fork"
(with-temporary-git-repository directory
'((add "a.txt" "A")
@@ -101,7 +97,6 @@ (define-module (test-git)
(lset= eq? (commit-difference master4 master2)
(list master4 merge master3 devel1 devel2)))))))
-(unless (which (git-command)) (test-skip 1))
(test-assert "commit-difference, excluded commits"
(with-temporary-git-repository directory
'((add "a.txt" "A")
@@ -126,7 +121,6 @@ (define-module (test-git)
(list commit4))
(null? (commit-difference commit4 commit1 (list commit5))))))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "commit-relation"
'(self ;master3 master3
ancestor ;master1 master3
@@ -166,7 +160,6 @@ (define-module (test-git)
(commit-relation master1 merge)
(commit-relation merge master1))))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "commit-descendant?"
'((master3 master3 => #t)
(master1 master3 => #f)
@@ -216,7 +209,6 @@ (define-module (test-git)
(master1 merge)
(merge master1)))))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "remote-refs"
'("refs/heads/develop" "refs/heads/master"
"refs/tags/v1.0" "refs/tags/v1.1")
@@ -231,7 +223,6 @@ (define-module (test-git)
(tag "v1.1" "release-1.1"))
(remote-refs directory)))
-(unless (which (git-command)) (test-skip 1))
(test-equal "remote-refs: only tags"
'("refs/tags/v1.0" "refs/tags/v1.1")
(with-temporary-git-repository directory
@@ -243,7 +234,6 @@ (define-module (test-git)
(tag "v1.1" "Release 1.1"))
(remote-refs directory #:tags? #t)))
-(unless (which (git-command)) (test-skip 1))
(test-assert "update-cached-checkout, tag"
(call-with-temporary-directory
(lambda (cache)
diff --git a/tests/import-git.scm b/tests/import-git.scm
index f1bce154bb..20255dedb3 100644
--- a/tests/import-git.scm
+++ b/tests/import-git.scm
@@ -24,7 +24,6 @@ (define-module (test-import-git)
#:use-module (guix import git)
#:use-module (guix git-download)
#:use-module (guix tests git)
- #:use-module (guix build utils)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-64))
@@ -46,7 +45,6 @@ (define* (make-package directory version #:optional (properties '()))
(base32
"0000000000000000000000000000000000000000000000000000"))))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: no custom prefix, suffix, and delimiter"
"1.0.1"
(with-temporary-git-repository directory
@@ -56,7 +54,6 @@ (define* (make-package directory version #:optional (properties '()))
(let ((package (make-package directory "1.0.0")))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: custom prefix, no suffix and delimiter"
"1.0.1"
(with-temporary-git-repository directory
@@ -67,7 +64,6 @@ (define* (make-package directory version #:optional (properties '()))
'((release-tag-prefix . "prefix-")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: custom suffix, no prefix and delimiter"
"1.0.1"
(with-temporary-git-repository directory
@@ -78,7 +74,6 @@ (define* (make-package directory version #:optional (properties '()))
'((release-tag-suffix . "-suffix-[0-9]*")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: custom delimiter, no prefix and suffix"
"2021.09.07"
(with-temporary-git-repository directory
@@ -89,7 +84,6 @@ (define* (make-package directory version #:optional (properties '()))
'((release-tag-version-delimiter . "-")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: empty delimiter, no prefix and suffix"
"20210907"
(with-temporary-git-repository directory
@@ -100,7 +94,6 @@ (define* (make-package directory version #:optional (properties '()))
'((release-tag-version-delimiter . "")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: custom prefix and suffix, no delimiter"
"2.0.0"
(with-temporary-git-repository directory
@@ -112,7 +105,6 @@ (define* (make-package directory version #:optional (properties '()))
(release-tag-suffix . "suffix-[0-9]")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: custom prefix, suffix, and delimiter"
"2.0.0"
(with-temporary-git-repository directory
@@ -125,7 +117,6 @@ (define* (make-package directory version #:optional (properties '()))
(release-tag-version-delimiter . "_")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: only pre-releases available"
#f
(with-temporary-git-repository directory
@@ -135,7 +126,6 @@ (define* (make-package directory version #:optional (properties '()))
(let ((package (make-package directory "1.0.0")))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: accept pre-releases"
"2.0.0-rc1"
(with-temporary-git-repository directory
@@ -146,7 +136,6 @@ (define* (make-package directory version #:optional (properties '()))
'((accept-pre-releases? . #t)))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: accept pre-releases, and custom prefix"
"2.0.0-rc1"
(with-temporary-git-repository directory
@@ -158,7 +147,6 @@ (define* (make-package directory version #:optional (properties '()))
(release-tag-prefix . "version-")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: accept pre-releases, and custom suffix"
"2.0.0-rc1"
(with-temporary-git-repository directory
@@ -170,7 +158,6 @@ (define* (make-package directory version #:optional (properties '()))
(release-tag-suffix . "-suffix")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: accept pre-releases, delimiter conflicts with pre-release part"
"2.0.0_alpha"
(with-temporary-git-repository directory
@@ -182,7 +169,6 @@ (define* (make-package directory version #:optional (properties '()))
(release-tag-version-delimiter . "_")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: accept pre-releases, and custom suffix and prefix"
"2.0.0-alpha"
(with-temporary-git-repository directory
@@ -195,7 +181,6 @@ (define* (make-package directory version #:optional (properties '()))
(release-tag-suffix . "-suffix")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: accept pre-releases, and custom suffix, prefix, and delimiter"
"2.0.0-alpha"
(with-temporary-git-repository directory
@@ -209,7 +194,6 @@ (define* (make-package directory version #:optional (properties '()))
(release-tag-version-delimiter . "-")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: accept pre-releases, no delimiter, and custom suffix, prefix"
"2alpha"
(with-temporary-git-repository directory
@@ -223,7 +207,6 @@ (define* (make-package directory version #:optional (properties '()))
(release-tag-version-delimiter . "")))))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: no tags found"
#f
(with-temporary-git-repository directory
@@ -232,7 +215,6 @@ (define* (make-package directory version #:optional (properties '()))
(let ((package (make-package directory "1.0.0")))
(latest-git-tag-version package))))
-(unless (which (git-command)) (test-skip 1))
(test-equal "latest-git-tag-version: no valid tags found"
#f
(with-temporary-git-repository directory
--
2.41.0
next prev parent reply other threads:[~2023-09-11 14:27 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 14:23 [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Ludovic Courtès
2023-09-11 14:25 ` [bug#65866] [PATCH 1/8] git-download: Move fallback code to (guix build git) Ludovic Courtès
2023-09-20 16:05 ` [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Maxim Cournoyer
2023-09-20 16:40 ` Simon Tournier
2023-09-22 21:53 ` Ludovic Courtès
2023-09-11 14:25 ` [bug#65866] [PATCH 2/8] git-download: Honor the ‘GUIX_DOWNLOAD_FALLBACK_TEST’ environment variable Ludovic Courtès
2023-09-20 16:07 ` [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Maxim Cournoyer
2023-09-11 14:25 ` [bug#65866] [PATCH 3/8] perform-download: Remove unused one-argument clause Ludovic Courtès
2023-09-20 16:09 ` [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Maxim Cournoyer
2023-09-11 14:25 ` [bug#65866] [PATCH 4/8] daemon: Add “git-download” built-in builder Ludovic Courtès
2023-09-20 17:32 ` [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Maxim Cournoyer
2023-09-21 7:42 ` Ludovic Courtès
2023-09-22 22:27 ` [bug#65866] [PATCH v2 " Ludovic Courtès
2023-09-22 22:27 ` [bug#65866] [PATCH v2 1/8] git-download: Move fallback code to (guix build git) Ludovic Courtès
2023-09-25 8:15 ` Simon Tournier
2023-09-25 9:24 ` [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Ludovic Courtès
2023-09-25 12:13 ` Simon Tournier
2023-09-22 22:27 ` [bug#65866] [PATCH v2 2/8] git-download: Honor the ‘GUIX_DOWNLOAD_FALLBACK_TEST’ environment variable Ludovic Courtès
2023-09-22 22:27 ` [bug#65866] [PATCH v2 3/8] perform-download: Remove unused one-argument clause Ludovic Courtès
2023-09-22 22:28 ` [bug#65866] [PATCH v2 4/8] daemon: Add “git-download” built-in builder Ludovic Courtès
2023-09-22 22:28 ` [bug#65866] [PATCH v2 5/8] build: Add dependency on Git Ludovic Courtès
2023-09-25 13:59 ` Simon Tournier
2023-09-26 14:05 ` [bug#65866] Bootstrapping without the daemon and all that Ludovic Courtès
2023-09-26 17:04 ` Simon Tournier
2023-10-12 10:54 ` Ludovic Courtès
2023-10-16 8:46 ` Simon Tournier
2023-09-22 22:28 ` [bug#65866] [PATCH v2 6/8] perform-download: Use the ‘git’ command captured at configure time Ludovic Courtès
2023-09-22 22:28 ` [bug#65866] [PATCH v2 7/8] git-download: Use “builtin:git-download” when available Ludovic Courtès
2023-09-25 8:33 ` Simon Tournier
2023-09-25 9:23 ` [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Ludovic Courtès
2023-09-25 12:37 ` Simon Tournier
2023-09-25 12:48 ` Simon Tournier
2023-09-25 15:49 ` Maxim Cournoyer
2023-09-26 15:44 ` bug#65866: " Ludovic Courtès
2023-09-26 17:13 ` [bug#65866] " Simon Tournier
2023-10-01 15:02 ` Ludovic Courtès
2023-10-16 9:11 ` [bug#65866] Toward RFC? (was Re: [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts) Simon Tournier
2023-10-30 15:12 ` Ludovic Courtès
2023-09-22 22:28 ` [bug#65866] [PATCH v2 8/8] tests: Assume ‘git’ is always available Ludovic Courtès
2023-09-11 14:25 ` [bug#65866] [PATCH 5/8] build: Add dependency on Git Ludovic Courtès
2023-09-20 17:57 ` [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Maxim Cournoyer
2023-09-22 22:00 ` Ludovic Courtès
2023-09-25 15:59 ` Maxim Cournoyer
2023-09-11 14:25 ` [bug#65866] [PATCH 6/8] perform-git-download: Use the ‘git’ command captured at configure time Ludovic Courtès
2023-09-20 17:34 ` [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Maxim Cournoyer
2023-09-11 14:25 ` [bug#65866] [PATCH 7/8] git-download: Use “builtin:git-download” when available Ludovic Courtès
2023-09-20 17:50 ` [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Maxim Cournoyer
2023-09-22 21:58 ` Ludovic Courtès
2023-09-25 15:56 ` Maxim Cournoyer
2023-09-11 14:25 ` Ludovic Courtès [this message]
2023-09-20 17:59 ` Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1488a25806497439ab0b586df11ee689dd7fb446.1694441831.git.ludo@gnu.org \
--to=ludo@gnu.org \
--cc=65866@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).