tests: Skip lint tests when HTTP server cannot listen.

This could happen when running tests in parallel.

* tests/lint.scm ("github-url")
("github-url: one suggestion")
("github-url: already the correct github url")
("archival: missing content")
("archival: content available")
("archival: missing revision")
("archival: revision available")
("archival: rate limit reached"): Add 'test-skip' statement above.
This commit is contained in:
Ludovic Courtès 2020-06-25 23:30:07 +02:00
parent 5813a0c94f
commit 95c2bc49cf
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 9 additions and 0 deletions

View File

@ -737,6 +737,7 @@
(single-lint-warning-message
(check-mirror-url (dummy-package "x" (source source))))))
(test-skip (if (http-server-can-listen?) 0 1))
(test-equal "github-url"
'()
(with-http-server `((200 ,%long-string))
@ -748,6 +749,7 @@
(sha256 %null-sha256)))))))
(let ((github-url "https://github.com/foo/bar/bar-1.0.tar.gz"))
(test-skip (if (http-server-can-listen?) 0 1))
(test-equal "github-url: one suggestion"
(string-append
"URL should be '" github-url "'")
@ -770,6 +772,8 @@
(method url-fetch)
(uri (%local-url))
(sha256 %null-sha256))))))))))))
(test-skip (if (http-server-can-listen?) 0 1))
(test-equal "github-url: already the correct github url"
'()
(check-github-url
@ -893,6 +897,7 @@
'()
(check-formatting (dummy-package "x")))
(test-skip (if (http-server-can-listen?) 0 1))
(test-assert "archival: missing content"
(let* ((origin (origin
(method url-fetch)
@ -904,6 +909,7 @@
(source origin)))))))
(warning-contains? "not archived" warnings)))
(test-skip (if (http-server-can-listen?) 0 1))
(test-equal "archival: content available"
'()
(let* ((origin (origin
@ -917,6 +923,7 @@
(parameterize ((%swh-base-url (%local-url)))
(check-archival (dummy-package "x" (source origin)))))))
(test-skip (if (http-server-can-listen?) 0 1))
(test-assert "archival: missing revision"
(let* ((origin (origin
(method git-fetch)
@ -936,6 +943,7 @@
(check-archival (dummy-package "x" (source origin)))))))
(warning-contains? "scheduled" warnings)))
(test-skip (if (http-server-can-listen?) 0 1))
(test-equal "archival: revision available"
'()
(let* ((origin (origin
@ -951,6 +959,7 @@
(parameterize ((%swh-base-url (%local-url)))
(check-archival (dummy-package "x" (source origin)))))))
(test-skip (if (http-server-can-listen?) 0 1))
(test-assert "archival: rate limit reached"
;; We should get a single warning stating that the rate limit was reached,
;; and nothing more, in particular no other HTTP requests.