aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2024-02-19 17:53:52 +0100
committerLudovic Courtès <ludo@gnu.org>2024-03-09 18:55:49 +0100
commit47a0e5d9fb2209a27c2bffa163becbcb3356bf00 (patch)
tree62072dcf7565f88fdb30c74dbc070d3102234a70 /tests
parent3328dec08757a14ae47f4cbd7017b7518adc689e (diff)
downloadguix-47a0e5d9fb2209a27c2bffa163becbcb3356bf00.tar.gz
guix-47a0e5d9fb2209a27c2bffa163becbcb3356bf00.zip
lint: archival: Trigger “Save Code Now” for VCSes other than Git.
Until now, ‘save-origin’ would be called only when given a <git-reference>. With this change, ‘save-origin’ gets called for other version control systems as well. * guix/lint.scm (swh-response->warning): New procedure, formerly in ‘check-archival’. (vcs-origin, save-package-source): New procedures. (check-archival)[response->warning]: Remove. Call ‘save-package-source’ in both the Git and the non-Git cases. * tests/lint.scm ("archival: missing svn revision"): New test. Change-Id: I535e4ec89488faf83bfa544d5e4935fa73ef54fb
Diffstat (limited to 'tests')
-rw-r--r--tests/lint.scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index 87213fcc78..95d82d7490 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1407,6 +1407,26 @@
(check-archival (dummy-package "x" (source origin)))))))
(warning-contains? "scheduled" warnings)))
+(test-assert "archival: missing svn revision"
+ (let* ((origin (origin
+ (method svn-fetch)
+ (uri (svn-reference
+ (url "http://example.org/svn/foo")
+ (revision "1234")))
+ (sha256 (make-bytevector 32))))
+ ;; https://archive.softwareheritage.org/api/1/origin/save/
+ (save "{ \"origin_url\": \"http://example.org/svn/foo\",
+ \"save_request_date\": \"2014-11-17T22:09:38+01:00\",
+ \"save_request_status\": \"accepted\",
+ \"save_task_status\": \"scheduled\" }")
+ (warnings (with-http-server `((404 "No extid.") ;lookup-directory-by-nar-hash
+ (404 "No revision.") ;lookup-revision
+ (404 "No origin.") ;lookup-origin
+ (200 ,save)) ;save-origin
+ (parameterize ((%swh-base-url (%local-url)))
+ (check-archival (dummy-package "x" (source origin)))))))
+ (warning-contains? "scheduled" warnings)))
+
(test-equal "archival: revision available"
'()
(let* ((origin (origin